What's new

port forwarding with snat

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

caos

New Around Here
Hello,

I have a setup, where two routers are connected at LAN-side. Router A is the main router with internet on wan side (N66U with merlin wrt).
(private IP 192.168.2.1, lets call the lan side subnet A).

Router B is a dd wrt router in client mode with a static ip in the same subnet as the main router on lan side (IP 192.168.2.2). Its WLAN is on wan side and lets connect me to another subnet (192.168.200.x, lets call it subnet B).

Router A has a static route to 192.168.200.x via router B, so that i can connect to machines in both subnets from within 192.168.2.x.

My problem is to reach a client on subnet B from the internet. If I set up a port forward to a client in subnet B, the secod router drop the packets because the source address is not in subnet range.

So i have to "snat" the incoming traffic from wan for a specific port forward.

In the past i had a dd-wrt main router and setted up a port forward in the web gui and added the following iptables rule as a firewall script:

iptables -t nat -I POSTROUTING -d 192.168.200.50 -j SNAT --to-source 192.168.2.1

This worked. But now, with a new main router (n66u) and merlin wrt the same setup does not work.

can anybody help me?
Thank You.
 
Last edited:

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top