RH134-第二十二节-高级网络配置

team:
   1.team也是链路聚合的一种方式
     a.最多支持八块网卡
     b.支持模式:广播、轮询、主备、负载均衡


   nmcliconnection add con-name team0 ifname team0 type team config'{"runner":{"name":"activebackup"}}' ip4 172.25.254.122/24 
                       ————        ——        ———
                        连接名        接口名        设备类型

    ##创建一个名为team0并且属性为team的链路接口,并为team0配置ip地址和网关


    nmcli connection add con-name eth0ifname eth0 type team-slave master team0        ##将eth0的网卡口添加到teaam0接口


   

 nmcli connection add con-name eth1ifname eth1 type team-slave master team0     ##将eth1的网卡口添加到teaam0接口
   

 

 teamdctl team0 stat


执行监控命令:watch -n teamdctl team0 stat  ##用teamdctl命令检查主动备份配置功能


打开一个命令窗口执行:
ping 172.25.254.250
测试
 

         ifconfig eth0 down     ##当将网卡eth0关掉时,eth1会顶替上,过程中网一直通
    

    

         ifconfig eth0 up       ##当将eth0重新开启的时候,eth1会依然正常工作,eth0处会在备用状态
    

   


bond
1>
链路聚合主动备份网卡,当一个网卡接口故障时,另一个会接替他的工作,不中断。
    nmcli connection add con-name bond0ifname bond0 type bond mode active-backup ip4 172.25.254.122/24     ##添加主动备份模式的bond0,ip为172.25.254.122  

    nmcli connection add con-name eth0ifname eth0 type bond-slave master bond0              ##添加网络接口

    nmcli connection add con-name eth0ifname eth1 type bond-slave master bond0

测试
   
    watch -n 1 cat/proc/net/bonding/bond0
    ping 172.25.254.61
    ifconfig eth0 down   ##让eth0故障

    网络并未中断,eth1接替eth0工作


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值