bond+网桥配置

bond一般使用较多的是bond1与bond4,bond1为主备模式(高可用,不用交换机做网口聚合),bond4为负载均衡模式(需要交换机做网口聚合)

以下为bound1(主备模式)的配置

 
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens6f0
TYPE=Ethernet
NAME=ens6f0
DEVICE=ens6f0
MASTER=ctl_bond1
SLAVE=yes
ONBOOT=yes
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens6f1
TYPE=Ethernet
NAME=ens6f1
DEVICE=ens6f1
MASTER=ctl_bond1
SLAVE=yes
ONBOOT=yes

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-ctl_bond1
TYPE=Bond
BONDING_OPTS=mode=active-backup
BONDING_MASTER=yes
BOOTPROTO=none
NAME=ctl_bond1
DEVICE=ctl_bond1
ONBOOT=yes
BRIDGE=br0
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-br0
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
DEVICE=br0
NAME=br0
ONBOOT=yes
IPADDR=192.168.7.110
PREFIX=24
GATEWAY=192.168.7.1
TYPE=Bridge

[root@localhost ~]#

 

重启所有网络服务生效。命令如下:
systemctl restart NetworkManager;nmcli networking off;nmcli networking on

 

链路冗余测试:

从其他主机持续ping查看丢包情况,或远程传输数据查看对传输速率影响(如nfs网络挂载,dstat查看速率)

nmcli c down ens6f0
nmcli c up ens6f0
nmcli c down ens6f1
nmcli c up ens6f1

 

 

 此时,从本地起kvm虚拟机,可通过桥接共享网卡

虚机IP配置如下:

[root@ansible ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=none
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.7.250
PREFIX=24
GATEWAY=192.168.7.1

虚机网络选择如下:

 

 

posted @ 2023-03-08 19:30  咿呀哒喏  阅读(338)  评论(0编辑  收藏  举报