在Ubuntu 12.04上绑定vlans和网桥

我们正在尝试在Ubuntu 12.04上为bond0设置四个nics,带有3个标记的vlan和三个KVM VM。

使用下面的接口文件,我可以手动启动和停止networking,并获得接口,但他们不能幸免于重新启动,我得到了可怕的“等待60秒的networking…”

我也看到这些消息在dmesg:

br168:在自己的地址作为源地址的vlan168上收到数据包

而接口不稳定(虚拟机掉

cat / proc / net / vlan / config

VLAN Dev name | VLAN ID Name-Type: VLAN_NAME_TYPE_PLUS_VID_NO_PAD vlan168 | 168 | bond0 vlan169 | 169 | bond0 vlan340 | 340 | bond0 

brctl显示

 bridge name bridge id STP enabled interfaces br168 8000.e4115bea0110 no vlan168 br169 8000.e4115bea0110 no vlan169 br340 8000.e4115bea0110 no vlan340 

接口文件

 ##################interfaces###################### # # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback auto eth0 iface eth0 inet manual bond-master bond0 auto eth1 iface eth1 inet manual bond-master bond0 auto eth2 iface eth2 inet manual bond-master bond0 auto eth3 iface eth3 inet manual bond-master bond0 auto bond0 iface bond0 inet manual bond-slaves none bond-mode 2 bond-miimon 100 # The primary network interface auto vlan168 iface vlan168 inet manual vlan_raw_device bond0 # The private net auto vlan169 iface vlan169 inet manual vlan_raw_device bond0 # Storage network auto vlan340 iface vlan340 inet manual vlan_raw_device bond auto br168 iface br168 inet static address xxxx.xxxx.xxxx.6 netmask 255.255.255.128 network xxxx.xxxx.xxxx.0 gateway xxxx.xxxx.xxxx.1 # dns-* options are provided by the reolvconf package if installed dns-nameservers xxxx.xxxx.xxxx.xxxx dns-search search.domain bridge_ports vlan168 bridge_maxwait 0 bridge_fd 0 bridge_stp off auto br169 iface br169 inet static address xxxx.xxxx.xxxx.134 netmask 255.255.255.128 gateway xxxx.xxxx.xxxx.129 bridge_ports vlan169 bridge_maxwait 0 bridge_fd 0 bridge_stp off auto br340 iface br340 inet static address xxxx.xxxx.xxxx.6 netmask 255.255.255.128 gateway xxxx.xxxx.xxxx.1 bridge_ports vlan340 bridge_maxwait 0 bridge_fd 0 bridge_stp off ######################interfaces################## ###### 

就像我说的,我可以通过安装和发布来获得接口:

服务networking停止/启动或/etc/init.d/networking停止/启动

为了获得接口。

我似乎已经为自己工作了。 原来是债券模式 – 当设置为1似乎很好。 我仍然得到几个“bond0不支持的VLAN”消息,但没有“收到带有它自己的地址的分组”错误。

一般来说,接口要顺畅得多。 我们会看看这个星期能否幸存下来:)

我确实需要将这些条目添加到/etc/sysctl.conf

 net.bridge.bridge-nf-call-ip6tables = 0 net.bridge.bridge-nf-call-iptables = 0 net.bridge.bridge-nf-call-arptables = 0 net.bridge.bridge-nf-filter-vlan-tagged = 0 

接着

 sysctl -p 

以及冲洗ebtables

 ebtables -F 

然后,我拿下了非function桥接口

 ifconfig brxx down .... brctl delbr brxx ... 

然后在接口文件中将绑定模式更改为1

 bond-mode 1 

然后开始联网。

即使似乎重新启动生存