Child pages
  • Configure Pair Bonding and Bridges for KVM Hypervisor

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

These settings are for a pair of network ports in a simple failover configuratoin.

  • Allocate the host address hostname and IP address for the TUSK server in DNS.
    • Always do this first, to avoid DNS conflicts or other surprises.
    • Make sure the reverse DNS matches the forward DNS.
    • If there will be a web proxy or load balancer in front of a TUSK server,
    make sure that the host has a real local address name, not just the name published for the proxy
    • allocate the DNS and IP address for that separately.
  • Access the server  server with the a remote console or keyboard and monitor.
    • Do not rely on an SSH login to make network changes. It's too easy to cut off access while reconfiguring a network.
    • Do not do this on an active, production server, there can be very confusing service interruptions.
  • Edit /etc/modprobe.d/bond0.conf to contain this. Do not set other bonding parameters here.
    Code Block
    alias bond0 bonding
    
  • Edit /etc/sysconfig/network to set the hostname and various other useful settings.
    • IPv6 must, must, must be enabled for pair bonding and other features to work reliably.
    • NOZEROCONF=yes avoids the unnecessary "169.254.*" fallback addresses and routing from being activated, which are purely confusing in normal environments.
      Code Block
      NETWORKING=yes
      HOSTNAME=hostname.example.com
      # IPv4
      NETWORKING=yes
      NOZEROCONF=yes
      # IPv6, necessary for bonding
      NETWORKING_IPV6=yes
      IPV6INIT=yes
      
      
  • These notes are based on the network devices being called "eth0", "eth1", etc.
    • Edit as necessary for devices referred to as "em0", "em1", etc.
    • Run "/sbin/ifconfig -a" to get the list of all available devices and their MAC addresses.
  • Edit /etc/sysconfig/network-scripts/ifcfg-eth0.
    • Make sure that HWADDR matches in this file the actual MAC address of the port.
      • Run Confirm this with "/sbin/ifconfig -aeth0" to report this.
    • Notice the bonding settings for MASTER and SLAVE.
    • Notice the NM_CONTROLLED=no, to block NetworkManager from ever touching this port.
    • Notice the "MTU=9000" setting to enable jumbo frames. This is a common practice in server environments, and should be activated as needed.
       
      Code Block
      BOOTPROTO=none
      DEVICE=eth0
      HWADDR=aa:bb:cc:dd:ee:ff
      MASTER=bond0
      #MTU=9000
      NM_CONTROLLED=no
      NOZEROCONF=yes
      ONBOOT=yes
      SLAVE=yes
      TYPE=Ethernet
      
      
  • Edit /etc/sysconfig/network-scripts/ifcfg-eth1.
    • Adjust the HWADDR to match the actual MAC address of the port.
      • Run "/sbin/ifconfig -a" to report this.
    • Notice the "DEVICE" name is different than ifcfg-eth0.
    • Notice that all other settings are identical to ifcfg-eth0.
      Code Block
      BOOTPROTO=none
      DEVICE=eth1
      HWADDR=aa:bb:cc:dd:ee:ff
      MASTER=bond0
      # Uncomment for jumbo frames
      #MTU=9000
      NM_CONTROLLED=no
      NOZEROCONF=yes
      ONBOOT=yes
      SLAVE=yes
      TYPE=Ethernet
      
      
  • Edit /etc/sysconfig/network-scripts/ifcfg-bond0.
    • Notice the BONDING_OPTS, suitable for fail-over bonding and 100 msec failoversfailover times.
      Code Block
      ARP=noARP=no
      BONDING_OPTS="mode=1 miimon=100"
      BOOTPROTO=static
      BRIDGE=br0
      DEVICE=bond0
      # Uncomment for jumbo frames
      #MTU=9000
      NM_CONTROLLED=no
      ONBOOT=yes
      
      
  • Edit /etc/sysconfig/network-scripts/ifcfg-br0.
    • This selects the appropriate bridge for KVM based virtualization.
      Code Block
      BOOTPROTO=static
      DEVICE=br0
      GATEWAY=192.168.1.xxx
      IPADDR=192.168.1.yyy
      NETMASK=255.255.255.0
      NM_CONTROLLED=no
      ONBOOT=yes
      SLAVE=bond0
      TYPE=Ethernet