0

I have the following configuration in a RHEL6.5 which works great.

# ifcfg-em1_2
DEVICE=em1_2
HWADDR=C8:1F:66:D8:77:D2
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
USERCTL=no

#ifcfg-em2_2
DEVICE=em2_2
HWADDR=C8:1F:66:D8:77:E2
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
USERCTL=no

#ifcfg-bond0
ARP=no
BOOTPROTO=none
DEVICE=bond0
IPV6INIT=no
NM_CONTROLLED=no
NOZEROCONF=yes
ONBOOT=yes
BONDING_OPTS="mode=1 miimon=100"

#ifcfg-bond0.18
DEVICE=bond0.18
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
VLAN=yes
BRIDGE=br0

# ifcfg-br0
DEVICE=br0
ONBOOT=yes
SLAVE=bond0.18
TYPE=Bridge
DELAY=0
VLAN=yes

# IPv4
GATEWAY=<GATEWAY>
IPADDR=<IP>
NETMASK=<NETMASK>
NM_CONTROLLED=no
NOZEROCONF=yes

DOMAIN=<DOMAIN>
DNS1=<DNS1>
DNS2=<DNS2>

# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.c81f66d877df       no              bond0.18
                                                        vnet0
                                                        vnet1
virbr0          8000.52540014bdec       yes             virbr0-nic

I want to add a second bridge over the same bond but instead of tagging it with vlan 18, use for example vlan 26. I tried adding the following files and restart the network service, yet it didnt work and lost connection to the server. Had to eliminate the br1 config file and restart the network again, so for some reason I can't have the 2 bridges together. Is there something I am missing?

#ifcfg-bond0.26
DEVICE=bond0.26
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
VLAN=yes
BRIDGE=br1

# ifcfg-br1
DEVICE=br1
ONBOOT=yes
SLAVE=bond0.26
TYPE=Bridge
DELAY=0
VLAN=yes

# IPv4
GATEWAY=<GATEWAY2>
IPADDR=<IP2>
NETMASK=<NETMASK2>
NM_CONTROLLED=no
NOZEROCONF=yes

DOMAIN=<DOMAIN>
DNS1=<DNS1>
DNS2=<DNS2>

Also I'm new managing KVM machines so in the brctl show output I wrote above, there's a virbr0 interface I don't know where it came from. I suppose its the vnic for the virtual machines, do I have to set something like that after the second bridge is working? The idea is to have multiple interfaces in the VM (for service, backups, bd connection, etc), like I said, at first I only had 1 working but I'm confused on how to add more.

Cheers,

Nocturn
  • 133
  • 1
  • 10

2 Answers2

0

virbr0 is the likely the name KVM it chose when it created a bridge for you. It is difficult but not impossible to configure your own bridge.

From my reading of the documentation on configuring bridges, you should have only one bridge connected to a physical device (eth0, bond0, etc).

You could configure a second bridge and use IP forwarding to handle traffic routing. This is fairly easy to do.

You should be able to tag multiple vlans on the same bridge. This is likely the simplest method.

BillThor
  • 27,737
  • 3
  • 37
  • 69
  • Sorry but your answer confuse me. Since my configuration right now is bond0 -> bond0.18 -> br0, your suggestion is to change that to something like, bond0 -> br0 -> br0.18?? And then add another br0.26? – Nocturn Jun 22 '15 at 13:37
  • This is wrong, sorry – dyasny Jun 22 '15 at 14:09
0

What you are trying to do is exactly the right way to do it.

  • you have two NICs in a bond
  • you have the bond itself
  • on the bond, you can create a tagged interface plus bridge for every VLAN you have in use, and connect separate VM vNICs to those bridges.

Just remember that VMs have a limited number of PCI addresses, so you can't have 4000 NICs.

EDIT: The virbr0 bridge is automatically created by libvirt. You can safely ignore it and use your own configuration.

dyasny
  • 18,802
  • 6
  • 49
  • 64
  • Thank you for your anwser, however, I don't get why when I try to add the 2nd bridge I lose the connection to the hosts (in other words the 1st bridge, br0 goes down). It shouldn't be because the PCI addresses since my VMs have only 1 NIC configure right now. – Nocturn Jun 22 '15 at 15:11
  • I suspect the routing changes when you add a second bridge with a second IP. Make sure to make these changes during downtime, and also make sure the routes are correct after the change – dyasny Jun 22 '15 at 16:34