Users.ConfigureRouting History
Hide minor edits - Show changes to output
October 28, 2024, at 09:42 AM
by - Banner: only for <5.6
Added lines 1-8:
%p bgcolor=#ffeeee font-weight=bold text-align=center% [+If you are looking for MPTCP in Linux >= v5.6:+]
\\
\\
https://mptcp.dev
\\
\\
For Linux <= 5.4, you can stay on this website.
\\
\\
https://mptcp.dev
\\
\\
For Linux <= 5.4, you can stay on this website.
Changed lines 75-78 from:
!!!! Automatic configuration with MULTI
Kristian Evensen <kristrev@simula.no> created a daemon which automatically configures the correct routing tables. You can install his tool from %newwin%[[https://github.com/kristrev/multi | github]].
Kristian Evensen <
to:
!!!! Automatic configuration with "Multihomed-Routing"
Kristian Evensen <kristian.evensen@gmail.com> developed a set of scripts that integrate well with existing Network Managers to properly configure the multihomed routing. Check it out at %newwin%[[https://github.com/kristrev/multihomed-routing]].
Changed lines 86-90 from:
Ondřej Caletka <Ondrej.Caletka@cesnet.cz> created a script for his Gentoo-based system. You can use his script from %newwin%[[https://gist.github.com/oskar456/7264828|github]]. For any questions, please contact him directly.
to:
Ondřej Caletka <Ondrej.Caletka@cesnet.cz> created a script for his Gentoo-based system. You can use his script from %newwin%[[https://gist.github.com/oskar456/7264828|github]]. For any questions, please contact him directly.
!!!! DEPRECATED - Automatic configuration with MULTI
Kristian Evensen <kristrev@simula.no> created a daemon which automatically configures the correct routing tables. You can install his tool from %newwin%[[https://github.com/kristrev/multi | github]].
!!!! DEPRECATED - Automatic configuration with MULTI
Kristian Evensen <kristrev@simula.no> created a daemon which automatically configures the correct routing tables. You can install his tool from %newwin%[[https://github.com/kristrev/multi | github]].
Changed line 81 from:
Dragos Tatulea <dragos@endocode.com> integrated support for Multipath TCP into ConnMan. Checkout his %newwin%[[https://github.com/endocode/connman|github repository]] for access to the source-code
to:
Dragos Tatulea <dragos@endocode.com> and Dongsu Park <dongsu@endocode> integrated support for Multipath TCP into ConnMan. Checkout his %newwin%[[https://github.com/endocode/connman|github repository]] for access to the source-code
Changed line 81 from:
Dragos Tatulea <dragos@endocode.com> integrated support for Multipath TCP into ConnMan. Checkout his %newwin%[[github repository|https://github.com/endocode/connman]] for access to the source-code
to:
Dragos Tatulea <dragos@endocode.com> integrated support for Multipath TCP into ConnMan. Checkout his %newwin%[[https://github.com/endocode/connman|github repository]] for access to the source-code
Changed line 81 from:
Dragos Tatulea <dragos@endocode.com> integrated support for Multipath TCP into ConnMan. Checkout his %newwin%[github repository|https://github.com/endocode/connman] for access to the source-code
to:
Dragos Tatulea <dragos@endocode.com> integrated support for Multipath TCP into ConnMan. Checkout his %newwin%[[github repository|https://github.com/endocode/connman]] for access to the source-code
Added lines 78-81:
!!!! Automatic configuration with ConnMan
Dragos Tatulea <dragos@endocode.com> integrated support for Multipath TCP into ConnMan. Checkout his %newwin%[github repository|https://github.com/endocode/connman] for access to the source-code
Changed line 62 from:
Doing the above each time by hand is very cumbersome. Two alternative automatic solutions are available:
to:
Doing the above each time by hand is very cumbersome. Some alternative automatic solutions are available:
Changed lines 65-66 from:
!!!! Using the configuration scripts
to:
!!!! Using the configuration scripts (Ubuntu/Debian-based systems)
Changed lines 77-81 from:
Kristian Evensen <kristrev@simula.no> created a daemon which automatically configures the correct routing tables. You can install his tool from %newwin%[[https://github.com/kristrev/multi | github]].
to:
Kristian Evensen <kristrev@simula.no> created a daemon which automatically configures the correct routing tables. You can install his tool from %newwin%[[https://github.com/kristrev/multi | github]].
!!!! Another way for Gentoo-based systems
Ondřej Caletka <Ondrej.Caletka@cesnet.cz> created a script for his Gentoo-based system. You can use his script from %newwin%[[https://gist.github.com/oskar456/7264828|github]]. For any questions, please contact him directly.
!!!! Another way for Gentoo-based systems
Ondřej Caletka <Ondrej.Caletka@cesnet.cz> created a script for his Gentoo-based system. You can use his script from %newwin%[[https://gist.github.com/oskar456/7264828|github]]. For any questions, please contact him directly.
Changed line 1 from:
to:
!! Manual configuration
Changed lines 69-72 from:
* %newwin%[[mptcp_up | https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/mptcp_up]] - Place it inside /etc/network/if-up.d/ and make it executable.
* %newwin%[[mptcp_down | https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/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 | https://listes-2.sipr.ucl.ac.be/sympa/info/mptcp-dev]] Mailing-List.
* %newwin%[[
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 [[
to:
* %newwin%[[https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/mptcp_up | mptcp_up]] - Place it inside /etc/network/if-up.d/ and make it executable.
* %newwin%[[https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/mptcp_down | 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 [[https://listes-2.sipr.ucl.ac.be/sympa/info/mptcp-dev | mptcp-dev]] Mailing-List.
* %newwin%[[https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/mptcp_down | 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 [[https://listes-2.sipr.ucl.ac.be/sympa/info/mptcp-dev | mptcp-dev]] Mailing-List.
Changed line 77 from:
Kristian Evensen <kristrev@simula.no> created a daemon which automatically configures the correct routing tables. You can install his tool from %newwin%[[github | https://github.com/kristrev/multi]].
to:
Kristian Evensen <kristrev@simula.no> created a daemon which automatically configures the correct routing tables. You can install his tool from %newwin%[[https://github.com/kristrev/multi | github]].
Changed lines 69-72 from:
* %newwin%[[mptcp_up https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/mptcp_up]] - Place it inside /etc/network/if-up.d/ and make it executable.
* %newwin%[[mptcp_down https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/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 https://listes-2.sipr.ucl.ac.be/sympa/info/mptcp-dev]] Mailing-List.
* %newwin%[[mptcp_down https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/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 https://listes-2.sipr.ucl.ac.be/sympa/info/mptcp-dev]] Mailing-List.
to:
* %newwin%[[mptcp_up | https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/mptcp_up]] - Place it inside /etc/network/if-up.d/ and make it executable.
* %newwin%[[mptcp_down | https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/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 | https://listes-2.sipr.ucl.ac.be/sympa/info/mptcp-dev]] Mailing-List.
* %newwin%[[mptcp_down | https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/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 | https://listes-2.sipr.ucl.ac.be/sympa/info/mptcp-dev]] Mailing-List.
Changed line 77 from:
Kristian Evensen <kristrev@simula.no> created a daemon which automatically configures the correct routing tables. You can install his tool from %newwin%[[github https://github.com/kristrev/multi]].
to:
Kristian Evensen <kristrev@simula.no> created a daemon which automatically configures the correct routing tables. You can install his tool from %newwin%[[github | https://github.com/kristrev/multi]].
Deleted lines 0-3:
The answer is: '''Any end host having multiple interfaces MUST have one routing table per interface, this is NOT configured automatically (at the moment) by the kernel'''. Here is the reason: We are still (maybe not for long anymore) in an era where end-hosts are assumed to have one default gateway, hence one default outgoing interface. The kernel does support multiple gateways to be defined in the same routing table, but then the first gateway only is used, until it fails, and only then is the second one used.
Changed lines 55-57 from:
to:
\\
\\
\\
Changed lines 61-62 from:
to:
\\
Changed line 71 from:
to:
\\
Added lines 59-76:
!! Automatic Configuration
Doing the above each time by hand is very cumbersome. Two alternative automatic solutions are available:
!!!! Using the configuration scripts
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:
* %newwin%[[mptcp_up https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/mptcp_up]] - Place it inside /etc/network/if-up.d/ and make it executable.
* %newwin%[[mptcp_down https://github.com/multipath-tcp/mptcp-scripts/blob/master/scripts/rt_table/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 https://listes-2.sipr.ucl.ac.be/sympa/info/mptcp-dev]] Mailing-List.
!!!! Automatic configuration with MULTI
Kristian Evensen <kristrev@simula.no> created a daemon which automatically configures the correct routing tables. You can install his tool from %newwin%[[github https://github.com/kristrev/multi]].
Changed lines 1-5 from:
Many people tell us: Why the hell is my routing working so strangely with multiple addresses? :-) The answer is: '''Any end host having multiple interfaces MUST have one routing table per interface, this is NOT configured automatically (at the moment) by the kernel'''. Here is the reason: We are still (maybe not for long anymore) in an era where end-hosts are assumed to have one default gateway, hence one default outgoing interface. The kernel does support multiple gateways to be defined in the same routing table, but then the first gateway only is used, until it fails, and only then is the second one used. 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.
to:
Many people tell us: Why the hell is my routing working so strangely with multiple addresses?
The answer is: '''Any end host having multiple interfaces MUST have one routing table per interface, this is NOT configured automatically (at the moment) by the kernel'''. Here is the reason: We are still (maybe not for long anymore) in an era where end-hosts are assumed to have one default gateway, hence one default outgoing interface. The kernel does support multiple gateways to be defined in the same routing table, but then the first gateway only is used, until it fails, and only then is the second one used.
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.
The answer is: '''Any end host having multiple interfaces MUST have one routing table per interface, this is NOT configured automatically (at the moment) by the kernel'''. Here is the reason: We are still (maybe not for long anymore) in an era where end-hosts are assumed to have one default gateway, hence one default outgoing interface. The kernel does support multiple gateways to be defined in the same routing table, but then the first gateway only is used, until it fails, and only then is the second one used.
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.
Changed lines 3-5 from:
Then, you
to:
You need to configure several routing tables in the following manner:
Changed lines 5-6 from:
to:
\\
Changed lines 8-11 from:
to:
IP-Address: 10.1.1.2
Subnet-Mask: 255.255.255.0
Gateway: 10.1.1.1
Subnet-Mask: 255.255.255.0
Gateway: 10.1.1.1
Changed lines 13-16 from:
to:
IP-Address: 10.1.2.2
Subnet-Mask: 255.255.255.0
Gateway: 10.1.2.1
Subnet-Mask: 255.255.255.0
Gateway: 10.1.2.1
Changed lines 19-35 from:
The necessary commands are: [[BR]]
{{{
# This creates two different routing tables, that we use based on the source-address.
ip rule add from 10.1.1.2 table 1
ip rule add from 10.1.2.2 table 2
# Configure the two different routing tables
ip route add 10.1.1.0/24 dev eth0 scope link table1
ip route add default via 10.1.1.1 dev eth0 table 1
ip route add 10.1.2.0/24 dev eth1 scope link table 2
ip route adddefault via 10.1.2.1 dev eth1 table 2
# default route for the selection process of normal internet-traffic
ip route add default scope global nexthop via 10.1.1.1 dev eth0
}}}
{{{
#
# Configure the two different routing tables
ip route add 10.1.1.0/24 dev eth0 scope link table
ip route add
ip route add
# default
ip route add
to:
The necessary commands are:
# This creates two different routing tables, that we use based on the source-address.
@@ip rule add from 10.1.1.2 table 1@@
@@ip rule add from 10.1.2.2 table 2@@
# Configure the two different routing tables
@@ip route add 10.1.1.0/24 dev eth0 scope link table 1@@
@@ip route add default via 10.1.1.1 dev eth0 table 1@@
@@ip route add 10.1.2.0/24 dev eth1 scope link table 2@@
@@ip route add default via 10.1.2.1 dev eth1 table 2@@
# default route for the selection process of normal internet-traffic
@@ip route add default scope global nexthop via 10.1.1.1 dev eth0@@
# This creates two different routing tables, that we use based on the source-address.
@@ip rule add from 10.1.1.2 table 1@@
@@ip rule add from 10.1.2.2 table 2@@
# Configure the two different routing tables
@@ip route add 10.1.1.0/24 dev eth0 scope link table 1@@
@@ip route add default via 10.1.1.1 dev eth0 table 1@@
@@ip route add 10.1.2.0/24 dev eth1 scope link table 2@@
@@ip route add default via 10.1.2.1 dev eth1 table 2@@
# default route for the selection process of normal internet-traffic
@@ip route add default scope global nexthop via 10.1.1.1 dev eth0@@
Changed lines 36-57 from:
mptcp-kernel:~# ip rule show
mptcp-kernel:~# ip route
10.1.1.0/24 dev eth0 proto kernel scope link src 10.1.1.2
10.1.2.0/24 dev eth1 proto kernel scope link src 10.1.2.2
mptcp-kernel:~# ip route show table 1
10.1.1.0/24 dev eth0 scope link
mptcp-kernel:~# ip route show table 2
10.1.2.0/24 dev eth1 scope link
}}}
to:
@@mptcp-kernel:~# ip rule show@@
@@0: from all lookup local@@
@@32764: from 10.1.2.2 lookup 2@@
@@32765: from 10.1.1.2 lookup 1@@
@@32766: from all lookup main@@
@@32767: from all lookup default@@
@@mptcp-kernel:~# ip route@@
@@10.1.1.0/24 dev eth0 proto kernel scope link src 10.1.1.2@@
@@10.1.2.0/24 dev eth1 proto kernel scope link src 10.1.2.2@@
@@default via 10.1.1.1 dev eth0@@
@@mptcp-kernel:~# ip route show table 1@@
@@10.1.1.0/24 dev eth0 scope link@@
@@default via 10.1.1.1 dev eth0@@
@@mptcp-kernel:~# ip route show table 2@@
@@10.1.2.0/24 dev eth1 scope link@@
@@default via 10.1.2.1 dev eth1@@
@@0: from all lookup local@@
@@32764: from 10.1.2.2 lookup 2@@
@@32765: from 10.1.1.2 lookup 1@@
@@32766: from all lookup main@@
@@32767: from all lookup default@@
@@mptcp-kernel:~# ip route@@
@@10.1.1.0/24 dev eth0 proto kernel scope link src 10.1.1.2@@
@@10.1.2.0/24 dev eth1 proto kernel scope link src 10.1.2.2@@
@@default via 10.1.1.1 dev eth0@@
@@mptcp-kernel:~# ip route show table 1@@
@@10.1.1.0/24 dev eth0 scope link@@
@@default via 10.1.1.1 dev eth0@@
@@mptcp-kernel:~# ip route show table 2@@
@@10.1.2.0/24 dev eth1 scope link@@
@@default via 10.1.2.1 dev eth1@@
Changed line 1 from:
Many people tell us: Why the hell is my routing working so strangely with multiple addresses ? :-) The answer is: '''Any end host having multiple interfaces MUST have one routing table per interface, this is NOT configured automatically (at the moment) by the kernel'''. Here is the reason: We are still (maybe not for long anymore) in an era where end-hosts are assumed to have one default gateway, hence one default outgoing interface. The kernel does support multiple gateways to be defined in the same routing table, but then the first gateway only is used, until it fails, and only then is the second one used. 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.
to:
Many people tell us: Why the hell is my routing working so strangely with multiple addresses? :-) The answer is: '''Any end host having multiple interfaces MUST have one routing table per interface, this is NOT configured automatically (at the moment) by the kernel'''. Here is the reason: We are still (maybe not for long anymore) in an era where end-hosts are assumed to have one default gateway, hence one default outgoing interface. The kernel does support multiple gateways to be defined in the same routing table, but then the first gateway only is used, until it fails, and only then is the second one used. 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.
Added lines 1-61:
Many people tell us: Why the hell is my routing working so strangely with multiple addresses ? :-) The answer is: '''Any end host having multiple interfaces MUST have one routing table per interface, this is NOT configured automatically (at the moment) by the kernel'''. Here is the reason: We are still (maybe not for long anymore) in an era where end-hosts are assumed to have one default gateway, hence one default outgoing interface. The kernel does support multiple gateways to be defined in the same routing table, but then the first gateway only is used, until it fails, and only then is the second one used. 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.
Now here is concretely how it goes. You have to enable the following compiler-option: ''Networking options -> IP: advanced router'' and ''Networking options -> IP: policy routing''.
Then, you need to configure several routing tables in the following manner:
Imagine you have two interfaces eth0 and eth1 with the following properties:
'''eth0'''
* IP-Address: 10.1.1.2
* Subnet-Mask: 255.255.255.0
* Gateway: 10.1.1.1
'''eth1'''
* IP-Address: 10.1.2.2
* Subnet-Mask: 255.255.255.0
* Gateway: 10.1.2.1
Thus, you need to configure the routing rules so that packets with source-IP 10.1.1.2 will get routed over eth0 and those with 10.1.2.2 will get routed over eth1.
The necessary commands are: [[BR]]
{{{
# This creates two different routing tables, that we use based on the source-address.
ip rule add from 10.1.1.2 table 1
ip rule add from 10.1.2.2 table 2
# Configure the two different routing tables
ip route add 10.1.1.0/24 dev eth0 scope link table 1
ip route add default via 10.1.1.1 dev eth0 table 1
ip route add 10.1.2.0/24 dev eth1 scope link table 2
ip route add default via 10.1.2.1 dev eth1 table 2
# default route for the selection process of normal internet-traffic
ip route add default scope global nexthop via 10.1.1.1 dev eth0
}}}
With this, your routing table should look like the following:
{{{
mptcp-kernel:~# ip rule show
0: from all lookup local
32764: from 10.1.2.2 lookup 2
32765: from 10.1.1.2 lookup 1
32766: from all lookup main
32767: from all lookup default
mptcp-kernel:~# ip route
10.1.1.0/24 dev eth0 proto kernel scope link src 10.1.1.2
10.1.2.0/24 dev eth1 proto kernel scope link src 10.1.2.2
default via 10.1.1.1 dev eth0
mptcp-kernel:~# ip route show table 1
10.1.1.0/24 dev eth0 scope link
default via 10.1.1.1 dev eth0
mptcp-kernel:~# ip route show table 2
10.1.2.0/24 dev eth1 scope link
default via 10.1.2.1 dev eth1
}}}
Now here is concretely how it goes. You have to enable the following compiler-option: ''Networking options -> IP: advanced router'' and ''Networking options -> IP: policy routing''.
Then, you need to configure several routing tables in the following manner:
Imagine you have two interfaces eth0 and eth1 with the following properties:
'''eth0'''
* IP-Address: 10.1.1.2
* Subnet-Mask: 255.255.255.0
* Gateway: 10.1.1.1
'''eth1'''
* IP-Address: 10.1.2.2
* Subnet-Mask: 255.255.255.0
* Gateway: 10.1.2.1
Thus, you need to configure the routing rules so that packets with source-IP 10.1.1.2 will get routed over eth0 and those with 10.1.2.2 will get routed over eth1.
The necessary commands are: [[BR]]
{{{
# This creates two different routing tables, that we use based on the source-address.
ip rule add from 10.1.1.2 table 1
ip rule add from 10.1.2.2 table 2
# Configure the two different routing tables
ip route add 10.1.1.0/24 dev eth0 scope link table 1
ip route add default via 10.1.1.1 dev eth0 table 1
ip route add 10.1.2.0/24 dev eth1 scope link table 2
ip route add default via 10.1.2.1 dev eth1 table 2
# default route for the selection process of normal internet-traffic
ip route add default scope global nexthop via 10.1.1.1 dev eth0
}}}
With this, your routing table should look like the following:
{{{
mptcp-kernel:~# ip rule show
0: from all lookup local
32764: from 10.1.2.2 lookup 2
32765: from 10.1.1.2 lookup 1
32766: from all lookup main
32767: from all lookup default
mptcp-kernel:~# ip route
10.1.1.0/24 dev eth0 proto kernel scope link src 10.1.1.2
10.1.2.0/24 dev eth1 proto kernel scope link src 10.1.2.2
default via 10.1.1.1 dev eth0
mptcp-kernel:~# ip route show table 1
10.1.1.0/24 dev eth0 scope link
default via 10.1.1.1 dev eth0
mptcp-kernel:~# ip route show table 2
10.1.2.0/24 dev eth1 scope link
default via 10.1.2.1 dev eth1
}}}

