Bob Hoffman
2012-Jan-27 22:16 UTC
[CentOS] After a long break, one more try at bond/bridge nics
took a couple months off due to road blocks, hoping a fresh look would allow me to use my server as desired. I have three ports, eth0-2 over two nics. I want to bond them, and then use a bridge to connect to virtual machines on the virtual host computer. Never having done this, I am confused on some parts. Here is where I am at now and any pointers helpful. Single server, centos 6.x My issue is do I add the ip address of the virtual host and where? Do I not add any of the ip addresses of the virtual machines? (thus they will be looked for via the bridge?) Each virtual machine will be getting its own ip address as it will be used for a website. here is the basic configuration I am looking at, with some things not added like hwaddress and a few tweaks (zeroconf?) am I even close? I admit I have never done this and have no mentor other than this exceptional mailing list. ===========================/etc/modprobe.conf alias bond0 bonding options bond0 mode=balance-alb miimon=100 =========================== ===========================bond0 DEVICE=bond0 BOOTPROTO=none BRIDGE=br0 ONBOOT=yes BONDING_OPTS="mode=1 miimon=100 primary=eth0" =========================== ===========================br0 DEVICE=br0 TYPE=Bridge BOOTPROTO=none IPADDR=<my virtual host IP address?> NETWORK=xxx.xx.xx.xxx BROADCAST=xxx.xx.xx.xx NETMASK=255.255.255.0 ONBOOT=yes GATEWAY=xx.xxx.xxx.xx =========================== I did not add the hwaddress to the items below. =======================================eth0 DEVICE=eth0 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none eth1 DEVICE=eth0 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none eth2 DEVICE=eth0 USERCTL=no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none =========================================
Digimer
2012-Jan-27 22:21 UTC
[CentOS] After a long break, one more try at bond/bridge nics
I do this in my clusters (using six NICs, but that doesn't matter). I've documented how I create bonds and bridges with details here: https://alteeve.com/w/2-Node_Red_Hat_KVM_Cluster_Tutorial#Network Scroll down a bit to: https://alteeve.com/w/2-Node_Red_Hat_KVM_Cluster_Tutorial#Configuring_The_Bridge and https://alteeve.com/w/2-Node_Red_Hat_KVM_Cluster_Tutorial#Network In short; - Put the host's IP on the bridge, not the bond. - HWADDR are defined in the interfaces only, not the bond or bridge. Digimer On 01/27/2012 05:16 PM, Bob Hoffman wrote:> took a couple months off due to road blocks, hoping a fresh look would > allow me to use my server as desired. > > I have three ports, eth0-2 over two nics. > I want to bond them, and then use a bridge to connect to virtual > machines on the virtual host computer. > Never having done this, I am confused on some parts. > > Here is where I am at now and any pointers helpful. Single server, > centos 6.x > My issue is do I add the ip address of the virtual host and where? > Do I not add any of the ip addresses of the virtual machines? (thus they > will be looked for via the bridge?) > Each virtual machine will be getting its own ip address as it will be > used for a website. > > here is the basic configuration I am looking at, with some things not > added like hwaddress and a few tweaks (zeroconf?) > > am I even close? I admit I have never done this and have no mentor other > than this exceptional mailing list. > > ===========================> /etc/modprobe.conf > alias bond0 bonding > options bond0 mode=balance-alb miimon=100 > ===========================> > ===========================> bond0 > DEVICE=bond0 > BOOTPROTO=none > BRIDGE=br0 > ONBOOT=yes > BONDING_OPTS="mode=1 miimon=100 primary=eth0" > ===========================> > ===========================> br0 > DEVICE=br0 > TYPE=Bridge > BOOTPROTO=none > IPADDR=<my virtual host IP address?> > NETWORK=xxx.xx.xx.xxx > BROADCAST=xxx.xx.xx.xx > NETMASK=255.255.255.0 > ONBOOT=yes > GATEWAY=xx.xxx.xxx.xx > ===========================> > I did not add the hwaddress to the items below. > =======================================> eth0 > DEVICE=eth0 > USERCTL=no > ONBOOT=yes > MASTER=bond0 > SLAVE=yes > BOOTPROTO=none > > eth1 > DEVICE=eth0 > USERCTL=no > ONBOOT=yes > MASTER=bond0 > SLAVE=yes > BOOTPROTO=none > > eth2 > DEVICE=eth0 > USERCTL=no > ONBOOT=yes > MASTER=bond0 > SLAVE=yes > BOOTPROTO=none > ========================================> > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos-- Digimer E-Mail: digimer at alteeve.com Papers and Projects: https://alteeve.com
Bob Hoffman
2012-Jan-28 03:03 UTC
[CentOS] After a long break, one more try at bond/bridge nics - solved
well...still cleaning up files to find what is and is not needed in those eth, bond, and br files... here goes.. one.... eth files nm_controlled no, master=bond0, slave=yes no ipaddresses or any of that stuff... bond file.. #1 thing....it must be name ifcfg-bond0, not just bond0 However, the eth files must reference solely as bond0 without the ifcfg. the bond file, for the moment had the ip addresses and stuff, not sure if I need them there or not. (probably do not need them, but it worked with them) nm_controlled=no BRIDGE=br0 bonding options go in this file too. in etc/modprobe.d/ you need to make a file called bonding.conf add this line alias bond0 bonding the ifcfg-br0 file, MUST be named ifcfg-br0 (or whatever your bridge is name, br1, br2, etc) should contain type=Bridge VERY IMPORTANT YOU SPELL IT WITH A CAPITAL B, and lowercase the rest of the word bridge. (that is what was needed...go figure) add the ipaddresses, netmask, etc etc etc to this file resolv.conf you want to add your dns servers, or for a quickie fix add nameserver 8.8.8.8 nameserver 8.8.4.4 (these are googles free dns resolvers) anyway, this is just a quickie solution, will be posting a vid of each step soon.. finally!!!!!!!!!!! updated from 6.0 to the new version....big update...gotta wait...won't let me access the VMs while updating...sounds scary...yikes