Connecting two networks with two linux boxes.

Connecting two networks with two linux boxes.

Post by Markv » Fri, 25 Aug 2006 23:36:22



I have 2 networks each with a linux box as the gateway to the internet.

At the moment they are VPN'd together, but are close enough to get a
cable run and I'd like to connct them like this to make it quicker
so each linux box will have 3 nics in it.

My question is possibly a dumb one! But what should the IP for the 3rd
nic in each box be?

The networks are:
        network         -       linux box internal address
Box 1) 10.0.12.x/24     -       10.0.12.1
Box 2) 192.168.12.x/24 -        192.168.12.1

Should the 3rd NIC in the box 1 be on the 192.168.12.x range, and vice
versa but wouldn't that confuse the other network as it would think that
it is a local IP  when it wouldn't be.

Should they both be on a different range althogether? And then set the
routing up on each.

ie 3 NICS in each
Box1
internal 10.0.12.1
public 123.456.78.2
"intranet" 10.0.13.1

Box2
internal 192.168.12.1
public 423.243.123.32
"intranet" 10.0.13.2

If it was 2 networks with one linux box it would be easy, just not sure
how you'd connect the two boxes together....

Any advice appreciated!

Cheers

Mark

 
 
 

Connecting two networks with two linux boxes.

Post by Allen McIntos » Sat, 26 Aug 2006 00:30:31



> I have 2 networks each with a linux box as the gateway to the internet.

> At the moment they are VPN'd together, but are close enough to get a
> cable run and I'd like to connct them like this to make it quicker
> so each linux box will have 3 nics in it.

> My question is possibly a dumb one! But what should the IP for the 3rd
> nic in each box be?

> Should they both be on a different range althogether? And then set the
> routing up on each.

That should work.

 
 
 

Connecting two networks with two linux boxes.

Post by Jeroen Geilma » Sat, 26 Aug 2006 03:09:40



> I have 2 networks each with a linux box as the gateway to the internet.

> At the moment they are VPN'd together, but are close enough to get a
> cable run and I'd like to connct them like this to make it quicker
> so each linux box will have 3 nics in it.

> My question is possibly a dumb one! But what should the IP for the 3rd
> nic in each box be?

On a separate subnet from the other two interfaces.
All you have to do to make routing work is, on each box, add a static
route to the original internal network on the *other* box, with the IP
of the other boxes' 3rd interface as the gateway for that static route.

Box 1:
$INTERNAL1, $NEW_IF1 = 10.0.0.1 (or whatever)

Box 2:
$INTERNAL2, $NEW_IF2 = 10.0.0.2

On Box 1:
route add net $INTERNAL2 gw $NEW_IF2

On Box 2:
route add net $INTERNAL1 gw $NEW_IF1

Done.

Quote:> If it was 2 networks with one linux box it would be easy, just not sure
> how you'd connect the two boxes together....

Exactly as if there was no Internet - whether you have 3 interfaces or
28, it's all the same.

J