Traditional TCP sessions bind strictly to a single IP address on a single network interface. If an active network cable is unplugged or Wi-Fi drops, established connections break, causing file transfers to abort and real-time remote sessions to terminate. Multipath TCP (MPTCP), natively supported in the modern Linux kernel, revolutionizes transport-layer reliability. By striping TCP subflows across multiple physical network interfaces (such as Ethernet and cellular, or dual ISPs) simultaneously, MPTCP delivers seamless failover and aggregated link throughput.
Understanding Multipath TCP Architecture and Kernel Support
Multipath TCP operates at the transport layer, presenting a standard socket interface to applications while maintaining multiple underlying TCP subflows across diverse network paths:
- Subflow Aggregation: Traffic is intelligently distributed across available network interfaces based on bandwidth capacity and path latency.
- Seamless Connection Migration: If an active interface fails, MPTCP retransmits unacknowledged packets over surviving subflows with zero application disruption.
- Upstream Kernel Integration: Modern Ubuntu distributions (such as Ubuntu 22.04 LTS and 24.04 LTS running kernel 5.15+) incorporate native upstream MPTCP implementation without requiring out-of-tree kernel patches.
Enabling MPTCP in the Linux Kernel
Before configuring interface routing rules, confirm that MPTCP is enabled in kernel sysctl parameters:
sudo sysctl -w net.mptcp.enabled=1
To persist this configuration across reboots, add the directive to /etc/sysctl.d/99-mptcp.conf:
echo "net.mptcp.enabled = 1" | sudo tee /etc/sysctl.d/99-mptcp.conf
sudo sysctl --system
Verify that the kernel reports MPTCP as active:
cat /proc/sys/net/mptcp/enabled
A value of 1 confirms transport layer activation.
Configuring MPTCP Endpoint Addresses with ip mptcp
The iproute2 suite provides the mptcp command to advertise local IP addresses as viable subflow endpoints. Assume your Ubuntu host has two active interfaces: eth0 (IP 192.168.1.100) and eth1 (IP 10.0.0.100).
Inspect existing MPTCP endpoints:
ip mptcp endpoint show
Add eth0 as an endpoint with signal and subflow capabilities:
sudo ip mptcp endpoint add 192.168.1.100 dev eth0 signal subflow
Add the secondary interface eth1 as an additional subflow endpoint:
sudo ip mptcp endpoint add 10.0.0.100 dev eth1 subflow
Set the maximum allowed subflows per connection to utilize both physical interfaces:
sudo ip mptcp limits set subflow 2 add_addr_accepted 2
Configuring Source-Based Policy Routing for Dual Interfaces
To ensure outgoing packets on secondary interfaces route correctly through their respective gateways, establish source routing tables:
# Add routing tables to /etc/iproute2/rt_tables if not present
sudo bash -c 'echo "100 rt_eth0" >> /etc/iproute2/rt_tables'
sudo bash -c 'echo "200 rt_eth1" >> /etc/iproute2/rt_tables'
# Configure default routes for each table
sudo ip route add default via 192.168.1.1 dev eth0 table rt_eth0
sudo ip route add default via 10.0.0.1 dev eth1 table rt_eth1
# Configure routing rules based on source IP
sudo ip rule add from 192.168.1.100 lookup rt_eth0
sudo ip rule add from 10.0.0.100 lookup rt_eth1
Testing and Verifying MPTCP Connections
To verify that client applications establish valid MPTCP connections, use mptcpize to wrap existing socket binaries, or run test queries using curl against MPTCP-enabled test endpoints:
sudo apt install mptcpize -y
mptcpize run curl https://multipath-tcp.org
Monitor active MPTCP socket statistics using ss:
ss -M -t
The output displays the active MPTCP token, subflow counts, and individual interface throughput metrics, demonstrating verified dual-interface link aggregation.