Hi group,
I've got some probs with a special case of routing:
3 mashines : router , smtp server and webserver.
the route got all the external ips :
62.x.x.4 ( itself )
62.x.x.5 is beeing prerouted to the smtp server
62.x.x.6 is beeing preroutet to the webserver
the iptables entries look like this :
$IPTAB -A PREROUTING -t nat -p tcp -i $EXTERN -d $SMTP_EXT_IP --dport 25 -j
DNAT --to-destination $SMTP_INT_IP:25 -m state --state
NEW,ESTABLISHED,RELATED
look this :
62.x.x.0/28 ------ |eth0 eth1| 192.168.0.0/28
the both servers only have local adresses and the router sends the pakets to
them.
all this works good. but now the webserver wants to send an email to the
external adress of the smtpserver ( 62.x.x.5 ). I have no idea how to manage
this.
one solution could be, that a the router takes the paketes and redirects
them back to the internal device, might be like this :
$IPTAB -A PREROUTING -t nat -p tcp -i $INTERN -s WEB_INT_IP -d
$SMTP_EXT_IP --dport 25 -j DNAT --to-destination $SMTP_INT_IP:25 -m
state --state NEW,ESTABLISHED,RELATED
but this doesnt work... dont know why !
the other opportunity is, masquerading the outgoing pakets bevore they leave
the websrv.. but i dont know how to handle this...
any suggestions ?
thanks a lot for help !
cheers
fil
|