LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-06-2018, 02:07 AM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
two providers, one LAN, one computer


i have two internet providers that have been connected separately to the two modems (ethernet handoff). but i want to connect them together on one LAN. their gateway addresses (the address i route 0.0.0.0/0 to) and NAT addresses (private IPs my computers use) are different, so i think this is possible. both of them serve DHCP but if i set the computers up to not use DHCP (pre-configure the private IPs) i think the DHCP problems can be avoided. then i could also pre-configure the route table default gateway to which provider is selected for that computer.

now here is the hard part. i'd like to have one computer (running Ubuntu 16.04.3 with Linux kernel 4.4 use both providers at the same time with one connection going out via one provider and another connection to a different address on the internet going out via the other provider. there is only one network interface, but a 2nd one can be added if that would help. but there will only be a single LAN (three gigabit switches).

what setup can make this work on Linux? FYI, this is NOT bonding.
 
Old 01-06-2018, 07:46 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,579

Rep: Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685
Hmmm... Interesting. I would solve that problem for a home network with a second (possibly virtual) interface and simple static routing. For a business I would use an Astaro Security Gateway from SOPHOS and set up multi-upstream rules. (ASG is the the easy and powerful way, but more expensive.)

The first question that comes to mind is "why have two ISPs for one home?", and the next is "what is the advantage in this, what are you really trying to achieve?"!
 
Old 01-06-2018, 10:55 AM   #3
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Before anyone can give you a viable response it would be nice to know what it is you are trying to accomplish with this setup as has already been stated.
 
Old 01-06-2018, 09:12 PM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
i work entirely at home. i got the 2nd ISP in order to get more capacity to do some heavy network stuff like backups. it was running on a separate machine, so i could easily do it by dedicating that machine to the 2nd ISP. then the usage of the 1st ISP would not be bogged down. last week there was a 2 day outage of the 2nd ISP and i spent a lot of time and trouble making that machine use the 1st ISP, again, then go back to the 2nd ISP. that led me to think that it could have been the 1st ISP to go out, which would have been even harder to deal with. so that gave me the 2nd reason to have 2 ISPs (the possibility of an outage with just one ISP), the reason to keep the 2nd ISP, despite the fact that has some outage history.

the separate machine is doing backups (and a couple other things) and sends them to a couple offsite locations. it communicates with the other machines with a 2nd LAN (it gets to the 2nd ISP on the 2nd LAN), and i want to back down to just having one LAN and just one network interface on each machine. the Sun boxes only have one network interface so i had to set up some relays for them to be backed up.

for now the goal is to use a few specific sites via the 2nd ISP and everything else via the 1st ISP and do it all over a single LAN with just one network interface in each machine. everything runs Linux, OpenBSD, or Solaris. whatever is worked out on Linux i will try to replicate on the others. then i want to explore virtual-bonding of these 2 ISPs to combine the bandwidth and have quick takeover if one of them goes out. i am thinking of adding a 3rd ISP if that works. but i want to get the non-bonding one LAN and two ISPs basic setup working, first.

Last edited by Skaperen; 01-06-2018 at 09:19 PM.
 
Old 01-07-2018, 09:16 AM   #5
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
OK, you could setup your routing on each host to allow for multiple gateways. To do this you are going to have to set the metric of each link on your hosts.

You are fist going to have to know your gateways for both ISP's. Lets say they are as follows:
  • ISP #1: 1.1.1.1
  • ISP #2: 2.2.2.2

On your backup system you need to add a route with a lower cost than what is already there. If when you do a route -n and the metric is 0 then you are going to have to delete that GW and create a new one.

BACKUP MACHINE:
How you setup your routing with the original metric set to 0;
Code:
route del -net default gw <ISP#1 GW> netmask <ISP MASK> dev <YOUR NIC> metric 0
route add -net default gw <ISP#2 GW> netmask <ISP MASK> dev <YOUR NIC> metric 0
route add -net default gw <ISP#1 GW> netmask <ISP MASK> dev <YOUR NIC> metric 10
Then run your route again to see if both routes are in the table. You should see something like this;
Code:
~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         <ISP #2 IP>     0.0.0.0         UG    0      0        0 <YOUR INTERFACE>
0.0.0.0         <ISP #1 IP>     0.0.0.0         UG    10     0        0 <YOUR INTERFACE>
<YOUR NETWORK>  0.0.0.0         255.255.255.0   U     0      0        0 <YOUR INTERFACE>
HOSTS TO USE ISP #1:
Code:
route add -net default gw <ISP#2 GW> netmask <ISP MASK> dev <YOUR NIC> metric 100
This will get your routing setup for you. The only issue is you do not run any sort of dynamic routing protocol between you and your ISP's so your network connection migh not go off line when the ISP isn't working. You will have to disconnect the cable from the ISP that is having the outage in order for your systems to fail over to the other ISP.
 
