zoukankan      html  css  js  c++  java
  • 配置网卡绑卡 --RHEL7

    配置网卡绑卡

    1)网卡绑定(team方式)

    # 创建组接口
    nmcli connection add type team ifname team0 con-name team0 config '{"runner":{"name":"activebackup"}}' ipv4.addresses 192.168.10.166/24 ipv4.gateway 192.168.10.2 ipv4.method manual ipv4.dns "192.168.10.166,8.8.8.8" connection.autoconnect yes ipv6.method ignore

    # nmcli connection modify team0 ipv6.method ignore

    # 添加端口到组接口
    #将网卡ens32加入team0
    nmcli connection add ifname ens32 con-name team0-ens32 type team-slave master team0
    #将网卡ens35加入team0  
    nmcli connection add ifname ens35 con-name team0-ens35 type team-slave master team0

    [root@template ~]# nmcli connection show
    NAME UUID TYPE DEVICE
    ens32 152beb06-47c5-c5e8-95a9-385590654382 802-3-ethernet ens32
    team0 bded736d-659f-4aae-9e86-02ec4cae8cdd team team0
    team0-ens35 0dcd5326-b3a9-43fe-ad5c-9d7598457457 802-3-ethernet ens35
    team0-ens32 53c3a10d-6dc2-40da-ad53-cd8d4f35eb88 802-3-ethernet --
    [root@template ~]#

    #断开原本的ens32链接
    nmcli device disconnect ens32
    nmcli connection modify ens32 connection.autoconnect yes

    ##启用team0-ens32网络组设备
    nmcli connection up team0-ens32


    nmcli connection add type team ifname team1 con-name team1 config '{"runner":{"name":"activebackup"}}' ipv4.addresses 172.168.0.156/24 ipv4.method manual connection.autoconnect yes ipv6.method ignore

    nmcli connection add ifname ens36 con-name team1-ens36 type team-slave master team1
    nmcli connection add ifname ens37 con-name team1-ens37 type team-slave master team1

    # 重启网络
    systemctl restart network

    teamdctl team0 state

    2) 网卡绑定(bond方式)

    nmcli con add type bond con-name bond0 ifname bond0 ip4 192.168.10.157/24 gw4 192.168.10.2 mode active-backup ipv6.method ignore connection.autoconnect yes
    nmcli con add type bond-slave ifname ens32 master bond0
    nmcli con add type bond-slave ifname ens35 master bond0

    nmcli con up bond-slave-ens32
    nmcli con up bond-slave-ens35

    nmcli con up bond-bond0

    nmcli con add type bond con-name bond1 ifname bond1 ip4 172.168.0.154/24 mode active-backup ipv6.method ignore connection.autoconnect yes
    nmcli con add type bond-slave ifname ens36 master bond1
    nmcli con add type bond-slave ifname ens37 master bond1

    nmcli con up bond-slave-ens36
    nmcli con up bond-slave-ens37

    nmcli con up bond-bond1

    systemctl restart network

  • 相关阅读:
    学习Windows(BAT)、Linux(Shell)编程,并分别写一个脚本文件解决自己的一个问题
    国外著名黑客信息
    设置电脑护眼配色,减少电脑对眼睛的伤害(转)
    Java基础学习笔记
    [转] java正则表达式中的数量词
    JAVA学习间项目笔记
    [转]Java堆和栈的区别 经典总结
    Delphi下Webbrowser的使用技巧
    Pascal精要笔记
    网页元素特征字符串
  • 原文地址:https://www.cnblogs.com/binliubiao/p/8669059.html
Copyright © 2011-2022 走看看