General discussion

Locked

Local Port Forwarding

By CXY ·
Hi,

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.

3 total posts (Page 1 of 1)  
| 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
127.0.0.1:8005

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 127.0.0.1 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

Back to Linux Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums