10、网卡绑定bond0的实现

10、网卡绑定bond0的实现

在配置文件上实现:
[21:28:12 root@CentOS8 ~]#**cat /etc/sysconfig/network-scripts/ifcfg-bond0 **
NAME=bond0
TYPE=bond
DEVICE=bond0
BOOTPROTO=none
IPADDR=10.0.0.8
PREFIX=8
BONDING_OPTS="mode=1 miimon=100 fail_over_mac=1"

[21:29:06 root@CentOS8 ~]#cat /etc/sysconfig/network-scripts/ifcfg-eth0
NAME=eth0
DEVICE=eth0
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
ONBOOT=yes

[21:29:14 root@CentOS8 ~]#cat /etc/sysconfig/network-scripts/ifcfg-eth1
NAME=eth1
DEVICE=eth1
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
ONBOOT=yes

效果如下:
[21:29:38 root@CentOS8 ~]#**ifconfig **
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 10.0.0.8 netmask 255.0.0.0 broadcast 10.255.255.255
inet6 fe80::20c:29ff:fe94:5375 prefixlen 64 scopeid 0x20
ether 00:0c:29:94:53:75 txqueuelen 1000 (Ethernet)
RX packets 429 bytes 39432 (38.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 386 bytes 49608 (48.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:0c:29:94:53:75 txqueuelen 1000 (Ethernet)
RX packets 399 bytes 36691 (35.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 366 bytes 47056 (45.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:0c:29:94:53:7f txqueuelen 1000 (Ethernet)
RX packets 55 bytes 4417 (4.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 20 bytes 2552 (2.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[21:30:50 root@CentOS8 ~]#cat /sys/class/net/bond0/bonding/mode
active-backup 1

[21:31:17 root@CentOS8 ~]#**cat /proc/net/bonding/bond0 **
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup) (fail_over_mac active)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Peer Notification Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:94:53:75
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:94:53:7f
Slave queue ID: 0

posted @ 2022-06-20 08:47  惊起千层浪  阅读(121)  评论(0编辑  收藏  举报