team--teamd


删除组

删除wired connection 1

删除wired connection 2

删除完成后退出

删除完成后查看

[root@localhost Desktop]# nmcli connection show
NAME         UUID                                  TYPE            DEVICE 
eno16777736  ed486609-f625-4ac9-bd81-2768492fdb53  802-3-ethernet  --     
virbr0       b23c485d-8dda-47d6-93f4-4fcb0c690387  bridge          virbr0 
[root@localhost Desktop]#

先关闭两个网卡

[root@localhost Desktop]# ip link set eno
eno16777736  eno33554944  
[root@localhost Desktop]# ip link set eno16777736 down
[root@localhost Desktop]# ip link set eno33554944 down
[root@localhost Desktop]# ip link 
add     delete  help    set     show

查看关闭网卡的结果

[root@localhost Desktop]# ip link show
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno33554944:  mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
    link/ether 00:0c:29:3c:01:ca brd ff:ff:ff:ff:ff:ff
3: eno16777736:  mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
    link/ether 00:0c:29:3c:01:c0 brd ff:ff:ff:ff:ff:ff
4: virbr0:  mtu 1500 qdisc noqueue state DOWN mode DEFAULT 
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
5: virbr0-nic:  mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 500
    link/ether 52:54:00:62:e0:49 brd ff:ff:ff:ff:ff:ff
```可以看到两个网卡已经被关闭

>建立teamd_working_configs

```bash
[root@localhost Desktop]# mkdir ~/teamd_working_configs

查看example的位置

[root@localhost Desktop]# locate activebackup_ethtool_1.conf
/usr/share/doc/teamd-1.17/example_configs/activebackup_ethtool_1.conf

将example复制到teamd_working_configs下面

[root@localhost Desktop]# cd /usr/share/doc/teamd-1.17/example_configs/
[root@localhost example_configs]# cp activebackup_ethtool_1.conf ~/teamd_working_configs/activebackup_ethtool_1.conf
[root@localhost example_configs]# cd ~/teamd_working_configs/

编辑activebackup_ethtool_1.conf

[root@localhost teamd_working_configs]# vi activebackup_ethtool_1.conf 

{
        "device":       "team0",
        "runner":       {"name": "activebackup"},
        "link_watch":   {"name": "ethtool"},
        "ports":        {
                "eno16777736": {
                        "prio": -10,
                        "sticky": true
                },
                "eno33554944": {
                        "prio": 100
                }
        }
}

:wq

让配置生效

[root@localhost teamd_working_configs]# teamd -g -f activebackup_ethtool_1.conf -d
Using team device "team0".
Using PID file "/var/run/teamd/team0.pid"
Using config file "/root/teamd_working_configs/activebackup_ethtool_1.conf"

查看组信息

[root@localhost teamd_working_configs]# nmcli connection show
NAME         UUID                                  TYPE            DEVICE 
eno16777736  ed486609-f625-4ac9-bd81-2768492fdb53  802-3-ethernet  --     
virbr0       b23c485d-8dda-47d6-93f4-4fcb0c690387  bridge          virbr0

使用teamdctl查看team0组信息

[root@localhost teamd_working_configs]# teamdctl team0 state
setup:
  runner: activebackup
ports:
  eno16777736
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
        down count: 0
  eno33554944
    link watches:
      link summary: up
      instance[link_watch_0]:
        name: ethtool
        link: up
        down count: 0
runner:
  active port: eno16777736
[root@localhost teamd_working_configs]#

设置IP地址

[root@localhost network-scripts]# ip addr add 192.168.10.33/24 dev team0
[root@localhost network-scripts]# ip addr show team0
10: team0:  mtu 1500 qdisc noop state DOWN 
    link/ether 00:0c:29:3c:01:c0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.33/24 scope global team0
       valid_lft forever preferred_lft forever
