NAT for locahost to IP LAN for mail services

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.... im trying to forward the conecction to mail services like smtp(
port 25) from one pc to another, im using:

_mail_services=25,110,143,995,993
_mailserver=192.168.0.3
iptables -t mangle -A ftolocal -p tcp -m multiport --destination-ports
$_mail_services -j MARK --set-mark 1
iptables -t nat -A ftolocal -p tcp -m multiport --destination-ports
$_mail_services -j DNAT --to-destination 192.168.0.3

where ftolocal its a chain name for mangle and nat...

the ip addres source it's 192.168.0.5 and i want to send localhost
connections to 192.168.0.3...
when i use the lines above i can:
telnet 192.168.0.5 25
and it works... giving me:
Trying 192.168.0.5...
Connected to beta.gps.com.co (192.168.0.5).
Escape character is '^]'.
220 alpha.gps.com.co ESMTP Postfix

But when i use:
telnet localhost 25 or telnet 127.0.0.1 25 tha must be equal i get..
Trying 127.0.0.1...
and statys there forever.....

without using the lines above i just get:
[root@beta beta]# telnet localhost 25
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused
[root@beta beta]# telnet 192.168.0.5 25
Trying 192.168.0.5...
telnet: connect to address 192.168.0.5: Connection refused
telnet: Unable to connect to remote host: Connection refused

What i do wrong.... why i cannot use localhost to connect.... can
someone give me a hand....

Lot of Thanks..

Alan Jairo Acosta
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux