Windows XP Windows 7 Windows 2003 Windows Vista Windows教程綜合 Linux 系統教程
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟件教程
 Windows教程網 >> Linux系統教程 >> Linux教程 >> Redhat/Centos網卡綁定基礎教程

Redhat/Centos網卡綁定基礎教程

日期:2017/2/7 14:28:09      編輯:Linux教程
 

網卡綁定功能可以起到線路冗余的效果,是一項很實用的功能

基本配置如下

綁定後的網卡

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=”bond0″
NM_CONTROLLED=”yes”
ONBOOT=”yes”
IPADDR=192.168.1.2
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
USERCTL=no
BONDING_OPTS=”mode=1 miimon=50″

注:mode=1為主備模式,0為負載均衡模式,交換機段需要做端口聚合

成員網卡
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=”eth0″
NM_CONTROLLED=”no”
ONBOOT=”yes”
#IPADDR=192.168.1.2
#NETMASK=255.255.255.0
MASTER=bond0
SLAVE=yes
USERCTL=no

成員網卡
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=”eth1″
NM_CONTROLLED=”no”
ONBOOT=”yes”
#IPADDR=192.168.1.2
#NETMASK=255.255.255.0
MASTER=bond0
SLAVE=yes
USERCTL=no

綁定完成後,重啟網絡服務(建議重啟系統)

service network restart

網絡重起後,bond如下所示,已成功配置
[root@localhost ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.5.0 (November 4, 2008)

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

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:ff:3a:81

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:ff:3a:8b

Copyright © Windows教程網 All Rights Reserved