Skip to content

Tutorial

jpirko edited this page Aug 28, 2013 · 1 revision

Runing teamd manually

First, you have to install libteam packages onto your system. Many Linux distributions are including this packages already. For example in Fedora you just have to do:

$ sudo yum install teamd

In case your distribution does not include libteam packages, you have to compile libteam manually. Do it like this:

$ wget http://www.libteam.org/files/libteam-latest.tar.gz
$ tar -xf libteam-latest.tar.gz
$ cd libteam-*
$ ./configure
$ make
$ sudo make install

Now, you can just run teamd without any configuration file:

$ sudo teamd -d

The "-d" option just tells teamd to start in background. In this case, when no explicit configuration file is passed, teamd will use implicit one. That just tells to use interface name "team0" and team runner (mode) "roundrobin". No slave ports.

You can see the newly created interface "team0" by executing:

$ ip link

Now, use teamdctl to communicate with the running teamd. For example to get state:

$ sudo teamdctl team0 state

To add (enslave) interface "eth1" to "team0" just use:

$ sudo teamdctl team0 port add eth1

Note that "eth1" has to be DOWN before you try to enslave it.

To terminate the running teamd and remove "team0" just issue:

$ sudo teamd -k

See "man teamdctl" for more available commands.

If you would like to run teamd with custom configuration, you just simply pass configuration file on teamd command line using parameter "-f":

$ sudo teamd -d -f sample.conf

For info on how to make proper configuration file, see "man teamd.conf". Examples are available either under "teamd/example_configs/" directory of libteam tarball or under "/usr/share/doc/teamd-*/example_configs/" when you have installed Fedora package.

Using Fedora (18 and later) ifcfg scripts (initscripts)

You have to have teamd package installed on your system (same as previous case).

For team master interface, create ifcfg config similar to the following one:

$ /etc/sysconfig/network-scripts/ifcfg-team0 
DEVICE="team0"
DEVICETYPE="Team"
ONBOOT="yes"
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=192.168.23.11
TEAM_CONFIG='{"runner": {"name": "roundrobin"}}'
NM_CONTROLLED="no"

For each port device, create ifcfg config similar to the following one:

$ cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE="eth1"
DEVICETYPE="TeamPort"
ONBOOT="yes"
TEAM_MASTER="team0"
NM_CONTROLLED="no"

No to bring team0 up, issue following command:

$ sudo ifup team0

You can now see the newly created interface by "ip link" and or course you can work with it using teamdctl in the same way as in previous case.

Examples of ifcfg files are available either under "teamd/redhat/example_ifcfgs/" directory of libteam tarball or under "/usr/share/doc/teamd-*/example_ifcfgs/" when you have installed Fedora package.

More information about Fedora ifcfg configs can be found on http://docs.fedoraproject.org/en-US/Fedora/13/html/Deployment_Guide/s1-networkscripts-interfaces.html

Clone this wiki locally