Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is my situation:

Router A: IP Mask - Connected to the internet.

Server: - Interface eth0: inet addr: Mask: (connected to router B) - Interface ra0: inet addr: Mask: (connected to router A)

Router B: IP Mask - Connected to Server's eth0

Computer: connected to Router B via WiFi connection.

I configured a static route on Router B that use as default gateway and i can ping that ip from computer.

The problem is: how i can connect to the internet ? In other words, traffic coming from Server eth0 should use ra0 as gateway.

Any suggestion ?

Thank you

share|improve this question

migrated from Dec 24 '09 at 15:18

This question came from our site for professional and enthusiast programmers.

If R-A is a consumer broadband router, it likely has a switch on the back .. any reason you don't connect R-B directly to R-A? – tomjedrz Dec 24 '09 at 16:59

You need to set up ip forwarding on your server. I recommend shorewall, but any of those tools would work. Or manually.

manual: shorewall:

You didn't specify your distro, so I'm assuming debian-y. Googleing "enable ip forwarding" and your distro would help.

And you'll want to change your router B to use as the default gateway. Your server would have as its default gateway and would know to forward traffic from your router B through to router A.

share|improve this answer

Why is the server dual homed? Why not connect it like this?

 |ARTR |
 |BRTR | LP---Server

          PC – WIFI to BRTR

 WP = WAN Port
 LP = LAN Port
share|improve this answer

do you have a route in the A router that is pointing traffic bound for the network to ? I suspect that what is happening is that the return traffic does not know how to get back to the B router.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.