# 2 nics 2 modems 2 lines

## pewbert

I have 2 network interface cards each connected to a different dsl modem which are on two different adsl lines from the same ISP.

/etc/conf.d/net:

```
dns_domain_lo="thetmnt.com"

config_eth0=( "74.37.31.102 netmask 255.255.248.0" ) 

routes_eth0=( "default via 74.37.24.1" )

config_eth1=( "192.168.254.2 netmask 255.255.255.0" )

routes_eth1=( "default via 192.168.254.254" )

dns_servers=( "170.215.126.3" "170.215.184.3" "192.168.254.254" "74.37.24.1")

```

/etc/hosts (if this matters, im not sure)

```

127.0.0.1       turtlebox.thetmnt.com turtlebox localhost

::1             localhost

192.168.254.2 turtlebox.thetmnt.com turtlebox #eth1

74.37.31.102 turtlebox.thetmnt.com turtlebox #eth0

```

How do I utilize both modems at the same time?

i've tried pinging google.com from each interface using

```
ping -I 192.168.254.2 google.com
```

and

```
ping -I 74.37.31.102 google.com
```

if eth0 is stopped with 

```
/etc/init.d/net.eth0 stop
```

then the ping from eth1 works and the other way around, but i can't get them to ping 2 places at the same time.

----------

## Simba7

You can't really bond 2 connections from 2 seperate ISP's. Your best bet is to load balance between the two.

Who is your ISP(s)?

Plus, your HOST file is hosed.. I would suggest:

 *pewbert wrote:*   

> /etc/hosts (if this matters, im not sure)
> 
> ```
> 
> 127.0.0.1       turtlebox.thetmnt.com turtlebox localhost
> ...

 

Or something like that..

----------

## pewbert

it's the same isp..worst isp on the planet.. frontiernet.net

----------

## Simba7

Well, you *might* ask them of they can bond the 2 connections on their end. I really doubt it since they usually want you to get a more expensive line than bond multiple ones together.

It's worth a try. I know you can bond multiple lines into one in Linux, but you need cooperation from your ISP.

Heck, I wouldn't mind bonding 2 cable modem connections (15mbps/1mbps each) and 2 DSL connections (7mbps/896kbps each), but I know the cable and DSL company would throw a fit, not to mention try to get me to buy a T3 line. My best bet would be to load balance between all 4 of the connections.

----------

## pewbert

is there any way to use them, independently of eachother, at the same time?

azureus allows someone to "Bind" azureus to a local interface..i've tried this with no luck.

----------

## MorpheuS.Ibis

if this PC is a router you could use both lines for different sources/dests, but using dynamic routing (with load balancing) should do the trick for you, the only down side is the configuration

----------

## darkgentoo

Well you might try this one if you really want to have a cool loadbalancing (using it myself, and yes, it does work ; )

You can bond lines together as long as the remote site supports it. If your ISP does not want to do this, you might use a rootserver:

  * Run OpenVPN Server on the rootserver.

  * Connect two clients in tap mode, one via each DSL line.

  * Configure the openvpn server so it plays router / masquerading for your openvpn clients.

  * bond the tap devices together 

Well so much in short ; )

Benefits:

  * Your connection will (almost) never go down again. If one line fails your connections will stay active, since both lines have a single IP to the outside world even TCP sessions stay alive. An SSH session from internal network to some other server can even survive downtime of both lines simultaneously (!) for about 5 minutes (perhaps more, not tested yet)

  * You appear in web server's logs as "your-domain-name.com" or something like that, instead of XXX.dsl1...frontiernet.net

Downside:

  * No way suitable for online gaming. Your pings will always be at (processing time client)+(ping latency to rootserver)+(processing time server)+(ping latency to destination)

  * Read your ISP contract if they forbid tunneling all your internet traffic through an encrypted VPN tunnel.

If you are interested I can send you a few tips.

----------

## rek2

I will be interested to know how did you end up doing all this? I am about to setup something similar at my office with two DSL lines..

----------

## rek2

hmm I am having problems with my second DSL line..  

dsl1 is working just fine on bridge mode to my linux router I can ping and if I put it as default to test it I can get anywhere on the internet.

dsl2 was working fine on bridge routing mode but when I changed to bridge to add it to my linux router stop working.. I call verizon support and

they scalated the problem.. but.. it was working before.. I have not big hopes on them fixing it.

so after I get this two lines working on different ethX interfaces how can I load balance them?

I saw howtos around but they are not briding to the linux box.. they using the internal IP's from the dsl routers, I dont want this because a couple

external/internal connection issues I am going to use openvpn etc at some point.

----------

