LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-03-2022, 05:02 PM   #1
Jason_25
Member
 
Registered: Nov 2001
Posts: 180

Rep: Reputation: 23
Multiple WAN connections - can web requests reach a server from a higher metric default gateway?


I have a complicated network now.

My testing initially showed that web requests from my phone for instance could not get to the web server if the cable gateway (default gw metric 0) was blocking connections.

But now I see that when the cable gateway is blocking connections that web requests can still reach the web server from the fallback cellular gateway (default gw metric 1). I thought the problem was due to IPv6 but I have disabled that now and still see the occasional connection.

I can see the connections happening right now but my phone cannot access the site because the cable gateway has it blocked. Yet hackers/bots do not have the same problem.

I guess my first question is how are the hackers/bots able to access the server through the fallback connection when my phone can not?

My second questions is one about the metrics. My earlier testing showed that if gateway metric 0 was up but blocking connections then there were no connections. Now gateway metric 0 is up and blocking connections but there are connections being made. Shouldn't gateway metric 0 be used at all times for incoming and outgoing connections?

I wanted to mention that my multiwan script tests connections and boots out routes that are no good with a simple "route del default gw". This removes the gateway with metric 0 and uses the gateway with metric 1 and so on as I have even more gateways but they are CGNAT only so they are not responsible for the incoming connections.
 
Old 11-03-2022, 07:04 PM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
If you have multiple gateways, the network should automatically use the first gateway it finds with an open path, and the lowest metric.

Thus, if you have 2 default routes, one with metric 100 and one with metric 600, the one with metric 100 will be tried. If that fails then the next lowest metric (600) will be tried and if open will be used.

Note that metrics for your routes apply to connections originating on the local machine/network, not to those originating from outside and coming in. Your routes have no affect on incoming connections, only to the replies to those connections or new connections you originate.
 
1 members found this post helpful.
Old 11-03-2022, 11:07 PM   #3
Jason_25
Member
 
Registered: Nov 2001
Posts: 180

Original Poster
Rep: Reputation: 23
So i have a better understanding of this now than before but not perfect. As you say the packets are coming in but probably not going out. This is obviously enough to trip my monitoring systems though. It is also bad practice to let the bad people even get that far.

The connectivity problem was due to using the round robin hostname instead of the cellular gateway IP address. When the cellular gateway IP address is used a connection attempt is logged by 2 of my detection systems. The phone and mobile internet device actually behave the same way in this regard.

Possible attackers do not seem to make it very far. I noticed that the Apache log has no recent entries because there is no outbound connection made so no packets are exchanged and nothing can be logged I suppose.

The details of exactly what is happening here are still pretty hazy to me. But it is clear it is time to time to selectively firewall the cellular gateway based on network status. I was going to do this at first but thought I did not need it but now I have decided I do. Just some scripting will be needed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2.4 requests to non-SSL site with "Upgrade-Insecure-Requests: 1" and no trailing / get redirected to default site owendelong Linux - Server 2 06-22-2021 02:08 PM
two LAN connections to same server or interface metric ... how to sorcerer25 Linux - Networking 3 07-06-2011 01:46 AM
Simple way to use backup gateway (metric?) mangueJOE Linux - Networking 3 08-31-2009 05:02 PM
changing default metric in ripd/quagga geden Linux - Networking 0 11-19-2007 03:10 PM
FreeS/Wan Vs. OpenS/Wan Vs. StrongS/Wan bkankur Linux - Security 1 03-01-2005 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration