wiki:centos_bonding_interfaces

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:centos_bonding_interfaces [2017/06/26 11:30] walkeradminwiki:centos_bonding_interfaces [2023/03/09 22:35] (current) – external edit 127.0.0.1
Line 3: Line 3:
 \\  \\ 
 \\  \\ 
- +===== Introduction =====
----- +
-==== Introduction ====+
 For network redundancy, we can bond interface pairs on the G6/G7 servers. For this example I am using CentOS 6.x, so luckily still have the ethx naming convention. For network redundancy, we can bond interface pairs on the G6/G7 servers. For this example I am using CentOS 6.x, so luckily still have the ethx naming convention.
 \\  \\ 
Line 12: Line 10:
 \\  \\ 
 \\  \\ 
-==== Management Interface Bonding ====+ 
 +---- 
 + 
 +===== Management Interface Bonding ====
 +\\ 
 For bonding the management interfaces, we will require three files. I am making the assumption that we are using the first two interfaces (eth0 and eth1) for management, and that this is our first bond on this device (so bond0): For bonding the management interfaces, we will require three files. I am making the assumption that we are using the first two interfaces (eth0 and eth1) for management, and that this is our first bond on this device (so bond0):
 <file> <file>
Line 19: Line 21:
 ifcfg-bond0 ifcfg-bond0
 </file> </file>
 +For this to work, you will need the UUID of each interface, if you don't have this, look [[wiki:generate_uuid_for_network_interface|here]] for instructions on how to generate the UUIDs.
 +\\ 
 +==== ifcfg-eth0 ====
 +<file>
 +DEVICE=eth0
 +HWADDR=00:1E:67:EB:6D:F2
 +TYPE=Ethernet
 +UUID=cceda895-dd2b-4096-9d9c-5985dd0872d7
 +ONBOOT=yes
 +MASTER=bond0
 +SLAVE=yes
 +</file>
 +Notice that there is no addressing information in the interface configuration file(s)
 +\\ 
 +==== ifcfg-eth1 ====
 +<file>
 +DEVICE=eth1
 +HWADDR=00:1E:67:EB:6D:F3
 +TYPE=Ethernet
 +UUID=7ecc849f-eefb-43a0-9796-99d368bbb28a
 +ONBOOT=yes
 +MASTER=bond0
 +SLAVE=yes
 +</file>
 +==== ifcfg-bond0 =====
 +<file>
 +InDEVICE=bond0
 +ONBOOT=yes
 +BOOTPROTO=static
 +USERCTL=no
 +BONDING_OPTS="mode=1 miimon=100"
 +IPADDR=192.168.27.100
 +NETMASK=255.255.255.0
 +GATEWAY=192.168.27.254
 +DNS1=172.16.178.100
 +DNS2=8.8.8.8
 +</file>
 +\\ 
 +So <color #ed1c24>ifcfg-eth0</color> and <color #ed1c24>ifcfg-eth1</color> don't contain any address information, but they both contain the entry <color #ed1c24>MASTER=bond0</color> to tie them to a particular bond file.
 +\\ 
 +\\ 
 +<color #22b14c>ifcfg-bond0</color> contains all of the addressing information for the two interfaces that are bonded (<color #22b14c>ifcfg-eth0 and ifcfg-eth1</color>)
 +\\ 
 +\\ 
 +Reboot the server, and you should be able to ping the management address (192.168.27.100 in this case) and if you only unplug one interface at a time, the pings should continue (you might miss one or two pings during transition).
 +\\ 
 +\\ 
 +<color #00a2e8>miimon</color> specifies the MII <color #00a2e8>link monitoring frequency in milliseconds</color>. This determines how often the link state of each slave is inspected for link failures. A value of zero disables MII link monitoring. A value of 100 is a good starting point.
 +\\ 
 +\\ 
 +
 +----
 +===== Ingress/Egress Interface Bonding =====
 +\\ 
 +For bonding the ingress/egress interfaces, we will require four files. I am making the assumption that we are using the second two interfaces (eth2 and eth3) for Egress, and that this is the second bond on this device (so bond1, bond0 being for Management):
 +<file>
 +ifcfg-eth2
 +ifcfg-eth3
 +ifcfg-bond1
 +route-bond1
 +</file>
 +So <color #ed1c24>ifcfg-eth2</color> and <color #ed1c24>ifcfg-eth3</color> are the interface configuration files, again they contain no addressing:
 +\\ 
 +==== ifcfg-eth2 ====
 +<file>
 +DEVICE=eth2
 +HWADDR=00:1E:67:F2:63:12
 +TYPE=Ethernet
 +UUID=6530a0c3-592d-44d0-8418-b6795818cf55
 +ONBOOT=yes
 +MASTER=bond1
 +SLAVE=yes
 +</file>
 +==== ifcfg-eth3 ====
 +<file>
 +DEVICE=eth3
 +HWADDR=00:1E:67:F2:63:13
 +TYPE=Ethernet
 +UUID=13c99bfe-03f9-44c8-8a91-277dbd2c192b
 +ONBOOT=yes
 +MASTER=bond1
 +SLAVE=yes
 +</file>
 +\\ 
 +Now we have the bond file (<color #22b14c>ifcfg-bond1</color>) that contains the IP Addressing
 +\\ 
 +==== ifcfg-bond1 ====
 +<file>
 +DEVICE=bond1
 +ONBOOT=yes
 +BOOTPROTO=static
 +USERCTL=no
 +BONDING_OPTS="mode=1 miimon=100"
 +IPADDR=11.0.100.1
 +NETMASK=255.0.0.0
 +</file>
 +\\ 
 +Finally we have a routing file (<color #00a2e8>route-bond1</color>) that is for the multicast routing (so we know our incoming multicast will be available on this interface/bond)
 +\\ 
 +==== route-bond1 ====
 +<file>
 +ADDRESS0=239.0.0.0
 +NETMASK0=255.0.0.0
 +GATEWAY0=11.0.100.1
 +</file>
 +\\ 
 +\\ 
 +<color #ed1c24>NOTE!</color> the routes must start from <color #ed1c24>0</color> (ADDRESS<color #ed1c24>0</color>, NETMASK<color #ed1c24>0</color>, GATEWAY<color #ed1c24>0</color>) and if there is more than one route the numbering must be contiguous.
 +\\ 
 +\\ 
 +
 +----
 +==== Route ====
 +Below we can see the route information with the bondx entries in the right hand column.
 +\\ 
 +<file>
 +Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
 +192.168.27.0    *               255.255.255.0            0        0 bond0
 +link-local      *               255.255.0.0         1004          0 eth4
 +link-local      *               255.255.0.0         1005          0 eth5
 +link-local      *               255.255.0.0         1008          0 eth7
 +link-local      *               255.255.0.0         1009          0 eth6
 +link-local      *               255.255.0.0         1010          0 bond0
 +link-local      *               255.255.0.0         1011          0 bond1
 +239.0.0.0       11.0.100.1      255.0.0.0       UG    0      0        0 bond1
 +10.0.0.0        *               255.0.0.0                0        0 eth4
 +11.0.0.0        *               255.0.0.0                0        0 bond1
 +default         192.168.27.254  0.0.0.0         UG    0      0        0 bond0
 +</file>
 +\\ 
 +\\ 
wiki/centos_bonding_interfaces.1498473044.txt.gz · Last modified: 2023/03/09 22:35 (external edit)