You are not logged in.

#1 2020-05-17 06:09:55

ylluminate
Member
Registered: 2020-05-17
Posts: 4

Building an Arch router with 2 or more input ISPs with failover?

I have two ISP options where both provide DHCP leases. I want the secondary (and possibly a 3rd) as a failover if the first (or second) fails, eg:
diagram

The setup instructions here seem to be for a more simple case:
https://wiki.archlinux.org/index.php/Router

Could someone please outline what would be necessary for the multiple ISPs that would NAT all traffic over to the LAN interface?

Also, DHCP is optional since I'm actually passing this onto another more robust router that does some other filtering and DNS probably isn't critical either since I just want to use ISP defaults or 1.1.1.1.

Last edited by ylluminate (2020-05-17 06:30:19)

Offline

#2 2020-05-17 06:21:08

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 28,733
Website

Re: Building an Arch router with 2 or more input ISPs with failover?

If your looking for Ubuntu support, they have their own boards: https://wiki.archlinux.org/index.php/Co … pport_ONLY


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2020-05-17 06:27:30

ylluminate
Member
Registered: 2020-05-17
Posts: 4

Re: Building an Arch router with 2 or more input ISPs with failover?

LOL, I'm sorry - Thanks for catching that!  I changed gears and am NOT using Ubuntu now.  I decided that Netplan feels somewhat like a trainwreck with relatively poor support and wanted to have more control over the system. FIXED! big_smile

Last edited by ylluminate (2020-05-17 06:30:49)

Offline

#4 2020-05-17 15:15:02

Malstrond
Member
From: Germany
Registered: 2009-06-03
Posts: 96

Re: Building an Arch router with 2 or more input ISPs with failover?

I implemented this with shorewall. Their documentation on the subject is quite extensive.

Offline

#5 2020-05-20 01:48:15

ylluminate
Member
Registered: 2020-05-17
Posts: 4

Re: Building an Arch router with 2 or more input ISPs with failover?

@Malstrond I really appreciate your having shared this. One thing that had me concerned with Shorewall is the remarks about requiring static routes. One of the ISPs is a USB tethered iPhone and another is a wireless network that comes and goes. Would such connections go contrary to this or is there a way to set them up such that when they're reattached they retain static routing? I assume that failover could be such that it just tries "static routes" down the list and as they are present or not present, it will just move along...

Offline

#6 2020-05-20 17:01:44

Malstrond
Member
From: Germany
Registered: 2009-06-03
Posts: 96

Re: Building an Arch router with 2 or more input ISPs with failover?

I basically have the same issue, because one of my uplinks is a consumer DSL link with a dynamic IP, so I have a pppoe0 interface that can go away at any time and come back with a different IP and gateway.
Have a look at the documentation for the providers file.

The GATEWAY column can be set to "detect", so shorewall detects the routing at the time of execution. You also need to set the "optional" option for the respective interface in the interfaces file. Since shorewall is basically a really elaborate script and not a daemon, you need to reexecute it when the connection changes.
You basically need to run "shorewall restart" every time a link goes up.
That depends on how you actually make the connection, for example in my case I can put a script with "shorewall restart" into the ip-up.d directory of pppd and pppd executes them after connection.
I think dhcpcd has the same functionality for scripts to run in /usr/lib/dhcpcd/dhcpcd-hooks.

A link going down is not an issue because the routing table set by shorewall just uses the next available route.

You can only use static routing if the IP and gateway of all interfaces are always the same, which it doesn't sound like from what you're saying.

Last edited by Malstrond (2020-05-20 17:05:34)

Offline

#7 2020-05-20 17:10:18

ylluminate
Member
Registered: 2020-05-17
Posts: 4

Re: Building an Arch router with 2 or more input ISPs with failover?

Interesting, so in my case the biggest issue is going to be that I want to be sure that that the USB iPhone (ipheth) eth# - when plugged in and becomes available - will trigger such a script to throw it back in rotation. I've gotta make this "layman" proof since the main user is going to be unable to do any kind of diagnostic / script execution. There's a very, very good chance that the iPhone USB tether is going to be the main ISP given that the current DSL provider is talking about going out of business and there are no other options at this location that are more reasonable than the mobile phone service.

Offline

#8 2020-05-21 00:07:40

fukawi2
Administrator
From: .vic.au
Registered: 2007-09-28
Posts: 5,906
Website

Re: Building an Arch router with 2 or more input ISPs with failover?

What you need is called Policy Based Routing. I wrote a script a number of years ago to manage this: https://github.com/fukawi2/pb-route

It is quite a few years old and unmaintained, but it should still be able to generate a starting config for you.

Offline

Board footer

Powered by FluxBB