网络桥接网络的链路聚合

    xiaoxiao2023-10-07  154

    网络桥接 没有桥接网络慢 有桥接网络快

    ###配置网桥接口 移走/etc/sysconfig/network-sc…/ifcfg开头所有的文件 自己写一个网络桥接文件 vim /etc/sysconfig/network-scripts/ifconfg-enp0s25

    再写一个在br0网卡上配置ip文件 vim /vim /etc/sysconfig/network-scripts/ifconfg-br0

    重起网络

    ###桥接网卡 brctl addbr br0 添加网卡 ifconfig br0 172.25.254.112/24,设置临时ip 这时候只能ping自己 把我们原来设置的虚拟机中的ip改掉ONBOOT改为no

    将网卡插在桥接接口上brctl addif br0 eth0 ping别人可以ping通

    bond(rr(轮训) back-up主备) back-up一个ip备份多个网卡eth0 eth1

    先添加一个网卡eth0 nmcli connection show看看系统的网卡

    nmcli connection delete System\ eth0

    nmcli connection show发现消失

    添加两块网桥

    nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.214/100(给这个ip创建一个链路聚合 这个ip创建备份网卡) y nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0 添加eth0为网卡

    nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0 添加eth1为网卡

    这时候用watch -n 1 cat /proc/net/bonding/bond0 用另一个shell ping172.25.254.12 发现有两块网卡

    ifconfig eth0 down 再watch中发现eth1立即接替工作ping也没有断

    team(负载均衡轮训)

    最新回复(0)