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 everyone for the emails...
I did iptables -t nat --list and it now gives me this output:
DNAT tcp -- anywhere anywhere tcp dpt:smtp
to:192.168.22.6:25
But when I tried to telnet from another machine to 192.168.22.5 port 25 (the ip of the netfilter firewall/router) it didn't work at all..Do there has to be a line somewhere that says it's allowed to forward these connections?

Regards,

Ronald.

-----Original Message-----
From: Eugene Joubert [mailto:[email protected]]
Sent: dinsdag 4 februari 2003 11:41
To: 'ASC - Ronald Roeleveld';
Subject: RE: Port forward

remember that you are using DNAT so you would have to specify the -t nat switch in your line.

eg

iptables -t nat -A PREROUTING -p tcp -s 0/0 --dport 25 -i eth0 -j DNAT --to 192.168.22.6:25

Hope this helps

-----Original Message-----
From: ASC - Ronald Roeleveld [mailto:[email protected]]
Sent: 04 02 2003 12:31 PM
To: '[email protected]'
Subject: Port forward

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
I get this output:
iptables: Invalid argument
I did do iptables -X PREROUTING so the chain does exist.
Can anyone please help me out..
What I want is that all incoming connections on eth0 on port 25 are routed to another machine on the internal network 192.168.22.6

Thanks in advance,
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/>

#1 lore raw

do you have MASQERADE out aktive?

for the mailserver the traffic seems to come from the internet , remeber that yout FW needs masquerading to be aktive and the gateway of your mailserver needs to be
the firewall

Quoted 40 lines · ASC - Ronald Roeleveld

Thanks a lot everyone for the emails...I did iptables -t nat --list
and it now gives me this output:DNAT tcp --
anywhere anywhere tcp dpt:smtp
to:192.168.22.6:25But when I tried to telnet from another machine to 192.168.22.5 port 25 (the ip of the netfilter firewall/router) it didn't work at all..Do there has to be a line somewhere that says it's allowed to forward these connections?Regards,Ronald.

-----Original Message-----
From: Eugene Joubert [mailto:[email protected]]
Sent: dinsdag 4 februari 2003 11:41
To: 'ASC - Ronald Roeleveld';
Subject: RE: Port forward

remember that you are using DNAT so you would have to specify the -t nat switch in your line.eg iptables -t nat -A PREROUTING -p tcp -s 0/0 --dport 25 -i eth0 -j DNAT --to 192.168.22.6:25Hope this helps

-----Original Message-----
From: ASC - Ronald Roeleveld [mailto:[email protected]]
Sent: 04 02 2003 12:31 PM
To: '[email protected]'
Subject: Port forward

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:25I get this output:iptables: Invalid argumentI did do iptables -X PREROUTING so the chain does exist.Can anyone please help me out..What I want is that all incoming connections on eth0 on port 25 are routed to another machine on the internal network 192.168.22.6Thanks in advance,Ronald Roeleveld System Administrator

Quoted 7 lines

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

--
-------------------------------------------------------------
Computer Service Büro ENTER

Patrick Maartense                 Tel:        +43  2236 42761
am Steinfeld 19a                  FAX:        +43 2236 893970
A-2344 Maria Enzersdorf           Mobil:      +43 664 4200656

e-mail: [email protected] [email protected]
http://www.csbenter.at
-------------------------------------------------------------

#2 lore raw
In reply to ASC - Ronald Roeleveld

I don't know what your setup is but I myself explicitly FORWARD things to telnet:

e.g:

# Allow access to machines from the private LAN:

iptables -A FORWARD -i INTERFACE_CONCERNED -o OUTPUT_INTERFACE -p tcp \
	 -s $LAN_MACHINES --sport $UN_PRIVILEGED_PORTS \
	 -d $DESTINATION_ADDRESS --dport 23 \
	 -m state --state NEW -j ACCEPT

you get the hint.

Any way why use telnet? I recommend secure shell (tcp port 22).

Santos.

Security is a blessing.