using ip tables to allow windows mail server to work.

Hi EE.  I just managed to configure my lan with linux as a router.  I have a simple firewall router connected to my internet link and my linux box connected to the router.  my lan is then connected to the linux box on eth1.  So Internet is working.  However my mail server sits on one of the linux boxes.  The router forwards data on port 25 and 110 to a pc on the lan, but since they are on different ip range - for the router and for the pc.  How can I get mail to work?


Who is Participating?
ahoffmannConnect With a Mentor Commented:
so your network topology is now:

internet -- router --- (eth0) linux box (eth1) --- M$ pc with MTA

then you need to configure your router to pass port 25 to ip of eth0
and on linux box you need a port forwarding like:
  iptables -t nat PREROUTING -i eth0 --dport 25 --to-destination ip-of-winbox:25 -j DNAT
the router needs to pass port 25 to the linux box and block port 110 (except you wont to use horrible insecure POP over internet).
then you PC needs to send mails to your linux box and query it for recieving mails using pop
(assuming that the linux box is your MTA and all PCs are MUAs)
aduhwaleAuthor Commented:
Hi.  My scenario is this.  My mail server is running on one of the windows clients.  So before I put in the linux box, the router was connected on the switch and all the windows pcs connected via this.  The router had ports 25 and 110 forwarded to the windows pc with the mail server program.  So I am looking for a way to avoid using the linux box for any portion of the mail and  just have my ports forwarded as before.
aduhwaleAuthor Commented:
ur a star.  thanks.
keep in mind that my iptables suggestion assumes that traffic from eth1 is routed though to eth0 without (much) problems, in particular port 25 so that you MTA can caal other mail servers
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.