//bond(主要用于6系统)
nmcli connection add type bond mode balance-rr con-name bond0 ifname bond0 ipv4.method manual ipv4.addresses 192.168.56.100/24 ipv4.gateway 192.168.56.2 ipv4.dns 8.8.8.8
nmcli connection add type bond-slave con-name bond-eth1 ifname eth1 master bond0
nmcli connection add type bond-slave con-name bond-eth2 ifname eth2 master bond0
//team0
nmcli connection add type team con-name team0 ifname team0 \
config '{"runner":{"name":"activebackup"}}' \
ipv4.addresses 192.168.56.111/24 \
ipv4.gateway 192.168.56.2 \
ipv4.dns 192.168.56.2 ipv4.method manual
nmcli connection add type team-slave \
con-name team0-port1 ifname eth1 master team0
nmcli connection add type team-slave \
con-name team0-port2 ifname eth2 master team0
动态修改team模式
可以通过预定义配置文件,然后通过配置文件修改team接口的属性:( man teamd.conf)
# teamdctl team0 config dump > /tmp/team.conf
# cat /tmp/team.conf
以最新修改的配置选项修改team0属性
# nmcli con mod team0 team.config /tmp/team.conf
修改之后需要重启team0
# nmcli connection down team0;nmcli connection up team0
# nmcli connection up team0-port1
# nmcli connection up team0-port2
创建桥接网络br1
nmcli connection add type bridge con-name br1 ifname br1 \
ipv4.addresses 192.168.56.222/24 ipv4.method manual
桥接至eth1
nmcli connection add type bridge-slave con-name br1-port1 ifname eth1 master br1
nmcli connection add type bond mode balance-rr con-name bond0 ifname bond0 ipv4.method manual ipv4.addresses 192.168.56.100/24 ipv4.gateway 192.168.56.2 ipv4.dns 8.8.8.8
nmcli connection add type bond-slave con-name bond-eth1 ifname eth1 master bond0
nmcli connection add type bond-slave con-name bond-eth2 ifname eth2 master bond0
//team0
nmcli connection add type team con-name team0 ifname team0 \
config '{"runner":{"name":"activebackup"}}' \
ipv4.addresses 192.168.56.111/24 \
ipv4.gateway 192.168.56.2 \
ipv4.dns 192.168.56.2 ipv4.method manual
nmcli connection add type team-slave \
con-name team0-port1 ifname eth1 master team0
nmcli connection add type team-slave \
con-name team0-port2 ifname eth2 master team0
动态修改team模式
可以通过预定义配置文件,然后通过配置文件修改team接口的属性:( man teamd.conf)
# teamdctl team0 config dump > /tmp/team.conf
# cat /tmp/team.conf
以最新修改的配置选项修改team0属性
# nmcli con mod team0 team.config /tmp/team.conf
修改之后需要重启team0
# nmcli connection down team0;nmcli connection up team0
# nmcli connection up team0-port1
# nmcli connection up team0-port2
创建桥接网络br1
nmcli connection add type bridge con-name br1 ifname br1 \
ipv4.addresses 192.168.56.222/24 ipv4.method manual
桥接至eth1
nmcli connection add type bridge-slave con-name br1-port1 ifname eth1 master br1