View previous topic :: View next topic |
Author |
Message |
The_Great_Sephiroth Veteran
Joined: 03 Oct 2014 Posts: 1602 Location: Fayetteville, NC, USA
|
Posted: Thu Feb 18, 2016 7:19 pm Post subject: Multiple gateways, one NIC? |
|
|
I have a client with two separate Internet connections. I have DHCP setup to offer two gateways, but how do I do this on Linux systems? One NIC, two gateways. I assume one will be default and the other not default, but how do I do this? I have one Debian system and two Gentoo systems that need this setup. _________________ Ever picture systemd as what runs "The Borg"? |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3129
|
Posted: Thu Feb 18, 2016 8:17 pm Post subject: |
|
|
What is the purpose of those 2 connections (And 2 gateways) on a single NIC?
It is possible to set both as default, but it would result in changing the active connection every few seconds and the resulting link would be very unstable.
However, if you add metric, you can have a failover. You could also try some sort of IP based load balancing, configuring routes to different zones/IP pools via separate gateways.
Also, how did you set the DHCP? Don't they compete to get the client? |
|
Back to top |
|
|
gordonb3 Apprentice
Joined: 01 Jul 2015 Posts: 185
|
Posted: Fri Feb 19, 2016 9:23 am Post subject: |
|
|
Use option 121 (classless static routes) to set both static and default routes. Option 3 (default route) is ignored by linux dhcp client. Problem is that option 121 does not allow setting a metric value to prioritize gateways, but your dhcp client may in fact add this based on the order in which these are given. The only way to know is to try.
To set up some kind of load balance you can divide traffic between the two gateways by using a netmask of 128 (i.e 0.0.0.0/128 and 128.0.0.0/128) and add the redundancy in the gateways themselves. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
|