![]() |
IPTables Help - Forwarding from one port to another
I am running Ubuntu 8.04, and how I want it is so that if any computer connects to the server on 10.20.117.x:445 it will forward it to 74.125.45.111:465 using <Server's IP> which is a public interface.
Any thoughts/ideas? Code:
iptables -t nat -A PREROUTING -p tcp -d 10.20.117.x --destination-port 465 -j DNAT --to-destination 74.125.45.111:465 |
With a couple of changes (highlighted in bold below) to you first rule, I think that should work assuming that your routing table directs a destination of 74.125.45.111 out the interface you wish:
Code:
iptables -t nat -A PREROUTING -p tcp -d 10.20.117.0/24 --destination-port 445 -j DNAT --to-destination 74.125.45.111:465Code:
LAN_IP=10.0.0.0/8If you are unfamiliar with CIDR notation, you can read about it here. In a nutshell (quoting from the linked page): Quote:
|
Thanks :)
|
| All times are GMT -5. The time now is 10:02 PM. |