您的位置:首页 > 运维架构 > Linux

LINUX双网卡绑定设置。

2017-12-14 11:13 423 查看
LINUX双网卡绑定设置方法:

RedHat6

1)编辑Bond文件

[ruby] view
plain copy

[root@redhat01 ~]# vim /etc/sysconfig/network-scripts/ifcfg-bond0   

DEVICE=bond0  

ONBOOT=yes  

BOOTPROTO=none  

IPADDR=  

NETMASK=  

GATEWAY=  

USERCTL=no  

NM_CONTROLLED=no  

2)编辑网卡配置文件(eth0、eth1)

[ruby] view
plain copy

[root@redhat01 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0  

DEVICE=eth0  
TYPE=Ethernet  

ONBOOT=yes  

BOOTPROTO=none  

MASTER=bond0  

SLAVE=yes  

NM_CONTROLLED=no  

USERCTL=no  

  

[root@redhat01 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1  

DEVICE=eth1  

TYPE=Ethernet  

ONBOOT=yes  

BOOTPROTO=none  

MASTER=bond0  

SLAVE=yes  

NM_CONTROLLED=no  

USERCTL=no  

3)修改modprobe相关文件,并加载Bonding模块

[ruby] view
plain copy

[root@redhat01 ~]# vim /etc/modprobe.d/dist.conf   

alias bond0 bonding  

options bond0 miimon=100 mode=1  

[ruby] view
plain copy

[root@redhat01 ~]# vim /etc/rc.local   

ifenslave bond0 eth0 eth1  

4)重启网络并查看bond状态

[ruby] view
plain copy

[root@redhat01 /]# cat /proc/net/bonding/bond0   

Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)  

  

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  

Speed: 1000 Mbps  

Duplex: full  

Link Failure Count: 0  

Permanent HW addr: 00:0c:29:04:5b:51  

Slave queue ID: 0  

  

Slave Interface: eth1  

MII Status: up  

Speed: 1000 Mbps  

Duplex: full  

Link Failure Count: 0  

Permanent HW addr: 00:0c:29:04:5b:47  

Slave queue ID: 0  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  双网卡 linux