0

Here is a snippet of my dhcpd.conf file

subnet 10.3.0.0 netmask 255.255.0.0 { 
 option classless-routes 16, 10,2, 10,3,0,110,16,10,4,10,3,0,110,0,10,3,0,110;
}

It generates the following routes

default via 10.3.0.110 dev eth0
10.2.0.0/16 via 10.3.0.110 dev eth0
10.3.0.0/16 dev eth0  proto kernel  scope link  src 10.3.0.190
10.4.0.0/16 via 10.3.0.110 dev eth0 

What I need now is a secondary default gateway to handle failure of the main one. I had that working with the router option but I can't use router and classless-routes. Any suggestions?

1 Answers1

0

Multiple default gateways will need multiple routing tables, and rules (perhaps iptables tables) to tag the traffic so that it uses said tables. I've done this before, but not in a failover situation. I set up email traffic to go via one link (and its associated default gateway) and web based stuff to go via another faster link. If you are looking for HA on your default gateway, then you need to investigate whether your router supports LACP or something similar. This post has some more details:

Round Robin Default Gateways on Linux

GeoSword
  • 1,647
  • 12
  • 16
  • Can't you do it with routes as follows? Apologies for the mess, I can't work out how to make a newline. `default via 10.3.0.110 dev br0 default via 10.3.0.1 dev br0 metric 2 onlink` – Wayne Gemmell Apr 07 '17 at 09:21