[root@centos7 ~]#ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:33:b7:af brd ff:ff:ff:ff:ff:ff
inet 10.0.0.7/24 brd 10.0.0.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 fe80::31c3:e200:902b:ae0e/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:33:b7:b9 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.156/24 brd 10.0.0.255 scope global noprefixroute dynamic eth1
valid_lft 1755sec preferred_lft 1755sec
inet6 fe80::26c1:2681:267c:3bf0/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@centos7 ~]#nmcli connection add type bond con-name mybond0 ifname bond0 mode active-backup ipv4.method manual ipv4.addresses 10.0.0.100/24
Connection 'mybond0' (8833f300-63fb-42ed-b991-4278d5fc7875) successfully added.
[root@centos7 ~]#nmcli connection
NAME UUID TYPE DEVICE
eth0 7e463dd9-21e9-41e5-92fe-3845aaf3201d ethernet eth0
Wired connection 1 51a27eb2-cfa8-376a-92da-cd60b2ba2530 ethernet eth1
mybond0 8833f300-63fb-42ed-b991-4278d5fc7875 bond bond0
[root@centos7 ~]#cd /etc/sysconfig/network-scripts/
[root@centos7 network-scripts]#pwd
/etc/sysconfig/network-scripts
[root@centos7 network-scripts]#ls
ifcfg-eth0 ifdown-ippp ifdown-sit ifup-bnep ifup-plusb ifup-TeamPort
ifcfg-lo ifdown-ipv6 ifdown-Team ifup-eth ifup-post ifup-tunnel
ifcfg-mybond0 ifdown-isdn ifdown-TeamPort ifup-ippp ifup-ppp ifup-wireless
ifdown ifdown-post ifdown-tunnel ifup-ipv6 ifup-routes init.ipv6-global
ifdown-bnep ifdown-ppp ifup ifup-isdn ifup-sit network-functions
ifdown-eth ifdown-routes ifup-aliases ifup-plip ifup-Team network-functions-ipv6
[root@centos7 network-scripts]#cat ifcfg-mybond0
BONDING_OPTS=mode=active-backup
TYPE=Bond
BONDING_MASTER=yes
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
IPADDR=10.0.0.100
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=mybond0
UUID=8833f300-63fb-42ed-b991-4278d5fc7875
DEVICE=bond0
ONBOOT=yes
[root@centos7 network-scripts]#nmcli con add type bond-slave ifname eth0 master bond0
Connection 'bond-slave-eth0' (85b5e9bf-a425-4deb-ab19-4e1d4aee4d7c) successfully added.
[root@centos7 network-scripts]#nmcli con add type bond-slave ifname eth1 master bond0
Connection 'bond-slave-eth1' (b3fd41b5-206b-4474-b356-f38139d4f15f) successfully added.
[root@centos7 network-scripts]#nmcli connection
NAME UUID TYPE DEVICE
eth0 7e463dd9-21e9-41e5-92fe-3845aaf3201d ethernet eth0
Wired connection 1 51a27eb2-cfa8-376a-92da-cd60b2ba2530 ethernet eth1
mybond0 8833f300-63fb-42ed-b991-4278d5fc7875 bond bond0
bond-slave-eth0 85b5e9bf-a425-4deb-ab19-4e1d4aee4d7c ethernet --
bond-slave-eth1 b3fd41b5-206b-4474-b356-f38139d4f15f ethernet --
[root@centos7 network-scripts]#ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:33:b7:af brd ff:ff:ff:ff:ff:ff
inet 10.0.0.7/24 brd 10.0.0.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 fe80::31c3:e200:902b:ae0e/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:33:b7:b9 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.156/24 brd 10.0.0.255 scope global noprefixroute dynamic eth1
valid_lft 1584sec preferred_lft 1584sec
inet6 fe80::26c1:2681:267c:3bf0/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: bond0: <NO-CARRIER,BROADCAST,MULTICAST,MASTER,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 6e:ca:90:39:58:90 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.100/24 brd 10.0.0.255 scope global noprefixroute bond0
valid_lft forever preferred_lft forever
[root@centos7 network-scripts]#nmcli connection up bond-slave-eth1
[root@centos7 network-scripts]#nmcli connection up bond-slave-eth0
[root@centos7 ~]#ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000
link/ether 00:0c:29:33:b7:af brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000
link/ether 00:0c:29:33:b7:af brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:0c:29:33:b7:af brd ff:ff:ff:ff:ff:ff
inet 10.0.0.100/24 brd 10.0.0.255 scope global noprefixroute bond0
valid_lft forever preferred_lft forever
inet6 fe80::a4bb:e4c0:78bd:abae/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@centos7 ~]#nmcli connection
NAME UUID TYPE DEVICE
mybond0 8833f300-63fb-42ed-b991-4278d5fc7875 bond bond0
bond-slave-eth0 85b5e9bf-a425-4deb-ab19-4e1d4aee4d7c ethernet eth0
bond-slave-eth1 b3fd41b5-206b-4474-b356-f38139d4f15f ethernet eth1
eth0 7e463dd9-21e9-41e5-92fe-3845aaf3201d ethernet --
Wired connection 1 51a27eb2-cfa8-376a-92da-cd60b2ba2530 ethernet --
[root@centos7 ~]#cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
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:33:b7:af
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:33:b7:b9
Slave queue ID: 0
网卡绑定bond0的实现
最新推荐文章于 2024-06-05 19:00:19 发布