Multiple WAN addresses from different ISPs on a single interface


#1

Hi,

I am setting up a VyOS instance with a WAN (eth0) and a LAN (eth1). On WAN side, there are multiple static addresses (from three different ISPs) available:

ISP 1:
11.11.11.11/24 via 11.11.11.1
11.11.11.12/24 via 11.11.11.1
11.11.11.13/24 via 11.11.11.1

ISP 2:
22.22.22.22/24 via 22.22.22.1
22.22.22.23/24 via 22.22.22.1
22.22.22.24/24 via 22.22.22.1

ISP 3:
33.33.33.33/24 via 33.33.33.1

I have successfully added all the addresses to eth0 and added a default route (0.0.0.0/0 via 11.11.11.1) for ISP 1. Now, I can ping all three addresses of ISP 1 from another host on the Internet, but not addresses of ISP 2 nor ISP 3. I understand this is because the reply traffic are being incorrectly sent thru ISP 1 gateway. How could I make the reply traffic sent thru the correct gateway?

Thanks!


#2

Oh I managed to figure it out: Just add another two default routes for ISP 2 and ISP 3, and all addresses are reachable from the Internet.

I used to though multiple 0.0.0.0/0 routes would cause problems but they seem to work well. I repeatedly curl checkip.amazonaws.com and I can see different IP addresses from the three ISPs.