Linux下网络接口配置,互连网接口配置

By admin in 美高梅手机版4858 on 2019年3月29日

Bonding

Bonding

Bonding

互连网接口配置–Bonding,网络接口–bonding

Bonding

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

一 Bonding 的办事模式

    Mode 0 (balance-rr)

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

    Mode 1 (active-backuop)

移动-备份(主备)策略:在绑定中,唯有2个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

BOOTPROTO=none

MASTER=bond0

SLAVE=yes

USERCTL=0

MASTE凯雷德钦命测网卡属于哪个bond。SLAVE钦定从属关系。USETiguanCTL钦点用户是不是有控制权限。

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)策略:从头到尾顺序的在每贰个slave接口上边发送数据包。本格局提供负载均衡和容错的力量。

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

    Mode 1 (active-backuop)

    Mode 1 (active-backuop)

    Mode 1 (active-backuop)

移步-备份(主备)策略:在绑定中,唯有1个slave被激活,当且仅移动的slave接口退步是才会激活别的的slave。为了制止沟通机爆发混乱此时绑定的MAC地址唯有3个表面端口上可知。

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

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

    Mode 3 (broadcast)

    Mode 3 (broadcast)

    Mode 3 (broadcast)

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

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

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

二 Bonding配置

二 Bonding配置

二 Bonding配置

Linux下网络接口配置,互连网接口配置。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两块网卡,下来修改两块网卡的配置

既正是要参与的网卡的布局文件,那里运用eth1、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钦命从属关系。USERubiconCTL钦赐用户是还是不是有控制权限。

MASTEKoleos钦命测网卡属于哪个bond。SLAVE钦命从属关系。USELacrosseCTL钦命用户是或不是有支配权限。

MASTE途睿欧钦点测网卡属于哪个bond。SLAVE钦点从属关系。USE卡宴CTL钦点用户是不是有决定权限。

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

美高梅手机版4858 ,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

 

 

美高梅手机版4858 1

好了

好了

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图
Copyright @ 2010-2019 美高梅手机版4858 版权所有