team、Bridge模式

来源:互联网 发布:github php开源项目 编辑:程序博客网 时间:2024/06/06 00:46

team模式  

team模式下支持八块网卡的主备 并且时负载均衡类型

在双网卡主机上使用命令

nmcli connection add con-name team0 ifname team0 type team config '{"runner":{"name":"activebackup"}}' ip4 172.25.254.100/24

 

nmcli connection add con-name eth0 ifname eth0 type team-slave master team0

nmcli connection add con-name eth1 ifname eth1 type team-slave master team0

添加两块网卡

使用ping 172.25.254.250测试

使用watch -n 1 teamdctl team0 state 查看team0的工作状态 在ping通后 使用ifconfig eth0 down 下掉一块网卡

 

Bridge

桥接模式

/etc/sysconfig/network-script/ 新建ifcfg-enp0s25

内容

DEVICE=enp0s25

ONBOOT=yes

BOOTPROTO=none

BRIDGE=br0

 

 

新建ifcfg-br0

DEVICE=br0

ONBOOT=yes

BOOTPROTO=none

IPADDR=172.25.254.30

PREFIX=24

TYPE=Bridge

 

命令方式新建桥接 (一次性的,重启后失效)

brctl addbr br0 新建一个br0接口

brctl addif br0 eth0 给br0接口一个物理网卡

ifconfig br0 172.25.254.130/24 给br0设置IP

 

ifconfig br0 down

brctl delbr br0