Loading

VLAN over team配置

创建team网卡

nmcli connection add type team con-name myteam ifname team0 config '{"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}}'

禁止team网卡本身的IPv4/v6地址配置

# nmcli connection modify myteam ipv4.method disable ipv6.method ignore
# nmcli connection up myteam

创建子接口的网卡配置

# nmcli connection add type team-slave con-name myteam-port1 ifname ens10 master team0
# nmcli connection add type team-slave con-name myteam-port2 ifname ens15 master team0

teamctl检查配置配置生效情况

# teamdctl team0 state
setup:
  runner: activebackup
ports:
  ens10
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
        down count: 0
  ens15
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
        down count: 0
runner:
  active port: ens10

Create the VLAN connection profiles which will be on top of the new team device.

### With static IP addressing:
# nmcli connection add type vlan con-name myteam-vlan123 ifname team0.123 id 123 dev team0 ip4 192.168.0.100/24 gw4 192.168.0.1

### With DHCP addressing:
# nmcli connection add type vlan con-name myteam-vlan123 ifname team0.123 id 123 dev team0

查看及修改连接配置

查看所有生效配置
# nmcli connection show <profile name>
修改配置
# nmcli connection modify <profile name> <property> <value>
  • 查询所有配置可查看 nm-settings 的man-page.

Debug

查看当前的链接情况
# for connection in $(nmcli -t --fields uuid con) ; do echo ; nmcli con show uuid $connection | egrep "connection.id|connection.interface-name" ; done
如需删除,使用:
# nmcli connection del "$connection_id"
posted @ 2022-12-19 10:22  motorao  阅读(61)  评论(0编辑  收藏  举报