Bonding

Bonding

Bonding

互联网接口配置–Bonding,互联网接口–bonding

Bonding

就是讲到快网卡绑定到同一IP地址对外服务,能够兑现高可用也许负载均衡。当然,直接给两块网卡设置同一IP地址是不容许的。通过bonding,虚拟一块网卡对外提供连接,物理网卡被改动为同一MAC地址。

一 Bonding 的做事形式

    Mode 0 (balance-rr)

滚动(Round-robin)策略:从头到尾顺序的在每四个slave接口上面发送数据包。本情势提供负载均衡和容错的能力。

    Mode 1 (active-backuop)

一抬手一动脚-备份(主备)策略:在绑定中,只有贰个slave被激活,当且仅移动的slave接口战败是才会激活其余的slave。为了制止沟通机发生混乱此时绑定的MAC地址唯有多个外表端口上可知。

    Mode 3 (broadcast)

播音策略:在具备的slave接口上发送全数的报文。本形式提供容错能力。

二 Bonding配置

1 创造bonding设备的配置文件

[[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

BOOTPROTO=none

BONDING_OPTS=”miimon=100 mode=0″

IPADDR=200.200.200.200

PREFIX=24

GATEWAY=200.200.200.1

miimon是安装检查和测试链路的年华,单位为微秒。即使miimon=100,那么系统每100纳秒检查和测试一侧链路的总是情况,假设有一条路线短路就转入另一条线路。

mode用来钦命形式

2 创立slave的布局文件

既就是要加盟的网卡的配备文件,那里运用eth一 、eth2两块网卡,下来修改两块网卡的铺排

[[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1

TYPE=Ethernet

Linux下互联网接口配置,互联网接口。BOOTPROTO=none

MASTER=bond0

SLAVE=yes

USERCTL=0

MASTECRUISER钦定测网卡属于哪个bond。SLAVE钦命从属关系。USE帕杰罗CTL钦点用户是或不是有决定权限。

eth2和eth1配置类似

[[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2

TYPE=Ethernet

BOOTPROTO=none

MASTER=bond0

SLAVE=yes

USERCTL=0

3 重启网络服务

[[email protected] ~]# service NetworkManager stop #centos6上不稳定,建议关闭
[[email protected] ~]# service network restart

Shutting down interface bond0: [ OK ]

Shutting down interface eth0: [ OK ]

Shutting down loopback interface: [ OK ]

Bringing up loopback interface: [ OK ]

Bringing up interface bond0: Determining if ip address 200.200.200.200
is already in use for device bond0…

[ OK ]

Bringing up interface eth0: Determining if ip address 192.168.29.68 is
already in use for device eth0…

[ OK ]

 

能够看看已经起步成功,再来看下IP地址和MAC

[[email protected] ~]# ip a

[……]

7: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast master bond0 state UP qlen 1000

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

8: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast master bond0 state UP qlen 1000

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

9: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UP

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

inet 200.200.200.200/24 brd 200.200.200.255 scope global bond0

inet6 fe80::20c:29ff:fe74:7445/64 scope link tentative dadfailed

valid_lft forever preferred_lft forever

能够见到IP地址早就生效,并且MAC地址都相同。

4 查看bond0的状态

[[email protected] ~]# cat /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

 Bonding Mode: load balancing (round-robin)

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 0

澳门金沙国际,Down Delay (ms): 0

Slave Interface: eth1

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:0c:29:74:74:45

Slave queue ID: 0

Slave Interface: eth2

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr: 00:0c:29:74:74:4f

Slave queue ID: 0

好了,一切都很顺遂

5 删除bond

[[email protected] ~]# ifconfig bond0 down

[[email protected] ~]# rmmod bonding

看下是还是不是删除成功,

[[email protected] ~]# ifconfig bond0

bond0: error fetching interface information: Device not found

已经找不到bond0,表达删除成功。

详尽协助:/etc/share/doc/kernel-doc-version/Documentation/networking/bonding.txt

 

三 nmcli实现bonding

 1 添加bonding接口

[[email protected] ~]# nmcli connection add type bond con-name mybond0 ifname bond0 mode active-backup

Connection ‘mybond0’ (cc101e79-3dcb-49ee-8164-89c9e877c315) successfully
added.

2添加从属接口

[[email protected] ~]# nmcli connection add type bond-slave ifname ens34 master mybond0

Connection ‘bond-slave-ens34’ (9c8ff11a-72ef-4d63-a950-2ab777d2a1ea)
successfully added.

[[email protected] ~]# nmcli connection add type bond-slave ifname ens38 master mybond0

Connection ‘bond-slave-ens38’ (c40b3e6f-32f4-4d1a-a323-aed2519cf865)
successfully added.

注意:如没有点名从属接口连接名,则该名称是接口名称加类型构成

3 运行从属接口

[[email protected] ~]# nmcli connection up bond-slave-ens34

Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/40)

[[email protected] ~]# nmcli connection up bond-slave-ens38

Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/41)

4 启动bonding 绑定

[[email protected] ~]# nmcli connection up mybond0

Connection successfully activated (master waiting for slaves) (D-Bus
active path: /org/freedesktop/NetworkManager/ActiveConnection/48)

5 查看绑定

[[email protected] ~]# nmcli connection show

NAME UUID TYPE DEVICE

bond-slave-ens34 9c8ff11a-72ef-4d63-a950-2ab777d2a1ea 802-3-ethernet
ens34

bond-slave-ens38 c40b3e6f-32f4-4d1a-a323-aed2519cf865 802-3-ethernet
ens38

mybond0 cc101e79-3dcb-49ee-8164-89c9e877c315 bond bond0

6 添加IP地址

[[email protected] ~]# nmcli connection modify mybond0 ipv4.method manual ipv4.addresses 200.1.1.1/24

7 删除bond绑定

(1)关闭bond

[[email protected] ~]# nmcli connection down mybond0

Connection ‘mybond0’ successfully deactivated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/18)

[[email protected]
~]#

(2)删除bond

[[email protected] ~]# nmcli connection delete mybond0

Connection ‘mybond0’ (9ed2f027-bbb1-44d1-87fc-7f7275d7fe70) successfully
deleted.

(3)删除从属接口

[[email protected] ~]# nmcli connection delete bond-slave-ens34

Connection ‘bond-slave-ens34’ (a46ad620-d4b5-43f9-a73a-447785504a17)
successfully deleted.

[[email protected]
~]# nmcli connection delete bond-slave-ens38

Connection ‘bond-slave-ens38’ (66b1f44d-ad71-4576-8061-f6cba2b976e8)
successfully deleted.

 

好了

Bonding
正是讲到快网卡绑定到同一IP地址对外服务,能够完成高可用或许负载均衡。当然,直接给两…

就是讲到快网卡绑定到同一IP地址对外服务,能够落成高可用或许负载均衡。当然,直接给两块网卡设置同一IP地址是不容许的。通过bonding,虚拟一块网卡对外提供连接,物理网卡被修改为同一MAC地址。

正是讲到快网卡绑定到同一IP地址对外地劳工务,能够落成高可用大概负载均衡。当然,直接给两块网卡设置同一IP地址是相当的小概的。通过bonding,虚拟一块网卡对外提供连接,物理网卡被改动为同一MAC地址。

就是讲到快网卡绑定到同一IP地址对外地劳工务,可以兑现高可用可能负载均衡。当然,直接给两块网卡设置同一IP地址是不容许的。通过bonding,虚拟一块网卡对外提供连接,物理网卡被改动为同一MAC地址。

一 Bonding 的做事形式

一 Bonding 的办事格局

一 Bonding 的劳作形式

    Mode 0 (balance-rr)

    Mode 0 (balance-rr)

    Mode 0 (balance-rr)

滚动(Round-robin)策略:从头到尾顺序的在每八个slave接口上边发送数据包。本方式提供负载均衡和容错的力量。

滚动(Round-robin)策略:从头到尾顺序的在每2个slave接口上边发送数据包。本情势提供负载均衡和容错的能力。

滚动(Round-robin)策略:从头到尾顺序的在每八个slave接口上面发送数据包。本情势提供负载均衡和容错的力量。

    Mode 1 (active-backuop)

    Mode 1 (active-backuop)

    Mode 1 (active-backuop)

移步-备份(主备)策略:在绑定中,只有三个slave被激活,当且仅移动的slave接口失利是才会激活其余的slave。为了幸免沟通机发生混乱此时绑定的MAC地址唯有2个外部端口上可知。

移动-备份(主备)策略:在绑定中,只有几个slave被激活,当且仅移动的slave接口失利是才会激活别的的slave。为了防止沟通机发生混乱此时绑定的MAC地址只有二个外表端口上可知。

挪动-备份(主备)策略:在绑定中,只有2个slave被激活,当且仅移动的slave接口退步是才会激活其余的slave。为了防止交流机发生混乱此时绑定的MAC地址唯有1个表面端口上可见。

    Mode 3 (broadcast)

    Mode 3 (broadcast)

    Mode 3 (broadcast)

播音策略:在全数的slave接口上发送全部的报文。本形式提供容错能力。

播音策略:在具备的slave接口上发送全体的报文。本形式提供容错能力。

播音策略:在颇具的slave接口上发送全体的报文。本情势提供容错能力。

二 Bonding配置

二 Bonding配置

二 Bonding配置

1 创造bonding设备的配置文件

1 创造bonding设备的布置文件

1 创造bonding设备的布局文件

[root@CentOS68 ~]# vim /etc/sysconfig/network-scripts/ifcfg-bond0
[root@CentOS68 ~]# vim /etc/sysconfig/network-scripts/ifcfg-bond0
1
[root@CentOS68 ~]# vim /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

DEVICE=bond0

DEVICE=bond0

BOOTPROTO=none

BOOTPROTO=none

BOOTPROTO=none

BONDING_OPTS=”miimon=100 mode=0″

BONDING_OPTS=”miimon=100 mode=0″

BONDING_OPTS=”miimon=100 mode=0″

IPADDR=200.200.200.200

IPADDR=200.200.200.200

IPADDR=200.200.200.200

PREFIX=24

PREFIX=24

PREFIX=24

GATEWAY=200.200.200.1

GATEWAY=200.200.200.1

GATEWAY=200.200.200.1

miimon是设置检查和测试链路的年华,单位为阿秒。要是miimon=100,那么系统每100阿秒检查和测试一侧链路的一而再意况,如若有一条路线短路就转入另一条路线。

miimon是安装检测链路的时日,单位为纳秒。要是miimon=100,那么系统每100微秒检查和测试一侧链路的一而再景况,倘使有一条线路短路就转入另一条线路。

miimon是设置检查和测试链路的小时,单位为阿秒。如若miimon=100,那么系统每100皮秒检查和测试一侧链路的再三再四意况,假使有一条路线短路就转入另一条线路。

mode用来钦命方式

mode用来钦命形式

mode用来内定形式

2 成立slave的安顿文件

2 创立slave的安排文件

2 创制slave的配备文件

既正是要加盟的网卡的布局文件,那里运用eth壹 、eth2两块网卡,下来修改两块网卡的配置

既就是要加盟的网卡的安顿文件,那里运用eth一 、eth2两块网卡,下来修改两块网卡的布署

既正是要加盟的网卡的安插文件,那里运用eth壹 、eth2两块网卡,下来修改两块网卡的安顿

[root@CentOS68 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1
[root@CentOS68 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1
[root@CentOS68 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1

DEVICE=eth1

DEVICE=eth1

TYPE=Ethernet

TYPE=Ethernet

TYPE=Ethernet

BOOTPROTO=none

BOOTPROTO=none

BOOTPROTO=none

MASTER=bond0

MASTER=bond0

MASTER=bond0

SLAVE=yes

SLAVE=yes

SLAVE=yes

USERCTL=0

USERCTL=0

USERCTL=0

MASTE安德拉钦命测网卡属于哪个bond。SLAVE钦定从属关系。USEQashqaiCTL内定用户是或不是有决定权限。

MASTECRUISER钦定测网卡属于哪个bond。SLAVE钦赐从属关系。USESportageCTL钦点用户是还是不是有支配权限。

MASTEMurano钦赐测网卡属于哪个bond。SLAVE钦定从属关系。USEMuranoCTL钦点用户是或不是有支配权限。

eth2和eth1配置类似

eth2和eth1配置类似

eth2和eth1配置类似

[root@CentOS68 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth2
[root@CentOS68 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth2
[root@CentOS68 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2

DEVICE=eth2

DEVICE=eth2

TYPE=Ethernet

TYPE=Ethernet

TYPE=Ethernet

BOOTPROTO=none

BOOTPROTO=none

BOOTPROTO=none

MASTER=bond0

MASTER=bond0

MASTER=bond0

SLAVE=yes

SLAVE=yes

SLAVE=yes

USERCTL=0

USERCTL=0

USERCTL=0

3 重启互联网服务

3 重启网络服务

3 重启互联网服务

[root@CentOS68 ~]# service NetworkManager stop #centos6上不稳定,建议关闭
[root@CentOS68 ~]# service network restart
[root@CentOS68 ~]# service NetworkManager stop #centos6上不稳定,建议关闭
[root@CentOS68 ~]# service network restart
1
2
[root@CentOS68 ~]# service NetworkManager stop #centos6上不稳定,建议关闭
[root@CentOS68 ~]# service network restart

Shutting down interface bond0: [ OK ]

Shutting down interface bond0: [ OK ]

Shutting down interface bond0: [ OK ]

Shutting down interface eth0: [ OK ]

Shutting down interface eth0: [ OK ]

Shutting down interface eth0: [ OK ]

Shutting down loopback interface: [ OK ]

Shutting down loopback interface: [ OK ]

Shutting down loopback interface: [ OK ]

Bringing up loopback interface: [ OK ]

Bringing up loopback interface: [ OK ]

Bringing up loopback interface: [ OK ]

Bringing up interface bond0: Determining if ip address 200.200.200.200
is already in use for device bond0…

Bringing up interface bond0: Determining if ip address 200.200.200.200
is already in use for device bond0…

Bringing up interface bond0: Determining if ip address 200.200.200.200
is already in use for device bond0…

[ OK ]

[ OK ]

[ OK ]

Bringing up interface eth0: Determining if ip address 192.168.29.68 is
already in use for device eth0…

Bringing up interface eth0: Determining if ip address 192.168.29.68 is
already in use for device eth0…

Bringing up interface eth0: Determining if ip address 192.168.29.68 is
already in use for device eth0…

[ OK ]

[ OK ]

[ OK ]

 

 

能够看看曾经运转成功,再来看下IP地址和MAC

能够见到已经起步成功,再来看下IP地址和MAC

能够看来曾经运行成功,再来看下IP地址和MAC

[root@CentOS68 ~]# ip a
[root@CentOS68 ~]# ip a
[root@CentOS68 ~]# ip a

[……]

[……]

[……]

7: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast master bond0 state UP qlen 1000

7: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast master bond0 state UP qlen 1000

7: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast master bond0 state UP qlen 1000

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

8: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast master bond0 state UP qlen 1000

8: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast master bond0 state UP qlen 1000

8: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast master bond0 state UP qlen 1000

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

9: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UP

9: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UP

9: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UP

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

link/ether 00:0c:29:74:74:45 brd ff:ff:ff:ff:ff:ff

inet 200.200.200.200/24 brd 200.200.200.255 scope global bond0

inet 200.200.200.200/24 brd 200.200.200.255 scope global bond0

inet 200.200.200.200/24 brd 200.200.200.255 scope global bond0

inet6 fe80::20c:29ff:fe74:7445/64 scope link tentative dadfailed

inet6 fe80::20c:29ff:fe74:7445/64 scope link tentative dadfailed

inet6 fe80::20c:29ff:fe74:7445/64 scope link tentative dadfailed

valid_lft forever preferred_lft forever

valid_lft forever preferred_lft forever

valid_lft forever preferred_lft forever

能够旁观IP地址已经生效,并且MAC地址都一致。

能够看到IP地址已经生效,并且MAC地址都如出一辙。

能够观望IP地址早就生效,并且MAC地址都同一。

4 查看bond0的状态

4 查看bond0的状态

4 查看bond0的状态

[root@CentOS68 ~]# cat /proc/net/bonding/bond0
[root@CentOS68 ~]# cat /proc/net/bonding/bond0
[root@CentOS68 ~]# cat /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

 Bonding Mode: load balancing (round-robin)

 Bonding Mode: load balancing (round-robin)

 Bonding Mode: load balancing (round-robin)

MII Status: up

MII Status: up

MII Status: up

MII Polling Interval (ms): 100

MII Polling Interval (ms): 100

MII Polling Interval (ms): 100

Up Delay (ms): 0

Up Delay (ms): 0

Up Delay (ms): 0

Down Delay (ms): 0

Down Delay (ms): 0

Down Delay (ms): 0

Slave Interface: eth1

Slave Interface: eth1

Slave Interface: eth1

MII Status: up

MII Status: up

MII Status: up

Speed: 1000 Mbps

Speed: 1000 Mbps

Speed: 1000 Mbps

Duplex: full

Duplex: full

Duplex: full

Link Failure Count: 0

Link Failure Count: 0

Link Failure Count: 0

Permanent HW addr: 00:0c:29:74:74:45

Permanent HW addr: 00:0c:29:74:74:45

Permanent HW addr: 00:0c:29:74:74:45

Slave queue ID: 0

Slave queue ID: 0

Slave queue ID: 0

Slave Interface: eth2

Slave Interface: eth2

Slave Interface: eth2

MII Status: up

MII Status: up

MII Status: up

Speed: 1000 Mbps

Speed: 1000 Mbps

Speed: 1000 Mbps

Duplex: full

Duplex: full

Duplex: full

Link Failure Count: 0

Link Failure Count: 0

Link Failure Count: 0

Permanent HW addr: 00:0c:29:74:74:4f

Permanent HW addr: 00:0c:29:74:74:4f

Permanent HW addr: 00:0c:29:74:74:4f

Slave queue ID: 0

Slave queue ID: 0

Slave queue ID: 0

好了,一切都很顺畅

好了,一切都很顺畅

好了,一切都很顺畅

5 删除bond

5 删除bond

5 删除bond

1
2
3
[root@CentOS68 ~]# ifconfig bond0 down
 
[root@CentOS68 ~]# rmmod bonding
[root@CentOS68 ~]# ifconfig bond0 down

[root@CentOS68 ~]# rmmod bonding
[root@CentOS68 ~]# ifconfig bond0 down

[root@CentOS68 ~]# rmmod bonding

看下是不是删除成功,

看下是还是不是删除成功,

看下是或不是删除成功,

[root@CentOS68 ~]# ifconfig bond0
[root@CentOS68 ~]# ifconfig bond0
[root@CentOS68 ~]# ifconfig bond0

bond0: error fetching interface information: Device not found

bond0: error fetching interface information: Device not found

bond0: error fetching interface information: Device not found

已经找不到bond0,表明删除成功。

早已找不到bond0,表明删除成功。

一度找不到bond0,表达删除成功。

详细扶助:/etc/share/doc/kernel-doc-version/Documentation/networking/bonding.txt

详见补助:/etc/share/doc/kernel-doc-version/Documentation/networking/bonding.txt

详尽帮衬:/etc/share/doc/kernel-doc-version/Documentation/networking/bonding.txt

三 nmcli实现bonding

 

 

 1 添加bonding接口

三 nmcli实现bonding

三 nmcli实现bonding

[root@centos7 ~]# nmcli connection add type bond con-name mybond0 ifname bond0 mode active-backup

 1 添加bonding接口

 1 添加bonding接口

Connection ‘mybond0’ (cc101e79-3dcb-49ee-8164-89c9e877c315) successfully
added.

[root@centos7 ~]# nmcli connection add type bond con-name mybond0 ifname bond0 mode active-backup
[root@centos7 ~]# nmcli connection add type bond con-name mybond0 ifname bond0 mode active-backup

2添加从属接口

Connection ‘mybond0’ (cc101e79-3dcb-49ee-8164-89c9e877c315) successfully
added.

Connection ‘mybond0’ (cc101e79-3dcb-49ee-8164-89c9e877c315) successfully
added.

[root@centos7 ~]# nmcli connection add type bond-slave ifname ens34 master mybond0

2添加从属接口

2添加从属接口

Connection ‘bond-slave-ens34’ (9c8ff11a-72ef-4d63-a950-2ab777d2a1ea)
successfully added.

[root@centos7 ~]# nmcli connection add type bond-slave ifname ens34 master mybond0
[root@centos7 ~]# nmcli connection add type bond-slave ifname ens34 master mybond0
[root@centos7 ~]# nmcli connection add type bond-slave ifname ens38 master mybond0

Connection ‘bond-slave-ens34’ (9c8ff11a-72ef-4d63-a950-2ab777d2a1ea)
successfully added.

Connection ‘bond-slave-ens34’ (9c8ff11a-72ef-4d63-a950-2ab777d2a1ea)
successfully added.

Connection ‘bond-slave-ens38’ (c40b3e6f-32f4-4d1a-a323-aed2519cf865)
successfully added.

[root@centos7 ~]# nmcli connection add type bond-slave ifname ens38 master mybond0
[root@centos7 ~]# nmcli connection add type bond-slave ifname ens38 master mybond0

专注:如没有点名从属接口连接名,则该名称是接口名称加类型构成

Connection ‘bond-slave-ens38’ (c40b3e6f-32f4-4d1a-a323-aed2519cf865)
successfully added.

Connection ‘bond-slave-ens38’ (c40b3e6f-32f4-4d1a-a323-aed2519cf865)
successfully added.

3 运行从属接口

小心:如没有点名从属接口连接名,则该名称是接口名称加类型构成

只顾:如没有点名从属接口连接名,则该名称是接口名称加类型构成

[root@centos7 ~]# nmcli connection up bond-slave-ens34

3 运转从属接口

3 运维从属接口

Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/40)

[root@centos7 ~]# nmcli connection up bond-slave-ens34
[root@centos7 ~]# nmcli connection up bond-slave-ens34
[root@centos7 ~]# nmcli connection up bond-slave-ens38

Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/40)

Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/40)

Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/41)

[root@centos7 ~]# nmcli connection up bond-slave-ens38
[root@centos7 ~]# nmcli connection up bond-slave-ens38

4 启动bonding 绑定

Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/41)

Connection successfully activated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/41)

[root@centos7 ~]# nmcli connection up mybond0

4 启动bonding 绑定

4 启动bonding 绑定

Connection successfully activated (master waiting for slaves) (D-Bus
active path: /org/freedesktop/NetworkManager/ActiveConnection/48)

[root@centos7 ~]# nmcli connection up mybond0
[root@centos7 ~]# nmcli connection up mybond0

5 查看绑定

Connection successfully activated (master waiting for slaves) (D-Bus
active path: /org/freedesktop/NetworkManager/ActiveConnection/48)

Connection successfully activated (master waiting for slaves) (D-Bus
active path: /org/freedesktop/NetworkManager/ActiveConnection/48)

[root@centos7 ~]# nmcli connection show

5 查看绑定

5 查看绑定

NAME UUID TYPE DEVICE

[root@centos7 ~]# nmcli connection show
[root@centos7 ~]# nmcli connection show

bond-slave-ens34 9c8ff11a-72ef-4d63-a950-2ab777d2a1ea 802-3-ethernet
ens34

NAME UUID TYPE DEVICE

NAME UUID TYPE DEVICE

bond-slave-ens38 c40b3e6f-32f4-4d1a-a323-aed2519cf865 802-3-ethernet
ens38

bond-slave-ens34 9c8ff11a-72ef-4d63-a950-2ab777d2a1ea 802-3-ethernet
ens34

bond-slave-ens34 9c8ff11a-72ef-4d63-a950-2ab777d2a1ea 802-3-ethernet
ens34

mybond0 cc101e79-3dcb-49ee-8164-89c9e877c315 bond bond0

bond-slave-ens38 c40b3e6f-32f4-4d1a-a323-aed2519cf865 802-3-ethernet
ens38

bond-slave-ens38 c40b3e6f-32f4-4d1a-a323-aed2519cf865 802-3-ethernet
ens38

6 添加IP地址

mybond0 cc101e79-3dcb-49ee-8164-89c9e877c315 bond bond0

mybond0 cc101e79-3dcb-49ee-8164-89c9e877c315 bond bond0

[root@centos7 ~]# nmcli connection modify mybond0 ipv4.method manual ipv4.addresses 200.1.1.1/24

6 添加IP地址

6 添加IP地址

7 删除bond绑定

[root@centos7 ~]# nmcli connection modify mybond0 ipv4.method manual ipv4.addresses 200.1.1.1/24
[root@centos7 ~]# nmcli connection modify mybond0 ipv4.method manual ipv4.addresses 200.1.1.1/24

(1)关闭bond

7 删除bond绑定

7 删除bond绑定

[root@centos7 ~]# nmcli connection down mybond0

(1)关闭bond

(1)关闭bond

Connection ‘mybond0’ successfully deactivated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/18)

[root@centos7 ~]# nmcli connection down mybond0
[root@centos7 ~]# nmcli connection down mybond0

[root@centos7 ~]#

Connection ‘mybond0’ successfully deactivated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/18)

Connection ‘mybond0’ successfully deactivated (D-Bus active path:
/org/freedesktop/NetworkManager/ActiveConnection/18)

(2)删除bond

[root@centos7 ~]#

[root@centos7 ~]#

[root@centos7 ~]# nmcli connection delete mybond0

(2)删除bond

(2)删除bond

Connection ‘mybond0’ (9ed2f027-bbb1-44d1-87fc-7f7275d7fe70) successfully
deleted.

[root@centos7 ~]# nmcli connection delete mybond0
[root@centos7 ~]# nmcli connection delete mybond0

(3)删除从属接口

Connection ‘mybond0’ (9ed2f027-bbb1-44d1-87fc-7f7275d7fe70) successfully
deleted.

Connection ‘mybond0’ (9ed2f027-bbb1-44d1-87fc-7f7275d7fe70) successfully
deleted.

[root@centos7 ~]# nmcli connection delete bond-slave-ens34

(3)删除从属接口

(3)删除从属接口

Connection ‘bond-slave-ens34’ (a46ad620-d4b5-43f9-a73a-447785504a17)
successfully deleted.

[root@centos7 ~]# nmcli connection delete bond-slave-ens34
[root@centos7 ~]# nmcli connection delete bond-slave-ens34

[root@centos7 ~]# nmcli connection delete bond-slave-ens38

Connection ‘bond-slave-ens34’ (a46ad620-d4b5-43f9-a73a-447785504a17)
successfully deleted.

Connection ‘bond-slave-ens34’ (a46ad620-d4b5-43f9-a73a-447785504a17)
successfully deleted.

Connection ‘bond-slave-ens38’ (66b1f44d-ad71-4576-8061-f6cba2b976e8)
successfully deleted.

[root@centos7 ~]# nmcli connection delete bond-slave-ens38

[root@centos7 ~]# nmcli connection delete bond-slave-ens38

好了

Connection ‘bond-slave-ens38’ (66b1f44d-ad71-4576-8061-f6cba2b976e8)
successfully deleted.

Connection ‘bond-slave-ens38’ (66b1f44d-ad71-4576-8061-f6cba2b976e8)
successfully deleted.

正文永久更新链接地址:http://www.linuxidc.com/Linux/2017-06/144863.htm

 

 

澳门金沙国际 1

好了

好了

相关文章