How Do I Bind Two Network Adapters on SUSE 12
Prerequisites
- The server has been configured with two network adapters, which are properly connected to the network.
- The single network adapter mode has been configured.
Context
Two network adapters can be bound as one virtual network adapter. After the binding, the two network adapters work in active/standby mode. One faulty network adapter does not affect system operations. Binding of two network adapters can improve system reliability.
Procedure
The following uses the example of binding eth0 and eth1 as bond0 and using the network configurations of eth0 (IP address: 192.168.1.100; subnet mask: 255.255.255.0) as an example to describe how to bind two network adapters on SUSE 12:
- Log in to the operating system as the root user and access the CLI.
- Run the following command to switch to the directory where the configuration file is located:
# cd /etc/sysconfig/network
- Configure the ifcfg-bond0 configuration file of bond0.
- Check whether the ifcfg-bond0 file exists.
# ls ifcfg-bond0
If the ifcfg-bond0 file exists, delete it.
# rm -f ifcfg-bond0
- Run the following command to configure the file:
# vi ifcfg-bond0
BOOTPROTO='static' IPADDR='192.168.1.100' NETMASK='255.255.255.0' STARTMODE='auto' BONDING_MASTER='yes' BONDING_MODULE_OPTS='mode=active-backup miimon=100' BONDING_SLAVE0='eth0' BONDING_SLAVE1='eth1'
- Save the configuration and exit.
# :wq
- Run the following commands to set permission on the ifcfg-bond0 configuration file of bond0:
# chmod 640 ifcfg-bond0
# chown root:root ifcfg-bond0
- Check whether the ifcfg-bond0 file exists.
- Configure the vi ifcfg-eth0 configuration file of eth0.
- Check whether the ifcfg-eth0 file exists.
# ls ifcfg-eth0
If the ifcfg-eth0 file exists, delete it.
# rm -f ifcfg-eth0
- Run the following command to configure the file:
# vi ifcfg-eth0
BOOTPROTO='none' STARTMODE='hotplug'
- Save the configuration and exit.
# :wq
- Run the following commands to set permission on the configuration file of eth0:
# chmod 640 ifcfg-eth0
# chown root:root ifcfg-eth0
- Check whether the ifcfg-eth0 file exists.
- Configure the configuration file of eth1.
The configuration method for eth1 is the same as that for eth0. You can run the following command to copy the configuration file of eth0:
# cp -pf ifcfg-eth0 ifcfg-eth1
- Restart the network adapters to make the configuration take effect.
# rcnetwork restart
- Verify the network adapter binding.
- Check the IP address configuration.
# ifconfig
If an IP address is only configured for bond0, and the MAC addresses of bond0, eth0, and eth1 are the same, the configuration is successful.
- View the network adapter binding information.
# cat /proc/net/bonding/bond0
Check the network adapter binding status and the active network adapter. If information similar to the following is displayed, the network adapter binding status is up, and the active network adapter is eth0.
eSightServer:~ # cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Active Slave: eth0MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: eth0 MII Status: up Speed: 100 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: a4:c6:4f:16:98:d2 Slave queue ID: 0 Slave Interface: eth1 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: a4:c6:4f:16:98:d3 Slave queue ID: 0
- Log in to another PC that can communicate with the network where eSight is deployed, input ping IP address of the eSight server on the CLI, and press Enter.
Example: ping 192.168.1.100. If the server can be pinged, eth0 is bound successfully.
- Test network adapter switching.
- Disable eth0.
# ifconfig eth0 down
- View the network adapter binding information.
# cat /proc/net/bonding/bond0
If information similar to the following is displayed, the network binding status is up, and the active network adapter changes to eth1, indicating that the switching is successful.
eSightServer:~ # cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011) Bonding Mode: fault-tolerance (active-backup) Primary Slave: None Currently Active Slave: eth1MII Status: up MII Polling Interval (ms): 100 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: eth0 MII Status: down Speed: 100 Mbps Duplex: full Link Failure Count: 1 Permanent HW addr: a4:c6:4f:16:98:d2 Slave queue ID: 0 Slave Interface: eth1 MII Status: up Speed: 1000 Mbps Duplex: full Link Failure Count: 0 Permanent HW addr: a4:c6:4f:16:98:d3 Slave queue ID: 0
- Log in to another PC that can communicate with the network where eSight is deployed, input ping IP address of the eSight server on the CLI, and press Enter.
Example: ping 192.168.1.100. If the server can be pinged, eth1 is bound successfully.
- Start eth0.
# ifconfig eth0 up
- Disable eth0.
- Check the IP address configuration.