Ubuntu Linux,Bonding和VLANS – 我可以configuration所有接口进行标记吗? IE:启动没有IP地址的BOND0接口

我有一个服务器与债券bond0多个适配器。

我不确定(即使经过广泛的研究)如何在没有IP地址的情况下调用bond0设备。 我希望VLAN使用bond0,但在服务器上没有未标记的接口。

auto eth0 iface eth0 inet manual bond-master bond0 auto eth1 iface eth1 inet manual bond-master bond0 auto bond0 iface bond0 inet static address 192.168.1.100 netmask 255.255.255.0 network 192.168.1.0 bond-slaves none bond-miimon 100 bond-mode 802.3ad auto vlan50 iface vlan50 inet static address 192.168.248.241 netmask 255.255.255.0 network 192.168.248.0 vlan-raw-device bond0 

以上configuration工作正常,并且工作正常,除了bond0的地址不在标记的vlan上。

开关设置正确。 VLAN工作正常。 服务器是多个VLAN的成员,上面的configuration被简化了,因为剩下的configuration与我的问题无关。

是的,我只能把一个虚拟地址放到bond0接口中,但对我来说这并不是那么干净。

我试过以下:

https://wiki.debian.org/NetworkConfiguration#Bringing_up_an_interface_without_an_IP_address

但是,这不起作用,并留下bond0未configuration,因此没有networking连接。

操作系统:Ubuntu 14.04.2 LTS

我会假设这样的事情应该工作:

 auto lo iface lo inet loopback auto bond0 iface bond0 inet static pre-up ifconfig bond0 up pre-up ifenslave bond0 eth0 || /bin/true pre-up ifenslave bond0 eth1 || /bin/true down ifenslave -d bond0 eth0 || /bin/true down ifenslave -d bond0 eth1 || /bin/true auto bond0.50 iface bond0.50 inet static address 192.168.248.241 netmask 255.255.255.0 network 192.168.248.0 

我不知道最近的Debian版本的networkingconfiguration文件的细节,但你应该遵循以下步骤achevie你想要的:

  1. 使用命令"ip addr flush dev bond0""ifconfig bond0 ip 0.0.0.0"删除基本接口(bond0)IP
  2. 插入一个iptables规则,使用命令"iptables -I INPUT 1 -i bond0 -j DROP"删除来自未标记接口(bond0)的任何stream量。

无论如何,将交换机configuration为放弃所有来自用于绑定的特定networking端口的未标记stream量可能更容易。