Bind the machine's dual Nic to bonding

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.