centos7.x制作bond

nmcli的命令参考https://www.iyunv.com/thread-269695-1-1.html

bond的类型和centos6中的一致。

centos7.x制作bond如下:

1.查看网卡

[root@bogon ~]# nmcli connection show
NAME                UUID                                  TYPE            DEVICE 
Wired connection 1  c84ea813-4ac8-3a70-a7d2-3d9eca39f9fa  802-3-ethernet  ens37  
ens33               ae9ff038-a5d4-453a-aa8e-d8ccbb2ca0eb  802-3-ethernet  ens33 

2.设置bond

nmcli connection add con-name bond0 ifname bond0 type bond mode 0
nmcli con show
NAME                UUID                                  TYPE            DEVICE 
Wired connection 1  c84ea813-4ac8-3a70-a7d2-3d9eca39f9fa  802-3-ethernet  ens37  
bond0               f6c57a43-f5c4-4535-9324-60df81adc736  bond            bond0  
ens33               ae9ff038-a5d4-453a-aa8e-d8ccbb2ca0eb  802-3-ethernet  ens33 
ethtool bond0
Settings for bond0:
    Supported ports: [ ]
    Supported link modes:   Not reported
    Supported pause frame use: No
    Supports auto-negotiation: No
    Advertised link modes:  Not reported
    Advertised pause frame use: No
    Advertised auto-negotiation: No
    Speed: Unknown!
    Duplex: Unknown! (255)
    Port: Other
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: off
    Link detected: no

3.添加网卡进bond

nmcli connection add con-name slave-33 ifname ens33 type ethernet master bond0 
Connection 'slave-33' (33d98939-c472-49cc-842b-4904dd51e101) successfully added.
[root@bogon network-scripts]# nmcli connection add con-name slave-37 ifname ens37 type ethernet master bond0 
Connection 'slave-37' (b740df2f-66a8-49fc-8efa-5c90ec21f891) successfully added.
nmcli connection show
NAME                UUID                                  TYPE            DEVICE 
Wired connection 1  c84ea813-4ac8-3a70-a7d2-3d9eca39f9fa  802-3-ethernet  ens37  
bond0               f6c57a43-f5c4-4535-9324-60df81adc736  bond            bond0  
ens33               ae9ff038-a5d4-453a-aa8e-d8ccbb2ca0eb  802-3-ethernet  ens33  
slave-33            33d98939-c472-49cc-842b-4904dd51e101  802-3-ethernet  --     
slave-37            b740df2f-66a8-49fc-8efa-5c90ec21f891  802-3-ethernet  --  

4.配置bond0

这里可以使用nmcli命令来配置,也可以进入配置文件配置。

cat ifcfg-bond0 
DEVICE=bond0
BONDING_OPTS=mode=balance-rr
TYPE=Bond
BONDING_MASTER=yes
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
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=bond0
UUID=f6c57a43-f5c4-4535-9324-60df81adc736
ONBOOT=yes

5.重启网卡

systemctl restart network

6.查看bond

ethtool bond0
Settings for bond0:
    Supported ports: [ ]
    Supported link modes:   Not reported
    Supported pause frame use: No
    Supports auto-negotiation: No
    Advertised link modes:  Not reported
    Advertised pause frame use: No
    Advertised auto-negotiation: No
    Speed: 2000Mb/s
    Duplex: Full
    Port: Other
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: off
    Link detected: yes

7.网卡参数

[root@bogon network-scripts]# cat ifcfg-bond0 
DEVICE=bond0
BONDING_OPTS=mode=balance-rr
TYPE=Bond
BONDING_MASTER=yes
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
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=bond0
UUID=813f5d1c-265b-493e-b715-b2a38c4d5976
ONBOOT=yes
cat ifcfg-ens33
TYPE=Ethernet
NAME=ens33
UUID=eace0beb-3bef-4da4-885f-c12e497ca000
DEVICE=ens33
ONBOOT=yes
MASTER=bond0
SLAVE=yes

 

转载于:https://www.cnblogs.com/hanRR/p/10608117.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值