Linux双网卡绑定

1.环境说明

1.1系统版本

[root@lcx01 ~]# cat /etc/redhat-release

CentOS release 6.9 (Final)

[root@lcx01 ~]# uname -r

2.6.32-696.el6.x86_64

1.2IP地址

gataway:10.0.0.254

bind0:10.0.0.201/24

2.关闭不必要的服务

2.1关闭selinux

[root@lcx01 ~]# setenforce 0

[root@lcx01 ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

2.2停止NetworkManager

[root@lcx01 ~]# /etc/init.d/NetworkManager stop

[root@lcx01 ~]# chkconfig NetworkManager off

[root@lcx01 ~]# /etc/init.d/network restart

3.双网卡绑定配置

[root@lcx01 ~]# cd /etc/sysconfig/network-scripts/

3.1编辑eth0、eth1网卡

[root@lcx01 network-scripts]# cat >ifcfg-eth0 <<EOF

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=none

USERCTL=no

MASTER=bind0

EOF

编辑eth1网卡

[root@lcx01 network-scripts]# cat >ifcfg-eth1 <<EOF

DEVICE=eth1

ONBOOT=yes

BOOTPROTO=none

USERCTL=no

MASTER=bind0

EOF

3.2编辑bind0网卡

[root@lcx01 network-scripts]# cat >ifcfg-bind0<<EOF

DEVICE=bind0

TYPE=Ethernet(如果Networkmanager未关闭就用unknown)

ONBOOT=yes

BOOTPROTO=none

IPADDR=10.0.0.201

NETMASK=255.255.255.0

GATEWAY=10.0.0.254

IPV6INIT=no

USERCTL=no

EOF

3.3配置bind参数

[root@lcx01 network-scripts]# cat >/etc/modprobe.conf<< EOF

alias bind0 bonding

options bind0 miimon=100 mode=6

EOF

3.4重启生效

service network restart

ifenslave bind0 eth0 eth1


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值