Click to See Complete Forum and Search --> : IPTables: Why doesn't it work!!!


Jimmy Lio
08-09-2002, 02:08 AM
I have a Linux box running Mandrake 8.2. I'd like to telnet to an internal computer. Being a newbie to iptables, I found a script that seems to work for everyone:

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 23 -j DNAT
-- to INTERNAL_IP:23

... where eth1 is the NIC connecting to the Internet...

The script doesn't seem to work in my situation... Why? What other scripts are needed? I've already enabled IP_Fowarding...

Jimmy:confused:

Dagda
08-09-2002, 09:24 AM
first don't use telnet its not secure. use ssh instead. also do you have telnet running?

Jimmy Lio
08-09-2002, 09:47 AM
... thanks for your advice... I only used telnet for testing, and the telnet server was running when I tested it.

I tried NAT with http, ftp... but none of them works...

Jimmy

Lorithar
08-10-2002, 09:24 AM
I'll bet that you can see the initial connection come in on the box where telnet is. However ... I think you need to match the inbound with an outbound rule so that the connection is completed.

Jimmy Lio
08-10-2002, 10:30 AM
What would the outbound rule look like? I thought the script I used was enough...

Jimmy Lio

Jimmy Lio
08-10-2002, 08:12 PM
It turns out that my target server's default gateway is pointing to another server. Everything runs fine after the default gateway's changed to the firewall's IP.

Thanks for those who cared...

Jimmy