Switching to backup Network

Valeri Galtsev galtsev at kicp.uchicago.edu
Wed Feb 19 14:32:37 UTC 2020



> On Feb 18, 2020, at 7:29 PM, Doug Hardie <bc979 at lafn.org> wrote:
> 
>> On 18 February 2020, at 12:25, Valeri Galtsev <galtsev at kicp.uchicago.edu> wrote:
>> 
>> 
>> 
>> On 2020-02-18 14:19, Doug Hardie wrote:
>>> One of my clients has a machine running 12.1 that is connected via two different NICs to two different WANs.  He has drops from 2 different ISPs to provide redundancy. I have configured each of the DNS names with both IP addresses so that web access will switch over to the backup when the primary is down.  Setfib and pf are used to make that work.  That works fine (although there is a DNS timeout involved).  The problem is that all the servers on the machine talk out via the primary IP address.  While web access continues, the server initiated functions fail because the next hop is down.  Is there a way to switch everything over to the backup network in this case?  I don't find anything that enables automatic changes to the default network.
>>> Also, when the backup network goes down, the default network entry for setfib 1 route is deleted.  I have to manually enter that when it comes backup.  I am initially setting that in /etc/rc.local.  Is there a way to make it either remain, or be restored?
>>> 
>> 
>> I would look into link aggregation (lagg):
>> 
>> https://www.freebsd.org/doc/en/books/handbook/network-aggregation.html
>> 
>> I used that to make my FreeBSD laptop switch over from WiFi to ethernet interface when the last link is available. Worked neat for me.
>> 
>> Valeri
>> 
> 
> Lagg looks neat, but my first setup didn't work.  I suspect the issue is the IP addresses.  Each of the two networks have quite different IPs.  Both are fixed IP addresses but from different allocations.  It appears that lagg requires the use of one IP for both networks.  All the examples use just one IP address for both networks.
> 

I did not look into setting lagg for two ethernet interfaces, mine was for ethernet + WiFi. But they were definitely on different networks. Additional simplicity of my case was: both interfaces were DHCP clients (that took care of routing auto-magically). There was one “hack” I did in my case: I have a vague recollection I made both adapters under lagg have the same MAC address (by changing one of them), but that likely was due to my insufficient knowledge or laziness when I was setting it up. Expert probably will do it without that hack. I still have a feeling, one can do it for static IPs (my laptop configuration does work for interfaces on different networks), that’s why I suggested to look into that.

Hopefully, some lagg expert will offer you help. It may make sense to ask on freebsd-net list.

Valeri

> -- Doug
> 
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"

++++++++++++++++++++++++++++++++++++++++
Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247
++++++++++++++++++++++++++++++++++++++++



More information about the freebsd-questions mailing list