Re: Altering preferred connection

On 07 July 2017 at 01:10 Greg Oliver <oliver greg gmail com> wrote:

I would really have completely different routing tables for this rather than changing metrics.  Source 
routing /netfilter is your friend here, but source routing also comes with security risks, so you need to 
make sure netfilter is stopping anything you do not want.  Basically, then you can easily say the interafce 
it comes in on, it goes out of (or any interface you want...).

Thanks for the suggestion, Greg (and for your persistence in steering me towards other ways ;)).
I didn't relish delving into the topic, but it does look like I've been able to set up iptables rules to get 
the system a bit more flexible about the interface to use - certainly seems to be behaving more seamlessly, 
with less intervention required. (Mind you, I'm not sure if this is what you actually meant by 'different 
routing tables' - but perhaps it just demonstrates your point below!)

I still have slight niggle that what I've put in only works when my eth cable is unplugged - if it's an 
upstream failure then I guess the kernel simply can't know of that, and so it keeps trying on eth0 regardless.
I already have a script monitoring actual 'connectivity to the interweb', so I could use that to poke NM. I 
suspect, for that scenario, I probably ought to re-Up the eth0 connection anyway: dhclient ought to be re-run 
(and using autoconnect-retries=0) in case the outage was a reset of the broadband modem, which would warrant 
a renew/re-lease of the DHCP. (??)

The good thing about the linux kernel is that there are usually ten(s) or more ways of doing what you 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]