Old 01-07-2018, 11:06 PM   #6
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
the irony. soon after my last post i discovered ISP 2 went down while i was typing, then about an hour later ISP 1 went down. both remained down all night. we do have a 3rd ISP available, plus 2 phone networks served through about a dozen phone service resellers. i could get a smartphone and run that app that makes it into an access point for the final fallback reserved for limited usage.
 
Old 01-07-2018, 11:14 PM   #7
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
so i should have no trouble by hard coding which ISP each machine uses while all on one LAN. ARP will find both gateways because they are different IPs and different MACs. i don't think i will use the metric 10 except on my desktop. i just need to disable or ignore or override DHCP?
 
Old 01-08-2018, 05:13 AM   #8
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,579

Rep: Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685
Quote:
Originally Posted by Skaperen View Post
so i should have no trouble by hard coding which ISP each machine uses while all on one LAN. ARP will find both gateways because they are different IPs and different MACs. i don't think i will use the metric 10 except on my desktop. i just need to disable or ignore or override DHCP?
I would configure them so that only ONE provided DHCP, but so that all could serve the same subnet. Then the traffic will be routed depending upon your gateway and route settings.
 
Old 01-08-2018, 05:17 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,965

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
I'd be tempted to run a VM of some load balancing on Ubunutu. Generally when one wants to use two isp's they have to figure out how to split the use. They can select IP's to use or even programs/transport. In some advanced load balancing you might be able to switch over based on loading values. Not sure it would be easy in ubuntu.
 
Old 01-08-2018, 09:35 PM   #10
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
unfortunately, i don't have access to disable DHCP on either ISP router. but at least they work with hard coded IPs in their respective /24. so i will need to have every machine not ask for DHCP or override after init is done. it looks it this will be easy on Ubuntu and Solaris.
 
Old 01-08-2018, 09:39 PM   #11
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
i do plan to try out some load balancing next. i have an idea that does not involve a VM at all. what is your VM based idea? can it be done w/o a remote server?
 
Old 01-08-2018, 09:46 PM   #12
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,965

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
There are a number of linux and bsd distro's that offer out of the box support. Some commercial products too. You'd install some sort of vm locally.

You'd still need to know how you want to balance. You can't just say connect two and be done with it. You have to select the way you want to share this resource.
 
Old 01-09-2018, 09:51 PM   #13
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,681

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
i would probably go with round-robin balanced to about the relative bandwidths of the 2 ISPS. so far, every solution i have seen requires a server somewhere out there on the internet. a couple commercial ones put everyone on a server (selected out of many) that has other users. so it can look like there is no server because the pricing is all bundled together. using a VM is no big issue, but the idea i have does not use one.
 
Old 01-09-2018, 09:58 PM   #14
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,965

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
Usually these distros are made to be perimeter sort of machines. You don't need a vm just that it is simple to test and run.

https://www.untangle.com/shop/WAN-Balancer/ thinking something like this.


Or maybe this. https://doc.pfsense.org/index.php/Multi-WAN

Last edited by jefro; 01-09-2018 at 10:00 PM.
 
Old 01-10-2018, 06:42 AM   #15
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,579

Rep: Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685
Using two ISP upstreams is not something home users normally do, it is something that businesses with a need for high availability do. A business can justify the expense of a perimeter device (firewall) that can balance and failover using two or more upstream paths. That is an advanced technique that even Cisco has never gotten right.

I have done it with home-grown devices, but the elegant way us using a machine MADE for that purpose. The best I have used is the Astaro Security Gateway from SOPHOS. This is NOT a cheap device, and there is an annual license update fee to keep modules active and updates current. I cannot recommend it for home use, the cost is simply not justified.

My solution, were I in need, would be to build a special machine to connect to your two ISP devices and serve DHCP to your internal network, and manage that upstream to balance routing intelligently and failover to a single upstream if the other failed. Only you can determine if your need justifies that level of investment in time and equipment.

PS. if you have a little hardware laying around, you might look at ZeroShell firewall distro. https://distrowatch.com/zeroshell

Last edited by wpeckham; 01-10-2018 at 09:59 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
loading of providers from file: http://download.kde.org/ocs/providers.xml failed Limited5ive Slackware 3 03-10-2018 10:14 PM
how to find ip address of other computer in LAN network from my own Computer sanjay786 Linux - Networking 4 08-27-2011 12:48 AM
one computer affects DHCP for other computer on same LAN? discomurder Linux - Networking 1 12-12-2006 03:15 AM
Beginner LAN - computer name instead of IP LancerNZ Linux - Networking 6 02-28-2005 10:04 PM
Wake up computer on LAN Linh Linux - Networking 2 06-15-2003 05:33 PM

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

All times are GMT -5. The time now is 01:15 PM.

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