Debian桥接网络(bridge)针对多个交换机
一、安装bridge服务
1 |
apt-get install bridge-utils |
二、建立一个桥接网络接口
1 |
brctl addbr br0 |
三、检查是否成功
1 |
ip addr show |
四、将两个网络接口合并为一个桥接设备,意思即为两个网卡共享网络连接
1 |
brctl addif br0 eth0 eth1 |
五、查看网桥中有哪些网卡
1 |
brctl show |
六、修改network配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
vim /etc/network/interfaces #注释物理网卡 #auto eth0 #iface eth0 inet dhcp iface eth0 inet static address 198.10.20.3 netmask 255.255.255.248 gateway 198.10.20.1 #启用虚拟接口 auto br0 iface br0 inet static address 198.10.20.3 netmask 255.255.255.248 gateway 198.10.20.1 bridge_ports eth0 eth1 bridge_stp on up ifconfig eth0 up 0 0.0.0.0 up ifconfig eth1 up 0 0.0.0.0 bridge_fd 0 bridge_hello 1 bridge_maxwait 9 |
七、重启服务器
1 |
reboot |