1

We are a group of students completing a development project unit at the University of Sydney. We have had difficulty with linux routing, and would really appreciate being pointed in the right direction. Our overall task is to combine mobile internet connections to increase the bandwidth.

System Diagram What we want We have several routers with their own subnets, all feeding into a switch. Want to use each router like its own gateway on a single machine.

We would like to use MPTCP to make use of each link to extend the network bandwidth. The Raspberry Pi on the diagram above is only acting as a router. We have used iptables on the RPis to forward packets from the ethernet to the 4G internet. For example, we have 4 routers with subnet 192.168.101.0/24, 192.168.102.0/24, 192.168.103.0/24, 192.168.104.0/24. In the laptop, there is only one physical NIC eth0. We would like to set up MPTCP on the Laptop, using virtual NICs or routing rules for each Raspberry Pi.

What we have tried?

We used ip addr add to add multiple IP addresses to the physical eth0. Then we tried to add routing rules based on http://multipath-tcp.org/pmwiki.php/Users/ConfigureRouting. But in the end all the traffic still goes through the default router. We have already successfully used MPTCP with different (non-virtual) NICs connected to the Laptop.

What do we want to know? Is this feasible?

We haven’t had success using these methods, but that may be related to our lack of experience in this field.

If it is feasible, could you point us in the right direction?

Edit

Here's our attempt to run @dirkt 's solution:

    ian@ians-mof-ish-pc:/etc/netplan$ ip r
default via 192.168.91.1 dev eth0.1 
192.168.91.0/24 dev eth0.1 proto kernel scope link src 192.168.91.100 
192.168.92.0/24 dev eth0.2 proto kernel scope link src 192.168.92.100 
ian@ians-mof-ish-pc:/etc/netplan$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 34:e6:d7:7c:6e:ee brd ff:ff:ff:ff:ff:ff
    inet 192.168.92.201/24 brd 192.168.92.255 scope global enp2s0
       valid_lft forever preferred_lft forever
    inet6 fe80::36e6:d7ff:fe7c:6eee/64 scope link 
       valid_lft forever preferred_lft forever
4: wlp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 70:77:81:c1:07:61 brd ff:ff:ff:ff:ff:ff
5: eth0.1@enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 34:e6:d7:7c:6e:ee brd ff:ff:ff:ff:ff:ff
    inet 192.168.91.100/24 scope global eth0.1
       valid_lft forever preferred_lft forever
    inet6 fe80::36e6:d7ff:fe7c:6eee/64 scope link 
       valid_lft forever preferred_lft forever
6: eth0.2@enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 34:e6:d7:7c:6e:ee brd ff:ff:ff:ff:ff:ff
    inet 192.168.92.100/24 scope global eth0.2
       valid_lft forever preferred_lft forever
    inet6 fe80::36e6:d7ff:fe7c:6eee/64 scope link 
       valid_lft forever preferred_lft forever
ian@ians-mof-ish-pc:/etc/netplan$ ip rule show
0:  from all lookup local 
32764:  from 192.168.92.100 lookup 2 
32765:  from 192.168.91.100 lookup 1 
32766:  from all lookup main 
32767:  from all lookup default 
ian@ians-mof-ish-pc:/etc/netplan$ ip r show table 1
default via 192.168.91.1 dev eth0.1 
192.168.91.0/24 dev eth0.1 scope link 
ian@ians-mof-ish-pc:/etc/netplan$ ip r show table 2
default via 192.168.92.1 dev eth0.2 
192.168.92.0/24 dev eth0.2 scope link 
ian@ians-mof-ish-pc:/etc/netplan$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.91.100 icmp_seq=1 Destination Host Unreachable
From 192.168.91.100 icmp_seq=2 Destination Host Unreachable
From 192.168.91.100 icmp_seq=3 Destination Host Unreachable
From 192.168.91.100 icmp_seq=4 Destination Host Unreachable
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3041ms
pipe 3
ian@ians-mof-ish-pc:/etc/netplan$ ping 192.168.91.1
PING 192.168.91.1 (192.168.91.1) 56(84) bytes of data.
From 192.168.91.100 icmp_seq=1 Destination Host Unreachable
From 192.168.91.100 icmp_seq=2 Destination Host Unreachable
From 192.168.91.100 icmp_seq=3 Destination Host Unreachable
^C
--- 192.168.91.1 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3055ms
pipe 3
  • " ...all the traffic still goes through the default router." When the bandwidth maxes out on the default router does the next router get used? – jc__ Oct 2 '18 at 13:34
  • Are all the modems in the same ISP? – Rui F Ribeiro Oct 2 '18 at 18:43
  • @RuiFRibeiro the modems may or may not be on the same ISP. We can test using one or two different carriers. – Jack Oct 6 '18 at 5:30
  • @jc__ I don't believe so – Jack Oct 6 '18 at 5:31
0

You can use VLAN to create a "virtual" NIC for each RaspPi on the Laptop.

Say the first RaspPi gets VLAN tag 1, then you do

ip link add link eth0 name eth0.1 type vlan id 1

on the laptop, and similarly an RaspPi #1. On the RaspPi, ignore eth0 and just configure eth0.1 with an address. Go on and do this for all RaspPi's, with different VLAN tags.

On the laptop, ignore eth0, use all eth0.1, eth0.2 etc. and give them different addresses.

Then use whatever you did for

We have already successfully used MPTCP with different (non-virtual) NICs connected to the Laptop.

to make it work.

(MPTCP via routing sounds interesting, I should have a look at this).

  • Thanks for the response! We've given this a go, but haven't been able to get packets to transmit. I'm not sure what the standard way to link code is here. We're getting "Destination Host Unreachable" when we ping Google, having set things up like you suggest here – Jack Oct 6 '18 at 5:29
  • You can edit your question and include code (indent 4 spaces). You can also upload code in a pastebin etc. and edit the question with a link. It's difficult to "remote debug" a setup (and I'm not even sure where the internet gateway would be in your diagram). In general, to debug, run tcpdump -ni eth0 etc. in different terminal windows on every interesting interface on the path, and see how far the ping packets get. ip route get 8.8.8.8 etc. to test routing may also help. If you switch is VLAN capable, you also may have to configure the switch. – dirkt Oct 6 '18 at 12:29
  • Thanks! I've added code to the question above. And we've used tcpdump to follow the ARC on an RPi (pastebin.com/FMbQ0bxY) and the Laptop (pastebin.com/g5exuEgJ). We're using an unmanaged switch – Jack Oct 7 '18 at 2:56
  • 1
    We've managed to get it working using simple routing tables! For future reference, MPTCP doesn't require individual NICs, just routing tables. See here multipath-tcp.org/pmwiki.php/Users/ConfigureRouting – Jack Oct 7 '18 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.