1

Infrastructure:
enter image description here


Here's what I want, be able to connect to the website 10.10.100.32:8080 from my LAN on 'Router 1', and all the traffic outside the port 8080 should go to the default gateway 'Router 1'.

iptables -t nat -A PREROUTING -t -nat -p tcp -s 0/0 --dport 8080 -j DNAT --to 192.168.67.251


But it didn't worked.

1 Answer 1

2

Routing is a function of the IP layer; you can route traffic based on the destination address, but not on the destination port, which is a feature of the upper layer (TCP or UDP). What you want to do is not possible.

The command you tried would result in your computer rewriting the destination address to send packets to 192.168.67.251 instead of their real destination; those packets would get sent to the router, not through it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .