forked from jpirko/libteam
-
Notifications
You must be signed in to change notification settings - Fork 5
/
HOWTO.BASICS
105 lines (82 loc) · 2.98 KB
/
HOWTO.BASICS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
This is basic howto introduction to team.
-------------------------------------------------------------------------------
1) PREFERRED Using teamd
# cat teamd_test.conf
{
"device": "team0",
"runner": {"name": "activebackup"},
"link_watch": {"name": "ethtool"},
"ports": {
"eth1": {
"prio": -10,
"sticky": true
},
"eth2": {
"prio": 100
}
}
}
# teamd -f teamd_test.conf -d
# ip addr add 192.168.252.2/24 dev team0
Finally to remove interface team0:
# teamd -f teamd_test.conf -k
See "man teamd" for more details.
-------------------------------------------------------------------------------
2) Using teamnl and ip utils
# ip link add team0 type team
# teamnl team0 getoption mode
*NOMODE*
# teamnl team0 setoption mode activebackup
# teamnl team0 getoption mode
activebackup
# ip link set dev eth1 master team0
# ip link set dev eth2 master team0
# teamnl team0 ports
6: eth2: up 100 fullduplex
5: eth1: up 100 fullduplex
# ip addr add 192.168.252.2/24 dev team0
# ip link set team0 up
# teamnl team0 getoption activeport
0
# teamnl team0 setoption activeport 5
teamnl team0 getoption activeport
5
You can do link changes on ports and push some traffic through now to see
what happens. Note you also need to alter mac addresses manualy!
See "man teamnl" for more details.
-------------------------------------------------------------------------------
3) Using example c applications and ip util
Note: Used applications are part of this project but their main purpose
is to act as examples. Also they are usually not part of distribution
packages
First create team device:
# ip link add team0 type team
Then spawn monitor app on second console:
# team_monitor team0
You will see incoming events there.
Now do couple of commands:
# team_manual_control team0 get mode
*NOMODE*
# team_manual_control team0 set mode activebackup
# team_manual_control team0 get mode
activebackup
# ip link set dev eth1 master team0
# ip link set dev eth2 master team0
# ip addr add 192.168.252.2/24 dev team0
# ip link set team0 up
# team_manual_control team0 get activeport
NONE
# team_manual_control team0 set activeport eth1
# team_manual_control team0 get activeport
eth1
You can do link changes on ports and push some traffic through now to see
what happens. Note you also need to alter mac addresses manualy!
-------------------------------------------------------------------------------
4) Using example python daemon
To create and manage active backup team device:
# ./examples/python/team_daemon.py --port eth1 --port eth2 -m activebackup --active-port eth2 --team-name team0
Or simply just following command to create roundrobin team device with default name:
# ./examples/python/team_daemon.py --port eth1 --port eth2 -m roundrobin
And setup addr and bring team up:
# ip addr add 192.168.252.2/24 dev team0
# ip link set team0 up