機器的雙網卡綁定bonding

來源:互聯網
上載者:User

1.雙網卡綁定2. 雙網卡綁定的設定檔

/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"   #100ms 健康檢測  #mode=1 是主備模式  #primary=eth0 #預設active 是eth0
/etc/sysconfig/network-scripts/ifcfg-eth0/etc/sysconfig/network-scripts/ifcfg-eth1
2. 千兆網卡,突然變成10Mbps 或者100Mbps(1) proc/net/bonding/bond0 資訊查看

這個資訊是linux啟動後載入的硬體網卡資訊

cat /proc/net/bonding/bond0  #查看雙網卡資訊Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)Bonding Mode: fault-tolerance (active-backup)Primary Slave: eth0 (primary_reselect always)  #預設active 是eth0Currently Active Slave: eth1MII Status: upMII Polling Interval (ms): 100Up Delay (ms): 600000Down Delay (ms): 0Slave Interface: eth0MII Status: upSpeed: 1000 Mbps   #有時會突然變成10M/sDuplex: fullLink Failure Count: 0Permanent HW addr: xxxxSlave queue ID: 0Slave Interface: eth1MII Status: upSpeed: 10 Mbps     # 為什麼突然變成10M/sDuplex: fullLink Failure Count: 2Permanent HW addr: xxxxxSlave queue ID: 0
(2). ethtool 工具來看
sudo ethtool  eth0  Settings for eth0:        Supported ports: [ TP ]        Supported link modes:   10baseT/Half 10baseT/Full     #支援10M 半全雙工系統                                  100baseT/Half 100baseT/Full   #支援100M 半 全雙工系統                                1000baseT/Full  #支援1000M 全雙工系統        Supports auto-negotiation: Yes        Advertised link modes:  10baseT/Half 10baseT/Full                                 100baseT/Half 100baseT/Full                                 1000baseT/Full         Advertised auto-negotiation: Yes        Speed: 100Mb/s    #現在是100Mbps   實際網卡支援1000Mbps 所以網卡其實浪費了,有時網卡打滿會出問題啊        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 修改speed
sudo ethtool  -s eth0 speed 1000  #eth0 的speed 修改成1000sudo ethtool eth0   #查看修改是否成功,此時/proc/net/bonding/bond0 還是沒有修改的sudo  /etc/init.d/network restart  #重啟網卡vim /proc/net/bonding/bond0  #此時 /proc/net/bonding/bond0 就修改成1000 啦

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.