茗品汇联系官网:centOS下的双网卡绑定
来源:百度文库 编辑:九乡新闻网 时间:2024/04/28 15:42:53
centOS下的双网卡绑定
[trunkbow@localhost ~]$ su -
Password:
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]#
1. 编辑虚拟网络接口配置文件,指定网卡IP:
[root@localhost network-scripts]# cp ifcfg-eth0 ifcfg-bond0
[root@localhost network-scripts]# vi ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
IPADDR=192.168.1.220
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
USERCTL=no
TYPE=Ethernet
GATEWAY=192.168.1.1
root@localhost network-scripts]# vi ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
root@localhost network-scripts]# vi ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
修改/etc/modprobe.conf文件,添加
alias bond0 bonding
options bond0 miimon=100 mode=1
修改/etc/rc.d/rc.local文件,添加
ifenslave bond0 eth0 eth1
重启系统。
测试
检查绑定网卡是负载均衡模式,还是主备冗余模式
[root@localhost ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:
Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:
Solaris 10 双网卡IPMP配置
# cat /etc/hostname.nxge0
192.168.8.9 netmask + broadcast + group ipmp0 up
# cat /etc/hostname.nxge1
group ipmp0 up