1

I am trying to setup CentOS 7 on a server to host VM's via KVM. The networking I am trying to set up should allow multiple vlans across the two NICs via bond/bridge setup. It's not working at all. I cannot figure out what I am doing wrong. Can someone please point me in the right direction?

bonding.conf

alias bond0 bonding
options bond0 miimon=100 mode=4 lacp_rate=1

bond0.conf

alias bond0 bonding
options bond0 miimon=100 mode=4 lacp_rate=1

ifcfg-lo

DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback

ifcfg-bond0

# Use tagged VLANs
ARP=no
BOOTPROTO=none
DEVICE=bond0
IPV6INIT=no
## Optional, use for jumbo frames if needed
#MTU=9000
NM_CONTROLLED=yes
NOZEROCONF=yes
ONBOOT=yes
BONDING_MASTER=yes
BONDING_OPTS="mode=4 miimon=100 updelay=30000"

ifcfg-bond0.341

DEVICE=bond0.341
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
VLAN=yes
BRIDGE=br341
NM_CONTROLLED=yes

ifcfg-bond0.342

DEVICE=bond0.342
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
VLAN=yes
BRIDGE=br342
NM_CONTROLLED=yes

ifcfg-bond0.400

DEVICE=bond0.400
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
VLAN=yes
BRIDGE=br400
NM_CONTROLLED=yes

ifcfg-bond0.450

DEVICE=bond0.450
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
VLAN=yes
BRIDGE=br450
NM_CONTROLLED=yes

ifcfg-br341

NM_CONTROLLED=yes
DEVICE=br341
ONBOOT=yes
TYPE=Bridge
VLAN=yes
# IPv4
DNS1=192.168.36.3
DNS2=192.168.100.3
DNS3=192.168.160.10
NOZEROCONF=yes
STP=yes
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="Bridge br341"
BRIDGING_OPTS=priority=32768
IPADDR=192.168.34.21
PREFIX=26
GATEWAY=192.168.34.1
NETWORK=192.168.34.0

ifcfg-br342

NM_CONTROLLED=yes
DEVICE=br342
ONBOOT=yes
TYPE=Bridge
VLAN=yes
# IPv4
DNS1=192.168.36.3
DNS2=192.168.100.3
DNS3=192.168.160.10
NOZEROCONF=yes
STP=yes
BRIDGING_OPTS=priority=32768
BOOTPROTO=none
IPADDR=192.168.34.86
GATEWAY=192.168.34.65
NETWORK=192.168.34.64
PREFIX=26
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
NAME="Bridge br342"

ifcfg-br400

NM_CONTROLLED=yes
DEVICE=br400
ONBOOT=yes
TYPE=Bridge
VLAN=yes
# IPv4
DNS1=192.168.36.3
DNS2=192.168.100.3
DNS3=192.168.160.10
NOZEROCONF=yes
STP=yes
BRIDGING_OPTS=priority=32768
BOOTPROTO=none
IPADDR=192.168.43.21
GATEWAY=192.168.43.1
NETWORK=192.168.43.0
PREFIX=26
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="Bridge br400"

ifcfg-br450

NM_CONTROLLED=yes
DEVICE=br450
ONBOOT=yes
TYPE=Bridge
VLAN=yes
# IPv4
DNS1=192.168.36.3
DNS2=192.168.100.3
DNS3=192.168.160.10
NOZEROCONF=yes
STP=yes
BOOTPROTO=none
IPADDR=192.168.34.150
GATEWAY=192.168.34.129
NETWORK=192.168.34.128
PREFIX=26
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="Bridge br450"

ifcfg-em1

TYPE=Ethernet
DEVICE=em1
ONBOOT=yes
MASTER=bond0
NOZEROCONF=yes
ONBOOT=yes
SLAVE=yes
NAME="System em1"
NM_CONTROLLED="yes"

ifcfg-em1.341

DEVICE=em1.341
ONBOOT=yes
VLAN=yes
BOOTPROTO=none
SLAVE=yes
MASTER=bond0.341
NM_CONTROLLED=yes

ifcfg-em1.342

DEVICE=em1.342
ONBOOT=yes
VLAN=yes
BOOTPROTO=none
SLAVE=yes
MASTER=bond0.342
NM_CONTROLLED=yes

ifcfg-em1.400

DEVICE=em1.342
ONBOOT=yes
VLAN=yes
BOOTPROTO=none
SLAVE=yes
MASTER=bond0.342
NM_CONTROLLED=yes

ifcfg-em1.450

DEVICE=em1.450
ONBOOT=yes
VLAN=yes
BOOTPROTO=none
SLAVE=yes
MASTER=bond0.450
NM_CONTROLLED=yes

ifcfg-em2

NM_CONTROLLED="yes"
DEVICE=em2
ONBOOT=yes
MASTER=bond0
NOZEROCONF=yes
ONBOOT=yes
SLAVE=yes
TYPE=Ethernet
NAME="System em2"

ifcfg-em2.341

DEVICE=em2.341
ONBOOT=yes
VLAN=yes
BOOTPROTO=none
SLAVE=yes
MASTER=bond0.341
NM_CONTROLLED=yes

ifcfg-em2.342

DEVICE=em2.342
ONBOOT=yes
VLAN=yes
BOOTPROTO=none
SLAVE=yes
MASTER=bond0.342
NM_CONTROLLED=yes

ifcfg-em2.400

DEVICE=em2.400
ONBOOT=yes
VLAN=yes
BOOTPROTO=none
SLAVE=yes
MASTER=bond0.400
NM_CONTROLLED=yes

ifcfg-em2.450

DEVICE=em2.450
ONBOOT=yes
VLAN=yes
BOOTPROTO=none
SLAVE=yes
MASTER=bond0.450
NM_CONTROLLED=yes
  • 1
    The vlan tagging occurs at the bond interface. All the tagging you are configuring for the bond slaves (em*) is unneeded / wrong. NM_CONTROLLED=no should be set as well. – Mark Wagner Aug 7 '17 at 23:59
  • Ah! Thank you! So I don't need them at all or just remove the vlan tagging? – Vladinatrix Aug 8 '17 at 4:17
  • You only need ifcfg-em1 and ifcfg-em2. All other ifcfg-em*.* should be removed – Mark Wagner Aug 8 '17 at 17:05
  • Also in this case you generally disable STP. VLAN=yes on the bridge interfaces is probably incorrect. – Mark Wagner Aug 8 '17 at 17:06
  • That did it! Thank you! I have one vlan not working, but I'm sure I can figure that out. Thanks!!!! – Vladinatrix Aug 8 '17 at 17:45
1

Summarizing my comments:

  • vlan tagging occurs at the bond interface. ifcfg-em*.* should be removed
  • NM_CONTROLLED=no should be set (don't want NM fouling things up)
  • in this VM networking with bridges scenario STP is usually disabled
  • VLAN=yes on the bridge interfaces is probably incorrect

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.