two ip addresses / two gateways / one machine?

two ip addresses / two gateways / one machine?

Post by Adam K Kirchhof » Wed, 27 Jan 1999 04:00:00



    Can someone please help me out.  I have a linux box at work with one
network card.  The computer resides on two networks, the internal
network for the business (at 10.200.3.18) and the Internet (at
209.107.24.146).  I have no problem getting the computer to connect to
either network individually through their respective gateways (at
10.200.3.1 and 209.107.3.129), but I'd like to be able to configure eth0
to claim both IP addresses at the same time (I've been able to set up
IP-aliasing without any problems) and use both gateways at the same
time, chooing the appropriate one to connect to either network.
    It's setting up route to use both gateways that I've been unable to
do, yet.  Is there someway to do this?  I've been throught the manpages,
the how-tos, and have even visited the LDP, but I haven't found what I'm
looking for.
    This is what I've got so far:

ifconfig lo 127.0.0.1
ifconfig eth0 up
ifconfig eth0 209.107.24.146
ifconfig eth0:0 10.200.3.18
route add -net 127.0.0.0
route add -net 209.107.24.128 dev eth0
route add -host 209.107.24.146 dev eth0
route add default gw 209.107.24.129

No problems so far...  My computer sees the Internet with no problems.
Now how do I go about setting it up so it can see the internal network?
I've tried:

route add -net 10.200.3.0 dev eth0:0 but I get the error "SIOCADDRT:
Invalid argument"

Anyway, I'm stumped.  Any help would be apprecated.

Adam K

 
 
 

two ip addresses / two gateways / one machine?

Post by Jeffrey S. Klin » Wed, 27 Jan 1999 04:00:00


Routing Luke.... Use the Routing....

Your routing table, if it yet even exists, is what bridges what goes to what
segment.

Routing Luke.... Use the Routing....
(grin)
Cheers
Jeff


>     Can someone please help me out.  I have a linux box at work with one
> network card.  The computer resides on two networks, the internal
> network for the business (at 10.200.3.18) and the Internet (at
> 209.107.24.146).  I have no problem getting the computer to connect to
> either network individually through their respective gateways (at
> 10.200.3.1 and 209.107.3.129), but I'd like to be able to configure eth0
> to claim both IP addresses at the same time (I've been able to set up
> IP-aliasing without any problems) and use both gateways at the same
> time, chooing the appropriate one to connect to either network.
>     It's setting up route to use both gateways that I've been unable to
> do, yet.  Is there someway to do this?  I've been throught the manpages,
> the how-tos, and have even visited the LDP, but I haven't found what I'm
> looking for.
>     This is what I've got so far:

> ifconfig lo 127.0.0.1
> ifconfig eth0 up
> ifconfig eth0 209.107.24.146
> ifconfig eth0:0 10.200.3.18
> route add -net 127.0.0.0
> route add -net 209.107.24.128 dev eth0
> route add -host 209.107.24.146 dev eth0
> route add default gw 209.107.24.129

> No problems so far...  My computer sees the Internet with no problems.
> Now how do I go about setting it up so it can see the internal network?
> I've tried:

> route add -net 10.200.3.0 dev eth0:0 but I get the error "SIOCADDRT:
> Invalid argument"

> Anyway, I'm stumped.  Any help would be apprecated.

> Adam K



 
 
 

two ip addresses / two gateways / one machine?

Post by m.. » Thu, 28 Jan 1999 04:00:00



: route add -net 10.200.3.0 dev eth0:0 but I get the error "SIOCADDRT:
: Invalid argument"

  Loose the :0 in that route line. eth0:0 is a alias, not a device.
Might even wanna add a netmask parameter to it.