# How can I use two ISP providers in one LAN?



## chrtech (Sep 4, 2009)

We have engaged two Internet Service Providers in our office. We have a Local Area Network installed. At first we only have one ISP. Our network consist of the following: a Modem (provided by the ISP) connected to a router (linksys wireless n), the router is connected to 3com switch. We have a DHCP server running on linux and is attached to the switch. The router served as our gateway to the internet. Now that we have another ISP we wanted to integrate it into our LAN so that the computers can be distributed among the two ISPs. We have more than 30 computers in our office. Please help us on how we can accomplish this.

Thanks a lot!

Have a great day!


----------



## Suncoast (Jul 28, 2009)

Welcome to TSF. This isn't as easy a question as you may think. Please feel free to ask questions, especially if you don't understand something. 

Ok, a few important questions. 

Can the second ISP link be a backup link, called fail-over? This is the least expensive, but also the least efficient option.

Can you split your network into two separate networks? Or do these computers all really need to talk to each other. 2nd least expensive option, and most efficient.

Or do you need both connections to be active at the same time, and transparently available to all users, called Multi-ISP peering? Prohibitively expensive for small business. 

If money is no object, you do this by setting up a commercial grade router that supports BGP peering. But this isn't something normally done with a small business. And it would require professional help, likely available from one of your ISP's.


----------



## Suncoast (Jul 28, 2009)

I just noticed your OS list. This really expands your options. Have a look at this site  Here and Here.  You also might want to search this site Here as well.


----------



## chrtech (Sep 4, 2009)

Thanks for the reply!

We have defined a domain in our network. All our computers log in and can talk to each other. The Server being our domain server also served as our DHCP server. 

We plan to use the two ISPs at the same time looking also at the idea of load balancing. We are looking for an appliance that can detect when one of the ISP is down so that it can automatically re-route connection to the other ISP. This should be both ways meaning incoming as well as outgoing connections. 

We have applications running in our office that are accessed by our regional offices so we need two ISP to ensure continuity of connection. 

What we have done is to install two routers and separated the network in to two - 192.168.1.10 (first router with DHCP off) range 192.168.1.11 - 150 and 192.168.1.2 (second router with DHCP on) range 192.168.1.151 - 250. Computers under the first range have their IP Address defined statically on each computer. Computers under the second range gets their IP Address dynamically thru DHCP. The firs ISP is connected to the first router and the second ISP is connected to the second router. The routers are connected to each other via cable thru one of its ports. This connection seems to work for we can use the two ISPs simultaneously. But we don't know yet how to manage it when one of the ISP is down. Can you enlighten us on this one?

Thanks for the links you gave us. We are going thru it right now.

Have a great day!


----------



## Suncoast (Jul 28, 2009)

Ok, you are clearly ahead of the game already. I've always wanted to try a setup like this. 

Failover is the term for using either a backup ISP or a backup connection to the same ISP. Failover connections to the same ISP are typically much lower speed. If the primary connection fails, everything switches to the backup connection until the Primary returns to service. This is an either WAN A OR WAN B scenario. 

Basically, Load Balancing is when you have multiple connections to the same ISP, and the traffic is balanced over the links. If one link goes down, everything continues on the remaining links. 

That last link I gave you should provide some ideas for a Linux solution. With some advanced weighted iptables routing, you should be able to automatically use the other connection when the primary route fails. This would likely be accomplished by looking at the source IP address and routing it to a particular gateway. If that route fails, it would then route to the higher cost (for that IP) second gateway. My knowledge of iptables is weak, so I can only speak in general terms here. 

The only other suggestion I can make will only help with one of your ISP connections, and that is to change the default gateway in DHCP when that connection goes down, then do a ipconfig /renew on the workstations.


----------



## theapplebee (Oct 31, 2009)

chrtech said:


> Thanks for the reply!
> 
> We have defined a domain in our network. All our computers log in and can talk to each other. The Server being our domain server also served as our DHCP server.
> 
> ...


I think you got right direction to setup your network.
However, current setup won't provide load-balancing (50/50). 
Also, if you are using static NAT, it will give you extra work once one of link goes down.

Most normal setup would be router with BGP + DHCP. It will provide auto failed over and traffic-shaping. (only outbound).

Sharing Cisco Expertise : CiscoNET.com


----------



## johnwill (Sep 26, 2002)

I'd use a dual-WAN router, there are many reasonably priced models to choose from. Of course, the expensive spread is Cisco, but they're not the only game in town. :smile:


----------



## Wrench97 (May 10, 2008)

Cisco Dual Wan is'n that bad > http://www.amazon.com/gp/product/B0..._m=ATVPDKIKX0DER&pf_rd_r=1ZQ7K2CK1DGDPS8607XS


----------



## johnwill (Sep 26, 2002)

Seems like a price you could live with. :smile:


----------



## Suncoast (Jul 28, 2009)

johnwill said:


> I'd use a dual-WAN router, there are many reasonably priced models to choose from. Of course, the expensive spread is Cisco, but they're not the only game in town. :smile:


What the OP was essentially asking is; How can I multi-home while concurrently using both WANs without using BGP? Currently, there is no device that does this, because the industry solution is indeed BGP. So a "Brew your own" Linux solution is the only other way I know to accomplish this.


----------

