linux 删除网卡绑定,Linux下设置网卡绑定 (final)

eth0 及eth2 绑定为 bond0

eth1 及eth3 绑定为 bond1

[root@wsjrac03 network-scripts]# cp  ifcfg-eth0  ifcfg-bond0

[root@wsjrac03 network-scripts]# cat ifcfg-bond0

DEVICE=bond0

BOOTPROTO=none

IPADDR=10.109.196.155

NETMASK=255.255.255.0

NETWORK=10.109.196.0

BROADCAST=10.109.196.255

GATEWAY=10.109.196.1

ONBOOT=yes

USERCTL=no

TYPE=Ethernet

[root@wsjrac03 network-scripts]# cp  ifcfg-eth1  ifcfg-bond1

[root@wsjrac03 network-scripts]# cat ifcfg-bond1

DEVICE=bond1

BOOTPROTO=none

IPADDR=10.1.1.155

NETMASK=255.255.255.0

ONBOOT=yes

TYPE=Ethernet

USERCTL=no

IPV6INIT=no

PEERDNS=yes

[root@wsjrac03 network-scripts]# cat ifcfg-eth0

DEVICE=eth0

BOOTPROTO=none

HWADDR=A4:BA:DB:35:1B:AA

ONBOOT=yes

TYPE=Ethernet

MASTER=bond0

USERCTL=no

slave=yes

[root@wsjrac03 network-scripts]# cat ifcfg-eth1

DEVICE=eth1

BOOTPROTO=none

HWADDR=A4:BA:DB:35:1B:AC

ONBOOT=yes

TYPE=Ethernet

USERCTL=no

MASTER=bond1

slave=yes

[root@wsjrac03 network-scripts]# cat ifcfg-eth2

DEVICE=eth2

BOOTPROTO=none

HWADDR=A4:BA:DB:35:1B:AE

ONBOOT=yes

TYPE=Ethernet

MASTER=bond0

USERCTL=no

slave=yes

[root@wsjrac03 network-scripts]# cat ifcfg-eth3

DEVICE=eth3

BOOTPROTO=none

HWADDR=A4:BA:DB:35:1B:B0

ONBOOT=yes

TYPE=Ethernet

MASTER=bond1

USERCTL=no

slave=yes

[root@wsjrac03 etc]# cat modprobe.conf

alias bond0 bonding

options bond0 miimon=100 mode=1  primary=eth0

alias bond1 bonding

options bond1 miimon=100 mode=1  primary=eth1

[root@wsjrac03 etc]# vi /etc/rc.local

touch /var/lock/subsys/local

ifenslave bond0 eth0 eth2

ifenslave bond1 eth1 eth3

重新启动后查看 :

下面bond0对应线只有一个接了网线,所以状态是一个up, 一个down .

[root@wsjrac01 oracle]# more /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v3.2.4 (January 28, 2008)

Bonding Mode: fault-tolerance (active-backup)

Primary Slave: eth0

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: a4:ba:db:34:8e:70

Slave Interface: eth2

MII Status: down

Link Failure Count: 0

Permanent HW addr: a4:ba:db:34:8e:74

下面心跳线都接了网线,所以状态都是UP

[root@wsjrac01 oracle]# more /proc/net/bonding/bond1

Ethernet Channel Bonding Driver: v3.2.4 (January 28, 2008)

Bonding Mode: fault-tolerance (active-backup)

Primary Slave: None

Currently Active Slave: eth3

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 0

Down Delay (ms): 0

Slave Interface: eth1

MII Status: up

Link Failure Count: 1

Permanent HW addr: a4:ba:db:34:8e:72

Slave Interface: eth3

MII Status: up

Link Failure Count: 0

Permanent HW addr: a4:ba:db:34:8e:76

[root@wsjrac01 oracle]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值