莱因电博

Li-e.cn

Li Internet Electronic Blog
@rss

Linux 创建虚拟网卡

Creating Multiple Virtual Network Adapters on Linux

————————————————————

使用 ifconfig 命令:

ifconfig <ethname>:<id> <ip> netmask <mask> <up>
  • id: 0,1,2,3……

关闭:

ifconfig <ethname>:<id> <down>

快速创建:

ifconfig enp1s0:0 172.16.0.251 netmask 255.255.255.0 up
ifconfig enp1s0:1 172.16.1.251 netmask 255.255.255.0 up
ifconfig enp1s0:2 172.16.2.251 netmask 255.255.255.0 up
ifconfig enp1s0:3 172.16.3.251 netmask 255.255.255.0 up
ifconfig enp1s0:4 172.16.4.251 netmask 255.255.255.0 up
ifconfig enp1s0:5 172.16.5.251 netmask 255.255.255.0 up
ifconfig enp1s0:6 172.16.6.251 netmask 255.255.255.0 up
ifconfig enp1s0:7 172.16.7.251 netmask 255.255.255.0 up
ifconfig enp1s0:8 172.16.8.251 netmask 255.255.255.0 up
(C) 2019 - 2024 Li-e.cn莱因电博(立网电子博客) | Powered by Vercel , based on Hugo with Gists theme.