RHEL双网卡绑定
新增绑定网卡文件:
vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=static
IPADDR=192.168.56.101
NETMASK=255.255.255.0
#GATEWAY=192.168.56.101
#BROADCAST=10.250.7.255
修改现有网卡配置:
cp /etc/sysconfig/network-scripts/ifcfg-eth0 ~/ifcfg-eth0.bak
cp /etc/sysconfig/network-scripts/ifcfg-eth1 ~/ifcfg-eth1.bak
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
MASTER=bond0
SLAVE=yes
增加系统加载参数:
vi /etc/modprobe.conf
alias bond0 bonding
options bond0 miimon=100 mode=1
mode=0 load balancing (round-robin);mode=1 fault-tolerance (active-backup)提供冗余功能。
增加系统启动加载参数:
vi /etc/rc.d/rc.local
ifenslave bond0 eth0 eth1
#route add -net 172.31.3.254 netmask 255.255.255.0 bond0
启动网卡:
ifconfig bond0 192.168.56.101 up
重启服务器:
reboot
检查网卡绑定后状态:
cat /proc/net/bonding/bond0
ifconfig
-EOF-