Product SiteDocumentation Site

5.12.8. Configure Port Selection Override

The physical port which transmits a frame is normally selected by the kernel part of the team driver, and is not relevant to the user or system administrator. The output port is selected using the policies of the selected team mode (teamd runner). On occasion however, it is helpful to direct certain classes of outgoing traffic to certain physical interfaces to implement slightly more complex policies. By default the team driver is multiqueue aware and 16 queues are created when the driver initializes (see /usr/share/doc/kernel-doc/Documentation/networking/multiqueue.txt for details). If more or less queues are desired, the Netlink attribute tx_queues can be used to change this value during the team driver instance creation.
The queue ID for a port can be set by the port configuration option queue_id as follows:
{
  "queue_id": 3
}
These queue ID's can be used in conjunction with the tc utility to configure a multiqueue queue discipline and filters to bias certain traffic to be transmitted on certain port devices. For example, if using the above configuration and wanting to force all traffic bound to 192.168.1.100 to use eth1 in the team as its output device, issue commands as root in the following format:
~]# tc qdisc add dev team0 handle 1 root multiq
~]# tc filter add dev team0 protocol ip parent 1: prio 1 u32 match ip dst \
 192.168.1.100 action skbedit queue_mapping 3
This mechanism of overriding runner selection logic in order to bind traffic to a specific port can be used with all runners.