Linux应用程序开发笔记:VLAN配置及开机启动VLAN

开启802.1q Module:

sudo modprobe 8021q

创建VLAN:

sudo vconfig add eth0 10
sudo vconfig add eth0 20

配置VLAN:

sudo ifconfig eth0.10 192.168.10.10 up
sudo ifconfig eth0.20 192.168.20.10 up

配置VLAN开机启动:

sudo vim /etc/network/interfaces
auto eth0.10
iface eth0.10 inet static
    address 192.168.10.10
    netmask 255.255.255.0

auto eth0.20
iface eth0.20 inet static
    address 192.168.20.10
    netmask 255.255.255.0
发布了41 篇原创文章 · 获赞 4 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/u010018991/article/details/97373176