首先使用vconfig创建vlan虚拟接口,并分别在两个接口上增加vlan100\vlan200\vlan300
vconfig add eth0 100
vconfig add eth0 200
vconfig add eth0 300
vconfig add eth1 100
vconfig add eth1 200
vconfig add eth1 300

启用vlan端口
ifconfig eth0.100 up
ifconfig eth0.200 up
ifconfig eth0.300 up
ifconfig eth1.100 up
ifconfig eth1.200 up
ifconfig eth1.300 up

创建网桥(名称为br0)
brctl addbr br0


//加入端口(分别将两个Vlan加入网桥中)
切记:不是将eth0和eth1添加到网桥中
brctl addif br0 eth0.100
brctl addif br0 eth0.200
brctl addif br0 eth0.300
brctl addif br0 eth1.100
brctl addif br0 eth1.200
brctl addif br0 eth1.300


注: 一般情况所有Vlan使用一个网桥即可。如果vlan很少,也可以一个vlan使用一个网桥,但这也有局限性,因为linux2.6最多只允许增加30个网桥,但这对小型的网络来说已经足够用了)


GitHub 加速计划 / li / linux-dash
13
2
下载
A beautiful web dashboard for Linux
最近提交(Master分支:4 个月前 )
186a802e added ecosystem file for PM2 5 年前
5def40a3 Add host customization support for the NodeJS version 5 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