Skip to contentSkip to conversation

Port forward

DISCUSSION ASC - Ronald Roeleveld 3 participants 3 messages Feb 4, 2003

lore
Share & tools
lore
#0 lore raw

Thanks a lot the error message is gone now,
after I changed the line to:
iptables -t nat -A PREROUTING -p tcp --destination-port 25 -i eth0 -j DNAT --to-destination 192.168.22.6:25

But when I do iptables --list
I dont see any entrys in the chain for PREROUTING

Chain INPUT (policy ACCEPT)

target     prot opt source               destination
ACCEPT     tcp  --  192.168.32.6         anywhere           tcp dpt:ssh
ACCEPT     udp  --  192.168.32.6         anywhere           udp dpt:ssh
ACCEPT     tcp  --  192.168.22.6         anywhere           tcp dpt:ssh
ACCEPT     udp  --  192.168.22.6         anywhere           udp dpt:ssh
ACCEPT     tcp  --  thamaster.xs4all.nl  anywhere           tcp dpt:ssh
ACCEPT     udp  --  thamaster.xs4all.nl  anywhere           udp dpt:ssh
ACCEPT     tcp  --  192.168.22.0/24      anywhere           tcp dpt:www
ACCEPT     udp  --  192.168.22.0/24      anywhere           udp dpt:www
ACCEPT     tcp  --  localnet/24          anywhere           tcp dpt:www
ACCEPT     udp  --  localnet/24          anywhere           udp dpt:www
ACCEPT     all  --  anywhere             anywhere
DROP       tcp  --  anywhere             anywhere           tcp

flags:SYN,RST,ACK/SYN

Chain FORWARD (policy ACCEPT)

target     prot opt source               destination
TCPMSS     tcp  --  anywhere             anywhere           tcp

flags:SYN,RST/SYN TCPMSS clamp to PMTU
ACCEPT all -- anywhere anywhere state
ESTABLISHED

Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination
TCPMSS     tcp  --  anywhere             anywhere           tcp

flags:SYN,RST/SYN TCPMSS clamp to PMTU
TCPMSS tcp -- anywhere anywhere tcp
flags:SYN,RST/SYN TCPMSS clamp to PMTU

Chain PREROUTING (0 references)
target prot opt source destination

Regards,

Ronald Roeleveld
System Administrator

ASCINTERNATIONAL
Vlietweg 17c, 2266 KA, Leidschendam, The Netherlands Tel. +31 (0)70 3178400, Fax +31 (0)70 3204760
E-mail: [email protected] <mailto:[email protected]> , Website:
http://www.ascinternational.nl <http://www.ascinternational.nl>

-----Original Message-----
From: Eric Leblond [ mailto:[email protected]
<mailto:[email protected]> ]
Sent: dinsdag 4 februari 2003 11:49
To: ASC - Ronald Roeleveld
Subject: Re: Port forward

Quoted 7 lines · ASC - Ronald Roeleveld

Hi all,

Iam trying to set up a port forward for several hours now, but I don't seem to get it working right.
When I type the following command:
iptables -A PREROUTING -p tcp --destination-port 25 -i eth0 -j DNAT --to-destination 192.168.22.6:25

you forget to specify that you work on the NAT table so add -t nat
ou your line

--
Éric Leblond
courriel : [email protected]

#1 lore raw
Quoted 3 lines

Thanks a lot the error message is gone now,
after I changed the line to:
iptables -t nat -A PREROUTING -p tcp --destination-port 25 -i eth0 -j

DNAT --to-destination 192.168.22.6:25

Quoted 2 lines

But when I do iptables --list
I dont see any entrys in the chain for PREROUTING

You must specify that you want to list the content of the nat table....

iptables -t nat --list

#2 lore raw
In reply to ASC - Ronald Roeleveld
Quoted 8 lines · ASC - Ronald Roeleveld

Thanks a lot the error message is gone now,
after I changed the line to:
iptables -t nat -A PREROUTING -p tcp --destination-port 25 -i eth0 -j DNAT --to-destination 192.168.22.6:25

But when I do iptables --list
I dont see any entrys in the chain for PREROUTING

You need to put in the "-t nat" here too to show the nat table:

iptables -t nat --list

Sven