CentOS下双网卡绑定
2016-08-10 09:00
459 查看
像流媒体传输之类的服务器使用单网卡负载过高,可能造成画面卡顿情况,为缓解网络压力,特进行双网卡绑定。
这里我们将2块1GB的网卡进行绑定,使其带宽达到2GB,从而减少网络拥塞。
1.修改/etc/sysconfig/network-scripts/ifcfg-eth0/1配置文档,内容如下:
2.创建一个绑定网络口的配置文档/etc/sysconfig/network-scripts/ifcfg-bond0,内容如下:
3.修改/etc/modprobe.d/dist.conf,配置绑定模型,配置文件最后加入以下内容:
#选项 mode 是表示绑定口的工作模式,有0-7共7种模式,常用的有0和1模式,mode=0表示"round-robin"策略,两张卡同时工作在负载均衡状态。mode=1表示"active-backup"策略,两张卡一用一备的备份状态。
4. 修改的是/etc/rc.local,负责在系统启动时将虚拟网卡和两张物理网卡相绑定,增加以下内容:
5.重启网卡,使其生效
注意:将networkmanager服务关闭并设置为开机不启动 以防止干扰相关的操作
测试:关闭其中任何一块绑定的网卡,网络不受影响。
附:测试网卡接口速度 ethtool
这里我们将2块1GB的网卡进行绑定,使其带宽达到2GB,从而减少网络拥塞。
1.修改/etc/sysconfig/network-scripts/ifcfg-eth0/1配置文档,内容如下:
BOOTPROTO=none ONBOOT=yes MASTER=bond0 SLAVE=yes
2.创建一个绑定网络口的配置文档/etc/sysconfig/network-scripts/ifcfg-bond0,内容如下:
DEVICE=bond0 BOOTPROTO=static IPADDR=52.110.1.2 NETMASK=255.255.255.0 GATEWAY=52.110.1.1 BORADCAST=52.110.1.255 ONBOOT=yes TYPE=Ethernet
3.修改/etc/modprobe.d/dist.conf,配置绑定模型,配置文件最后加入以下内容:
alias bond0 bonding options bond0 miimon=100 mode=0#选项 millmon 是指定隔多长时间来进行链路监测,单位是ms。
#选项 mode 是表示绑定口的工作模式,有0-7共7种模式,常用的有0和1模式,mode=0表示"round-robin"策略,两张卡同时工作在负载均衡状态。mode=1表示"active-backup"策略,两张卡一用一备的备份状态。
4. 修改的是/etc/rc.local,负责在系统启动时将虚拟网卡和两张物理网卡相绑定,增加以下内容:
echo "ifenslave bond0 eth0 eth1" >>/etc/rc.local
5.重启网卡,使其生效
service network restart
注意:将networkmanager服务关闭并设置为开机不启动 以防止干扰相关的操作
service NetworkManager stop chkconfig NetworkManager off
测试:关闭其中任何一块绑定的网卡,网络不受影响。
附:测试网卡接口速度 ethtool
[root@dahuatech ~]# ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal Auto-negotiation: on MDI-X: off Supports Wake-on: pumbg Wake-on: g Current message level: 0x00000007 (7) drv probe link Link detected: yes
相关文章推荐
- centos6.2 x64位下双网卡绑定
- CentOS单网卡绑定多IP,添加新IP的方法
- Centos 6.5 64位双网卡绑定教程
- centos绑定多个ip CentOS一个网卡设置多个IP
- Centos 双网卡绑定实现负载均衡和故障转移 推荐
- CentOS6.5双网卡绑定
- Centos 6.5 多网卡绑定
- centos如何绑定ip段到网卡
- centos7 team网卡绑定不生效
- Centos 6.5双网卡绑定实现冗余
- Centos6.0双网卡绑定 (Bond)
- CentOS7多网卡手动绑定
- CentOS 7网卡网桥、绑定设置
- CentOS6.5系统双网卡绑定配置详解
- CentOS单网卡绑定多IP
- CentOS单网卡绑定双IP
- Centos7 / RHEL 7 双网卡绑定
- centos 5.4/6.* 双网卡绑定
- CentOS6.x双网卡采用主-备份策略绑定(bond)
- 基于centos6.8配置多网卡绑定