#####高级网络###

1.高级网络
网卡的链路聚合就是将多块网卡连接起来,有一块损坏时网络也依旧可以正常运行,可以提高网络访问速度也可以防止网卡损坏带来的损失;
网卡的链路聚合一般有"bond"和"team"两种模式

设置两个网卡:
在这里插入图片描述
在这里插入图片描述
##bond模式
设置两块网卡:eth0 eth1,清除原有的网络
在这里插入图片描述
nmcli connection show ##查看现有的网络
nmcli connection delete"system westos"
在这里插入图片描述
nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.6/24 ##添加一个bond0,ip 172.25.254.6/24
在这里插入图片描述
ifconfig (出现的bond0,有IP和网段)
在这里插入图片描述
watch -n 1 cat /proc/net/bonding/bond0 ##监控bond0接口信息
在这里插入图片描述
nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0 ##添加网卡设备到bond0接口
在这里插入图片描述
将eth0,eth1加入bond0,当系统程序运行时两个网卡其中一个出现问题时另一个会自动运行
在这里插入图片描述
测试:
ifconfig eth0 down/up ##关闭或开启网卡运行进行模拟测试

在这里插入图片描述
bond0聚合链路的删除:
依次删除bond0,eth0,eth1
nmcli connection delete bond0
nmcli connection delete eth0
nmcli connection delete eth1

###team模式
环境设置:清楚所有原有网络,team最多可使用8块网卡;
nmcli connection add con-name team0 ifname team0 type team config ‘{“runner”:{“name”:“activebackup”}}’ ip4 172.25.254.26/24 ##建立team
在这里插入图片描述
ifconfg ###查看网络桥接
在这里插入图片描述
watch -n 1 teamdctl team0 state ##监控team接口
在这里插入图片描述
连接eth0,eth1到端口
在这里插入图片描述
ping 172.25.254.46
在这里插入图片描述测试
在这里插入图片描述

###桥接###
环境配置
[[email protected] ~]# cd /etc/sysconfig/network-scripts/
[[email protected] network-scripts]# ls
ifcfg-br0 ifdown-ippp ifup-bnep ifup-Team
ifcfg-enp2s0 ifdown-ipv6 ifup-eth ifup-TeamPort
ifcfg-enp2s0.bak ifdown-isdn ifup-ib ifup-tunnel
ifcfg-HELLO_Cat ifdown-ovs ifup-ippp ifup-wireless
ifcfg-lo ifdown-post ifup-ipv6 init.ipv6-global
ifcfg-OPPO_R11t_co_apvdbw ifdown-ppp ifup-isdn keys-HELLO_Cat
ifcfg-Xindongsheng666666 ifdown-routes ifup-ovs keys-OPPO_R11t_co_apvdbw
ifcfg-佳佳 ifdown-sit ifup-plip keys-Xindongsheng666666
ifcfg-无忧? ifdown-Team ifup-plusb keys-佳佳
ifdown ifdown-TeamPort ifup-post keys-无忧?
ifdown-bnep ifdown-tunnel ifup-ppp network-functions
ifdown-eth ifup ifup-routes network-functions-ipv6
ifdown-ib ifup-aliases ifup-sit
[[email protected] network-scripts]# mv ifcfg-br0 ifcfg-enp2s0 /opt/ ##将ifcfg-br0 ifcfg-enp2s0 以到/opt/方便实验后网络恢复
[[email protected] network-scripts]# ls /opt/
ifcfg-br0 ifcfg-enp2s0 kingsoft rh shell
[[email protected] network-scripts]# nm-connection-editor ##删除所有网络连接
在这里插入图片描述
配置桥接文件br0
在这里插入图片描述

sysyemctl restart network ##重启网络
在这里插入图片描述桥接成功后brctl show ##查看桥接是否成功
可以安装虚拟机测试
在这里插入图片描述