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

Here's my situation:

On my network, most of the clients are on an outside router.

Router 1
   | - Client
Router 2 to router 1,
   | to clients within
Samba server -

I cannot figure out how to get clients under router 1 to access the Samba shares in router 2. I have forwarded ports 139 and 445 to the appropriate machine in router 2 but machines in router 1 still cannot access the server.

How would I set this up?

share|improve this question
Is router 2 doing NAT/PAT? – Zoredache Nov 19 '10 at 2:21

Router2 doesn't need to do port forwarding, it needs to do routing.

If client has address say and default gateway then all you need to do is set a static route on router 1 that directs traffic for 192.168.2/24 to Router 2 (

When client sends traffic to router1 for the file-server, Router1 will reply with an ICMP redirect and the clients will thus learn of the appropriate router for the address of the file server.

It is far better to have the routers manage routing than to set static routes on clients.

Port forwarding is the wrong tool for this job. Port forwarding is mainly useful when an external client is attempting to access resources in an unrouteable LAN. Within one organisation's use of 192.168 block of private addresses, all subnets are routeable. Of course it is possible to mess up address allocation to subnets but port forwarding is not the answer to that either.

share|improve this answer

your clients have to be configured to use as the gateway for all packets going to Given that their default route is, then:


route add -net gw


route add mask metric 2

Cisco router:

conf t
ip route


share|improve this answer

Your Answer


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