I'm not sure how to configure my Linux server which has a single VLAN'ed interface to support a number of Virtual machines which I want to bridge to my network (so that all their services appear to come from a number of real machines on my network). Do I simply create a single bridged network interface br0
, tied to my existing VLAN'ed device, and have all the VMs use that interface? Or do I need to set up br0
, br1
, br2
, etc. for each VM? Can I even tie those bridge interfaces to a VLAN'ed interface? I suppose I need to say VLAN="yes"
in the bridge's ifcfg file?
True, I could simply try it and see, but at this point I am so unsure about how it all comes together that I'd like to perform a sanity check before I get a sanity wreck :-) .
I have set up a CentOS7 host:
# uname -a
Linux cha028 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
It has a single interface which has a VLAN. So hardware interface em1 has:
# cat ifcfg-em1
NAME="em1"
DEVICE="em1"
ONBOOT="yes"
TYPE="Ethernet"
BOOTPROTO="none"
HWADDR=14:fe:b5:d6:07:cc
NM_CONTROLLED=no
...and I have a ifcfg-em1.144 that has all the IP addressing in it and such. I have installed a plurality of VMs on the box. Now I need to make the network work.
How do I do it? Simply create ifcfg-br0 as per https://www.banym.de/linux/centos/setup-bridge-device-on-centos (with its own unique IP address), and simply add a line to my ifcfg-em1.144 file which says BRIDGE=br0
?
And, having done so, can I attach all my VMs to the br0 device?
Thank you for your indulgence, and your help.
Here is my ifcfg-em1.144
file. Note that /etc/sysconfig/network
contains the GATEWAY line:
VLAN="yes"
DEVICE="em1.144"
PHYSDEV="em1"
TYPE="Ethernet"
BOOTPROTO="static"
DEFROUTE="yes"
ONBOOT="yes"
IPADDR="10.144.101.28"
PREFIX="24"
NM_CONTROLLED=no