Manual configuration

With multiple addresses defined on several interfaces, you want to be able to tell your kernel "If I select such source address, please use that specific interface+gateway, not the default ones". You achieve this by configuring one routing table per outgoing interface, each routing table being identified by a number. The route selection process then happens in two phases. First the kernel does a lookup in the policy table (that you need to configure with ip rules). The policies, in our case, will be For such source prefix, go to routing table number x. Then the corresponding routing table is examined to select the gateway based on the destination address.

You need to configure several routing tables in the following manner: Imagine you have two interfaces eth0 and eth1 with the following properties:




Thus, you need to configure the routing rules so that packets with source-IP will get routed over eth0 and those with will get routed over eth1.

The necessary commands are:

  # This creates two different routing tables, that we use based on the source-address.
  ip rule add from table 1
  ip rule add from table 2

  # Configure the two different routing tables
  ip route add dev eth0 scope link table 1
  ip route add default via dev eth0 table 1

  ip route add dev eth1 scope link table 2
  ip route add default via dev eth1 table 2

  # default route for the selection process of normal internet-traffic
  ip route add default scope global nexthop via dev eth0

With this, your routing table should look like the following:

  mptcp-kernel:~# ip rule show
  0:      from all lookup local
  32764:  from lookup 2
  32765:  from lookup 1
  32766:  from all lookup main
  32767:  from all lookup default

  mptcp-kernel:~# ip route dev eth0  proto kernel  scope link  src dev eth1  proto kernel  scope link  src
  default via dev eth0

  mptcp-kernel:~# ip route show table 1 dev eth0  scope link
  default via dev eth0

  mptcp-kernel:~# ip route show table 2 dev eth1  scope link
  default via dev eth1

Automatic Configuration

Doing the above each time by hand is very cumbersome. Some alternative automatic solutions are available:

Using the configuration scripts (Ubuntu/Debian-based systems)

In /etc/network/if-up.d/ you can place scripts that will be executed each time a new interface comes up. We created two scripts:

  * mptcp_up - Place it inside /etc/network/if-up.d/ and make it executable.
  * mptcp_down - Place it inside /etc/network/if-post-down.d/ and make it executable.

These scripts work most of the time. They use environment variables to configure the routing tables. If they do not work for you, please contact us on the mptcp-dev Mailing-List.

Automatic configuration with "Multihomed-Routing"

Kristian Evensen <> developed a set of scripts that integrate well with existing Network Managers to properly configure the multihomed routing. Check it out at

Automatic configuration with ConnMan

Dragos Tatulea <> and Dongsu Park <dongsu@endocode> integrated support for Multipath TCP into ConnMan. Checkout his github repository for access to the source-code

Another way for Gentoo-based systems

Ondřej Caletka <> created a script for his Gentoo-based system. You can use his script from github. For any questions, please contact him directly.

DEPRECATED - Automatic configuration with MULTI

Kristian Evensen <> created a daemon which automatically configures the correct routing tables. You can install his tool from github.