Networking Forums

Networking Forums > Computer Networking > Linux Networking > Need Heldp :Iptables Routing !

Reply
Thread Tools Display Modes

Need Heldp :Iptables Routing !

 
 
Filip Lyncker
Guest
Posts: n/a

 
      11-20-2004, 03:20 PM
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables and routing Prashant Jois Linux Networking 1 05-01-2009 01:40 PM
Routing with iptables Jozza Linux Networking 7 03-24-2009 03:33 PM
iptables email routing Brian Ronk Linux Networking 1 04-07-2007 01:09 AM
routing between public IP's using iptables sandeepagarwal.1980@gmail.com Linux Networking 2 05-30-2005 05:00 AM
iptables MARK and Routing Steve Wakelin Linux Networking 0 07-01-2004 12:06 AM



1 2 3 4 5 6 7 8 9 10 11