3

I have two ppp0 and ppp1 connections using 3G modems. Is it possible to use both connections simultaneously? Unfortunately, when defining the default gateway for the first ppp0 there is a problem with the ppp1 connection and vice versa. Is it possible not to set the gateway and redirect the packets to IP gateways via iptables rules?

In general, I wanted to use this when sending messages from several modems in parallel at Mbuni MMS gateway.

1
  • In general, you can't use internet connections "simultanously" unless you can put something at both ends that makes it work. So it depends on whatever is on the other end of those ppp connections. TCP and UDP are built this way, unfortunately (no multihoming). Commented Jan 6, 2018 at 16:53

2 Answers 2

1

Disclaimer: I have never used this method, only PPP, so I cannot guarantee that this will work; I only learned about this from my CCNA certification long ago. Hopefully someone who has more experience can confirm or deny whether this works! I'm cribbing some of this information from an archive of Michael Bruck's "The PPP Multilink Protocol (MP) for Linux".

There is a method called Multilink PPP that is likely what you're looking for. Your providers have to support it on their end, but Linux supports it. First, make sure that CONFIG_PPP_MULTILINK is enabled in the kernel and that your pppd has multilink enabled as well. AFAICT from reading the man page, in the current version of pppd you just need to run pppd with the multilink option for each interface and as long as the other side knows how to handle it it should work: you should end up with only one ppp interface at the end.

1

Without having an own server in the back, there are solutions with multihomed default route and policy based routing. Basically, one connection still uses just one uplink then, but another connection can use another uplink, giving performance improvements when multiple connections are active in parallel.

A multihomed default route is simple:

ip route replace default nexthop dev ppp0 weight 1 nexthop dev ppp1 weight 1 

but most probably it will not suffice since answers to packets coming in over one link might get out over another link -- and most probably won't be recognised by the other end then.

This is where policy based routing comes into play; there are many guides in the internet out there on that, for example here.

If you have your own server in the back, you can set something "on top" which re-combines both connections, and gives real almost-double bandwidth even for single connections. I currently have success with tunneling multilink ppp over ssh (principle), although TCP over TCP is not so good (one could use netcat or socat instead of ssh as backend). For that I have configured my server that I can launch pppd with sudo without the need for a password, and on my client I run something like:

pppd nodetach local debug noauth multilink eap-timeout 90 \ pty "ssh -b 10.220.105.203 -p 333 <user>@<server> -t -e none sudo pppd noauth multilink eap-timeout 90" \ 10.12.13.2:10.12.13.1 

(ssh will still ask me for a password this way.)

Other solutions I tried but could not quite get to work yet include multilink ppp over vtun (because the latter segfaults on my client) or vtrunkd (was unspecific-unreliable).

And there might also be ways to use the bonding or teaming driver with tap-interfaces.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.