Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Re: Trying to nat with iptables (nat / prerouting / iptables) |
|---|---|
| Date: | Mon, 27 Feb 2006 10:46:35 +0000 |
Carlos,
Your port forwarding rule in the PREROUTING chain is correct.
-A POSTROUTING -o <interface> -j MASQUERADE
Tested should work np.
Dave Shaw Network Security C2 Communications
Carlos Costa wrote:
I'm trying to doing something simple with iptables: redirect one port of my firewall machine to other port at other machine.
This is what I do:
iptables -t nat -A PREROUTING -p tcp --dport 81 -j DNAT --to 192.168.1.3:139
This is not a real example (I am really trying to do this with vnc port), but here I don't have vnc, so I am testing with this.
In the FORWARD chain my policy is ACCEPT, so I assume that the packet must go to 192.168.1.3:139 (I am logging the packets in FORWARD, and there is no traffic).
I assume that 192.168.1.2:81 must be equivalent to 192.168.1.3:139, but:
merry:~# telnet 192.168.1.2 81 Trying 192.168.1.2... telnet: Unable to connect to remote host: Connection refused
merry:~# telnet 192.168.1.3 139 Trying 192.168.1.3... Connected to 192.168.1.3.
What I am doing wrong? Thank you very much, Carlos.
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Trying to nat with iptables (nat / prerouting / iptables), Christophe Lucas |
|---|---|
| Next by Date: | Re: Open source windows firewall, Jason Dixon |
| Previous by Thread: | Re: [inbox] Re: Trying to nat with iptables (nat / prerouting / iptables), Pedro Santiago |
| Next by Thread: | Re: Trying to nat with iptables (nat / prerouting / iptables), Vladimir Mitiouchev |
| Indexes: | [Date] [Thread] [Top] [All Lists] |