码迷,mamicode.com
首页 > 其他好文 > 详细

11 centos 8 桥接及nic-team

时间:2020-06-24 21:52:48      阅读:69      评论:0      收藏:0      [点我收藏+]

标签:创建   getting   c4c   code   测试   system   res   自动   device   

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

标签:创建   getting   c4c   code   测试   system   res   自动   device   

原文地址:https://www.cnblogs.com/abel2020/p/13189877.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!