1. Bind dual NICs 2. configuration file bound to dual NICs
/Etc/sysconfig/network-scripts/ifcfg-bond0DEVICE = "bond0" BOOTPROTO = "static" ONBOOT = "yes" TYPE = "ethernet" IPADDR = x. x. x. xNETMASK = 255.255.255.0BONDING _ OPTS = "miimon = 100 mode = 1 updelay = 600000 primary = eth0" #100 ms health check # mode = 1 is the active/standby mode # primary = eth0 # default active is eth0
/etc/sysconfig/network-scripts/ifcfg-eth0/etc/sysconfig/network-scripts/ifcfg-eth1
2. Check the information of a gigabit NIC that suddenly changes to 10 Mbps or 100 Mbps (1) proc/net/bonding/bond0
This information is the hardware Nic information loaded after linux is started.
Cat/proc/net/bonding/bond0 # view dual Nic information Ethernet Channel Bonding Driver: v3.6.0 (September 26,200 9) Bonding Mode: fault-tolerance (active-backup) Primary Slave: eth0 (primary_reselect always) # The default active is eth0Currently Active Slave: eth1MII Status: upMII Polling Interval (MS): 100Up Delay (MS): 600000 Down Delay (MS): 0 Slave Interface: eth0MII Status: upSpeed: 1000 Mbps # Sometimes it will suddenly change to 10 M/sDuplex: fullLink Failure Count: 0 Permanent HW addr: xxxxSlave queue ID: 0 Slave Interface: eth1MII Status: upSpeed: 10 Mbps # Why is it suddenly 10 M/sDuplex: fullLink Failure Count: 2 Permanent HW addr: xxxx0000ave queue ID: 0
(2) ethtool
Sudo ethtool eth0 Settings for eth0: Supported ports: [TP] Supported link modes: 10 baseT/Half 10 baseT/Full # support 10 M Half Full duplex 100 baseT/Half 100 baseT/Full # support 100 M Half Full duplex 1000 baseT/Full # support 1000 M Full duplex Supports auto-negotiation: yes Advertised link modes: 10 baseT/Half 10 baseT/Full 100 baseT/Half 100 baseT/Full 1000 baseT/Full Advertised auto-negotiation: Yes Speed: 100 Mb/s # currently, the actual network adapter supports 100 Mbit/s, which is a waste of resources. Sometimes the network adapter is Full. Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on Supports Wake-on: pumbg Wake-on: g Current message level: 0x00000007 (7) Link detected: yes
(3). ethtool modify speed
Sudo ethtool-s eth0 speed 1000 # modify the speed of eth0 to 1000 sudo ethtool eth0 # Check whether the modification is successful, at this time,/proc/net/bonding/bond0 still does not modify sudo/etc/init. d/network restart # restart the NIC vim/proc/net/bonding/bond0 # change/proc/net/bonding/bond0 to 1000 now.