Linux dual NIC bindings Linux dual NIC Bindings
Common modes for dual NIC bindings:
Mode1:active-backup mode, which is the main standby mode.
Mode0:round-broin mode, load Balancing mode (requires switch configuration aggregation port Cisco called Port Channel)
Steps:
1. Create the BOND0 boot profile:
2: Edit NIC configuration file Ifcfg-eth0,ifcfg-eth1
2.1: Configure NIC One
2.2: Configure NIC Two
3: Create and configure the modprobe.conf file
4: Set Boot boot
5: View and test
5.1: View bond0 information (/PROC/NET/BONDING/BONG0 will show which network card is responsible for the task)
5.2: Test the common mode of dual NIC binding: Mode1:active-backup mode, which is the main standby mode.
Implementation method:
1. Edit Create ifcfg-bond0 nic file
2. Modify Ifcfg-eth0 ifcffg-eth1
3. Create and edit/etc/modprobe.conf
4. Write/etc/rc.d/rc.local
5. Testing
Mode0:round-broin mode, load Balancing mode (requires switch configuration aggregation port Cisco called Port Channel)
Implementation method:
With master and Standby mode, only need to modify mode=1 to mode =0
Step: 1. Create a BOND0 boot profile:
cd/etc/sysconfig/network-scripts/
VI ifcfg-bond0
- Device=bond0
- Onboot=yes
- Bootproto=static
- ipaddr=192.168.2.66
- netmask=255.255.255.0
- #GEATWAY =192.168.2.1
- #DNS1 =192.168.2.1
- Userctl=no
2: Edit NIC profile ifcfg-eth0,ifcfg-eth12.1: Configure NIC One
VI Ifcfg-eth0
- Device=eth0
- Userctl=no
- Onboot=yes
- Master=bond0
- Slave=yes
- Bootproto=none
2.2: Configure NIC Two
VI ifcfg-eth1
- Device=eth1
- Userctl=no
- Onboot=yes
- Master=bond0
- Slave=yes
- Bootproto=none
Note: The two lines of master=bond0 and Slave=yes are primarily used for system service network Restart after they are automatically enabled
3: Create and configure the modprobe.conf file
Vi/etc/modprobe.conf
- Alias Bond0 Bonding
- Options Bond0 miimon=100 mode=1
Note:
<1>:millmon represents the link monitoring time interval, the unit is ms,millmon=100 for each 100ms monitoring link connection status, if one does not pass, it will be transferred to another. This value is suggested to be 100, and setting to another value can cause instability
<2>:mode indicates the operation of the two net cards, and 0 means that the load blance,1 represents the hot spare.
4: Set Boot boot
- echo "Ifenslave bond0 eth0 eth1" >>/etc/rc.d/rc.local xxxxxxxxxx
After the configuration is complete, restart the network service or restart the server, as follows
- Service network restart or # init 6
5: View and Test 5.1: View bond0 information (/PROC/NET/BONDING/BONG0 will show which network card is responsible for the task)
- Cat/proc/net/bonding/bond0
5.2: Test
Always ping this IP, and then Plug and unplug the server's two network cable to see if the packet can be lost.
Original: http://www.centoscn.cn/2232.html
Linux Dual NIC Bindings