IPtables Forward 1 Port to another on the same IP
I'm 95% sure this can be done with IP tables.
I'd like to forward all requests at port 80 to a server that's actually listening at port 5580. How could I do this? Thanks, Kevin |
If its on the same server:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 5580 otherwise: iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to <server>:5580 If there are http requests which come from the same LAN as the server than you need to do SNAT in addition to DNAT. |
Thanks for your help. I should have clarified that it was on the same server.
|
All times are GMT -5. The time now is 04:12 AM. |