Two gateways and one server

Two gateways and one server

Post by <k.. » Wed, 12 Mar 2003 02:59:31



Hi all,

I am running a linux box (IP a.b.c.76) attached to a local subnet at my
university a.b.c.xxx with gateway a.b.c.1 . This is working fine. To
enhance download speed I have also an DSL router attached. It is also
hooked up one the network a.b.c.xxx and has IP a.b.c.88. I have set up
routing to use this DSL router as the default gateway. So far so good.

The trouble starts when I want to connect to my computer from outside, say
with a HTTP or ssh request. The request gets routed via a.b.c.1 into my
computer a.b.c.76 but the answer packets are sent out via the default
gateway a.b.c.88, namely the DSL router, and get lost.

So how do I convince the linux kernel to send the answer via a.b.c.1 ?

Any takers?

Cheers

Kai

 
 
 

Two gateways and one server

Post by jack » Wed, 12 Mar 2003 18:50:07



> I am running a linux box (IP a.b.c.76) attached to a local subnet at my
> university a.b.c.xxx with gateway a.b.c.1 . This is working fine. To
> enhance download speed I have also an DSL router attached. It is also
> hooked up one the network a.b.c.xxx and has IP a.b.c.88. I have set up
> routing to use this DSL router as the default gateway. So far so good.

I will assume that these IPs are valid public static IPs, and that the
uni gw has a permanent connection to the net. - Now, how does the DSL
router connect to the internet. Is it via Your local ISP? - I think so.

Quote:> The trouble starts when I want to connect to my computer from outside, say
> with a HTTP or ssh request. The request gets routed via a.b.c.1 into my
> computer a.b.c.76 but the answer packets are sent out via the default
> gateway a.b.c.88, namely the DSL router, and get lost.

> So how do I convince the linux kernel to send the answer via a.b.c.1 ?

You needn't do that. - You have to ensure that the sender address of
the reply packet is that of Your .76 box. Most DSL routers that connect
to an ISP (that will probably assign dynamic IP addresses) do some
NATting on those packets; in this case, SNAT to that dynamically
assigned IP from the ISPs address range. Just make sure that this does
not take place. Apart from that, You needn't worry about how the packets
will be routed between Your .76 box and the outside world.

One note on Your setup design...: Perhaps You want to think over that
as a whole...?

Cheers, Jack. Greetings go to Hannover, City of CeBIT in March, 2003.

--
----------------------------------------------------------------------
My personal reading of the string "MicroSoft" expands to "NanoWeak"...

 
 
 

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. X386[,mono] problem

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

4. 3Com's Palm Pilot Linux interface?

5. two ip address / two gateways / one computer?

6. Integers in SH

7. How to share one IP address with two servers (application server and web server)?

8. Printer/Parallel port configuration problems

9. One DHCP server - two interfaces - two subnets

10. One server, one IP addr, two ports, different sites?

11. two public ips from two networks on one server

12. Two different PCI graphics cards - one X server, one large desktop: Possible?

13. Two Network Cards in one Linux server using VPN on one