General discussion


Local Port Forwarding

By CXY ·

I need to map local port to another local port.

For example, access to port 80 will be forwarded to 8005.

Sounds silly, but this is because my network admin can not open access to port 8005 on the firewall, only to http service which in on port 80. I can not change the port 8005.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

by Nico Baggus In reply to Local Port Forwarding

It depends a little:

If you have linux (iptables netfilter is
assumed) and want something remote incoming to
port 80 map unto port 8005:

iptables -t nat -I PREROUTING --dport 80 -m
state --state NEW -p tcp --sync -j DNAT --to

You can of course add -s and -d to it to only
accept from certain sources to certain
destinations -i for the incoming interface.
You can change to point to any host on
your network.

Hope this helps,

Collapse -

by CXY In reply to

Poster rated this answer.

Collapse -

by CXY In reply to Local Port Forwarding

This question was closed by the author

Related Discussions

Related Forums