[root@localhost network-scripts]# ping 192.168.10.20
connect: Network is unreachable
[root@localhost network-scripts]# systemctl restart network
[root@localhost network-scripts]# ping 192.168.10.20
connect: Network is unreachable
[root@localhost network-scripts]# ip addr show team0
10: team0:  mtu 1500 qdisc noop state DOWN 
    link/ether 00:0c:29:3c:01:c0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.33/24 scope global team0
       valid_lft forever preferred_lft forever

开启team0

[root@localhost network-scripts]# ip link set dev team0 up
[root@localhost network-scripts]# ping 192.168.10.20
PING 192.168.10.20 (192.168.10.20) 56(84) bytes of data.
^C
--- 192.168.10.20 ping statistics ---
26 packets transmitted, 0 received, 100% packet loss, time 25018ms

ping测试

[root@localhost network-scripts]# ping 192.168.10.20
PING 192.168.10.20 (192.168.10.20) 56(84) bytes of data.
From 192.168.10.33 icmp_seq=4 Destination Host Unreachable
From 192.168.10.33 icmp_seq=5 Destination Host Unreachable
From 192.168.10.33 icmp_seq=6 Destination Host Unreachable
From 192.168.10.33 icmp_seq=7 Destination Host Unreachable
From 192.168.10.33 icmp_seq=8 Destination Host Unreachable
From 192.168.10.33 icmp_seq=9 Destination Host Unreachable
From 192.168.10.33 icmp_seq=10 Destination Host Unreachable
^C
--- 192.168.10.20 ping statistics ---
10 packets transmitted, 0 received, +7 errors, 100% packet loss, time 9012ms
pipe 4

失败

查看team0信息

[root@localhost network-scripts]# ip link show team0
10: team0:  mtu 1500 qdisc noqueue state UP mode DEFAULT 
    link/ether 00:0c:29:3c:01:c0 brd ff:ff:ff:ff:ff:ff

已经是开启状态

查看team0IP地址

[root@localhost network-scripts]# ip addr show team0
10: team0:  mtu 1500 qdisc noqueue state UP 
    link/ether 00:0c:29:3c:01:c0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.33/24 scope global team0
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe3c:1c0/64 scope link 
       valid_lft forever preferred_lft forever

继续ping测试

[root@localhost network-scripts]# ping 192.168.10.20
PING 192.168.10.20 (192.168.10.20) 56(84) bytes of data.
^C
--- 192.168.10.20 ping statistics ---
19 packets transmitted, 0 received, 100% packet loss, time 18012ms

失败

开启两块网卡

[root@localhost network-scripts]# ip link set eno16777736 up
[root@localhost network-scripts]# ip link set eno33554944 up

ping测试

[root@localhost network-scripts]# ping 192.168.10.20
PING 192.168.10.20 (192.168.10.20) 56(84) bytes of data.
From 192.168.10.33 icmp_seq=19 Destination Host Unreachable
From 192.168.10.33 icmp_seq=20 Destination Host Unreachable
From 192.168.10.33 icmp_seq=21 Destination Host Unreachable
From 192.168.10.33 icmp_seq=22 Destination Host Unreachable
^C
--- 192.168.10.20 ping statistics ---
28 packets transmitted, 0 received, +4 errors, 100% packet loss, time 27027ms
pipe 4

失败

重启网络

[root@localhost network-scripts]# systemctl restart network

ping测试

[root@localhost network-scripts]# ping 192.168.10.20
PING 192.168.10.20 (192.168.10.20) 56(84) bytes of data.
64 bytes from 192.168.10.20: icmp_seq=1 ttl=64 time=0.516 ms
64 bytes from 192.168.10.20: icmp_seq=2 ttl=64 time=0.261 ms
64 bytes from 192.168.10.20: icmp_seq=3 ttl=64 time=0.524 ms
64 bytes from 192.168.10.20: icmp_seq=4 ttl=64 time=0.534 ms
^C
--- 192.168.10.20 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 0.261/0.458/0.534/0.117 ms
[root@localhost network-scripts]#

成功


总结:

1.需要set team0 up
2.需要把两个网卡再开启
3.配置好地址
4.重启network


results matching ""

    No results matching ""