two ip address / two gateways / one computer?

two ip address / two gateways / one computer?

Post by L J Bay » Thu, 28 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.

I'm thinking subnet masks. What are they? For your 209 net it
probably is 255.255.255.0, which is default, but for your 10
net the default of 255.0.0.0 is probably wrong. Try specifying
the subnet mask when you ifconfig eth0:0 - maybe it will help.
 
 
 

1. two ip addresses / two gateways / one machine?

    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

2. module problem - ip_nat_ftp

3. Two IP's over one NIC and two gateways

4. broadcast address messed up

5. One Process on the machine having two IP address and two ethernet interface.

6. stat.h

7. Two computers one IP-address

8. Unix-socket-faq for network programming

9. HELP: Two computers and one dynamic IP address.

10. two network cards, two(?) networks, one computer...

11. Two computers, Two ISP accounts, one 10Base-2 localnet?

12. Two OS, two hard drives, one computer

13. two ip addresses one fixed and one static