Two internet connections to one server

1

I have one server running on Ubuntu 14.04. It is used to host a web application.

I also have two routers from two different internet providers with two different static IP addresses. I want to allow traffic through both internet providers to access the same web application.

Each Internet Provider has limited upload bandwidth. When several users log to the system, clients complain slowness. So I want to increase the upload bandwidth. Say one ISP is SLT and other is DT. I though of giving my SLT provided static IP to those who use SLT connections and provide DT static IP to those who use DT connections.

It that ever possible ?

(I currently have one ethernet port and one wifi port in the server, but I can install an additional ethernet network card if necessary.)

Niluka Gunasekara

Posted 2014-11-20T14:30:21.253

Reputation: 11

What precisely are you trying to achive? Load balancing or redundant links? – Journeyman Geek – 2014-11-20T14:43:25.677

Each Internet Provider has limited upload bandwidth. When several users log to the system, clients complain slowness. So I want to increase the upload bandwidth. – Niluka Gunasekara – 2014-11-20T14:46:15.390

You want to add that to your question – Journeyman Geek – 2014-11-20T14:46:54.343

added details to answer. – Niluka Gunasekara – 2014-11-20T14:49:28.447

I understand the aim, however most important thing is that to make this transparent for the clients you have to implement load balancing. That is if you want for all of them to use single domain name. Domain will be resolved to load balancer addres and it will direct traffic to one of the IP addresses that the server is reachable at. If you do not have to use single domain, create two of them and assign each IP address to different domain and gave your clients. – mnmnc – 2014-11-20T14:53:49.327

There is no need to give one IP address. I have two static IPs, the issue is to know how to direct both IP address to one server. – Niluka Gunasekara – 2014-11-20T14:56:36.493

1If you have 2 IP address, 2 routers and one server behind those routers, make a simple port forwarding on them. I don't get what is the problem tbh... Server needs to have 2 local IP addreses so 2 NICs are required. You can have virtual IPs/NICs on Linux but that does not resolve the problem of 2 wired/wireless connections. So 2 IPs + 2 NICs + 2 port forwardings. – mnmnc – 2014-11-20T15:08:03.390

Answers

0

You want to add a second Ethernet card if you can. Configure both. Then in the DNS for your website, create two A records for the domain name.

mycomain.com  A 111.111.111.111
mydomain.com  A 222.222.222.222

When you do a dns lookup it should list both IP addresses.

nslookup mydomain.com
111.111.111.111
222.222.222.222

This should provide rudimentary load balancing. The server should send outgoing packets out the same interface they were received on.

However, if you choose to use only one card, and put two IP on that card, then Linux will send outgoing packets on the primary interface only. Which is not what you want.

AngelaS

Posted 2014-11-20T14:30:21.253

Reputation: 143

DNS part and load balancing is not the issue. when I configure wifi card and the Ethernet card an Ubuntu, it is not possible to access the server from both connections at once. – Niluka Gunasekara – 2014-11-20T15:01:46.757

Hi, then maybe you could explain your situation better. – AngelaS – 2014-11-21T01:29:37.800

Now we have move to cloud servers and this issue does not exists. Thank you for your help. – Niluka Gunasekara – 2019-10-01T07:24:44.937