檢視/修改RedHat Linux網路Bonding Mode (Port Trunking)

檢視目前網路Bonding Mode狀態:
cat /proc/net/bonding/bond0


[root@db01 network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)



Bonding Mode: load balancing (round-robin)
MII 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: 2
Permanent HW addr: xxxxxxxxxxxxxxxxxx

Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: xxxxxxxxxxxxxx


手動修改網路設定:
cd /etc/sysconfig/network-scripts/
cat ifcfg-bond0


DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
IPADDR=xx.xx.xx.xx
NETMASK=255.255.255.0

例:將round-robin改成active-backup:
於ifcfg-bond0中加入一行:
BONDING_OPTS="miimon=100 mode=1"

重啟network servcie:
/etc/init.d/network restart
[root@db01 network-scripts]# /etc/init.d/network restart
Shutting down interface bond0:                             [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]

Bringing up interface bond0:                               [  OK  ]


檢查網路Bonding Mode狀態:
[root@db01 network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xxxxxxxxxxxxxxxxx

Slave Interface: eth0
MII Status: up
Speed: 100 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: xxxxxxxxxxxxxxxxx

留言

這個網誌中的熱門文章

Google瀏覽器發生「錯誤107 (net::ERR_SSL_PROTOCOL_ERROR): SSL 通訊協定錯誤」的解決方式

Cacti 簡單自製圖表詳解