11 centos 8 桥接及nic-team

Posted abel2020

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了11 centos 8 桥接及nic-team相关的知识,希望对你有一定的参考价值。

centos 8 桥接及nic-team:

//没发现有什么用
# systemctl restart NetworkManager

// nmcli 命令大部分配置可以自动保存为配置文件

// 查看接口(ifname)
# nmcli device 
DEVICE      TYPE      STATE                                  CONNECTION 
ens33       ethernet  connected                              ens33      
virbr0      bridge    connected                              virbr0     
br-ex       bridge    connecting (getting IP configuration)  br-ex      
lo          loopback  unmanaged                              --         
virbr0-nic  tun       unmanaged                              --    

// 查看连接 con-name   , 配置文件名为 if-CON-NAME
# nmcli connection show 
NAME    UUID                                  TYPE      DEVICE 
br-ex   21953ed4-7fbf-4410-955f-5f071d7a2264  bridge    br-ex  
ens33   835e5455-8478-47d0-9e4d-d43935ff8a74  ethernet  ens33  
virbr0  c9923ce9-a65a-4a78-9461-c4ce549b44a0  bridge    virbr0 

--------------------------------------------------------------------------------------------
test 1:  桥接

    //删除连接 
    # nmcli connection delete ens33 
    # nmcli connection delete br-ex 

    //添加一个网桥及连接
    # nmcli connection add type bridge con-name br-ex ifname br-ex autoconnect yes 
    # nmcli connection add type ethernet con-name ens33 ifname ens33 autoconnect yes 

    //重启接口及连接
    # nmcli connection down br-ex 
    # nmcli connection up br-ex 
    # nmcli connection down ens33 
    # nmcli connection up ens33 

    //配置地址 网关 dns , 配置完使用 route -n  ,ip , vi 等查看,已配置完成
    # nmcli connection modify br-ex ipv4.addresses 192.168.1.131/24     ipv4.gateway 192.168.1.253 ipv4.dns 235.5.5.5

    //网桥添加接口
    # nmcli connection add type bridge-slave con-name br-ex-p0 ifname ens33 master br-ex 

    //修改ip地址
    #nmcli connection modify br-ex ipv4.addresses 192.168.1.11/24

    //测试 
    route -n  ,ip   ,ping  
--------------------------------------------------------------------------------------------

test 2: nic team    , bound与team 雷同 

    ////删除连接
    #nmcli connection delete br-ex
    #nmcli connection delete br-ex-p0 

    //创建team0 模式为 activebackup,并配置地址等
    # nmcli connection add con-name team0 ifname team0 type team config {"runner":{"name":"activebackup"}} ipv4.addresses 192.168.1.11/24 ipv4.gateway 192.168.1.253 ipv4.dns 223.5.5.5 

    //team 中加入接口  ,没有指定con-name,自动生成的con-name也挺好的:) 
    # nmcli connection add type team-slave  ifname ens33 master team0 
    # nmcli connection add type team-slave  ifname ens37 master team0 
    #nmcli connection show
        NAME              UUID                                  TYPE      DEVICE
        team0             ede2b450-04a2-4f92-8755-898e346ee707  team      team0
        virbr0            c9923ce9-a65a-4a78-9461-c4ce549b44a0  bridge    virbr0
        team-slave-ens33  5fbc73b3-abff-4869-83ee-7e5efdcc49d9  ethernet  ens33
        team-slave-ens37  6d022e53-7359-41b4-9257-20615eaf9b57  ethernet  ens37


    //测试 
    route -n  ,ip   ,ping  
--------------------------------------------------------------------------------------------

 

以上是关于11 centos 8 桥接及nic-team的主要内容,如果未能解决你的问题,请参考以下文章

vmware设置centos桥接配置

Centos6.6安装选包及基础场景说明2

桥接模式8(11)

centos虚拟机桥接后无法上网(求助)

centos系统双网卡绑定及Bridge

Openstack-mitaka 使用及搭建