http-redirectiprouterdd-wrt

Route external IP address to internal IP NO DNS


I have an address 69.39.239.211 (external) I want to route/redirect to 192.168.0.22 (internal) to do some debug testing. I have a dd-wrt router so I can change the iptables as needed, I am just unsure of the syntax. Everything I've looked at is trying to do this through DNS but since it is an address, dns is never involved.

So far

iptables -t nat -A PREROUTING -i br0 -d 69.39.239.211 -j DNAT --to 192.168.0.1

will traceroute correctly but nmap won't see any open ports.


Solution

  • Here's the answer for anyone seeking to do that same thing. What was missing was the second line. I also added the local subnet.

    iptables -t nat -A PREROUTING -i br0 -s 192.168.0.0/24 -d 69.39.239.211 -j DNAT --to 192.168.0.1
    iptables -t nat -A POSTROUTING -o br0 -j MASQUERADE