Linux Netfilter discussions
 help / color / mirror / Atom feed
* NAT on the same network
@ 2008-05-28 20:10 Matton
  2008-05-29  1:04 ` Grant Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Matton @ 2008-05-28 20:10 UTC (permalink / raw)
  To: netfilter



Hi all,

I ave an mail server who can only receive mail from mail-relay for adresses
rewriting.
Then I build rules to forward connection to the mail-relay if the source is not
the mail-relay.
following the rules To do that:
ip_forward=1

PROXY2=10.97.200.156
SMTP=25
MYIP=10.97.24.76


iptables -t nat -N LOG_SNAT
iptables -t nat -A LOG_SNAT -j LOG --log-prefix '[IPT_SNATSMTP]'
iptables -t nat -A LOG_SNAT -j SNAT --to-source ${MYIP}


iptables -t nat -N LOG_NATSMTP
iptables -t nat -A LOG_NATSMTP -j LOG --log-prefix '[IPT_NATSMTP]'
iptables -t nat -A LOG_NATSMTP -j DNAT --to-destination ${PROXY2}

iptables -t nat -A PREROUTING  -s ! {PROXY2} -p tcp --dport ${SMTP} -j
LOG_NATSMTP
iptables -t nat -A POSTROUTING  -o eth0 -p tcp --dport ${SMTP} -j LOG_SNAT

From proxy2 y ave the connection on the mail-server, fine.
for other machine I ave a log for the PREROUTING the log for the POSTROUTING
but
the connection c'ant be up to the mail-relay ( proxy2 )

What can I do ?

Thanks for your help
Jean-Louis--

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-05-29 16:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 20:10 NAT on the same network Matton
2008-05-29  1:04 ` Grant Taylor
2008-05-29  8:24   ` Jan Engelhardt
2008-05-29 16:35     ` Grant Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox