Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 466
  • Last Modified:

Port Forwarding (SMTP)

I have a linux system (Openlixe 2.2, 2.0.35 kernel) connected to the internet as well as a private LAN (10.0.0.1)

Also on the LAN is a mailserver (10.0.0.2)

I would like any traffic sent to the linux system on TCP port 25 to be forwarded to mail server.  What is the easiest way to do this?  

I've tried using the program redir, but it does not appear to be working... what should teh correct parameters for it be, and is there anything else that need to be set up for it to work?
0
syzygy
Asked:
syzygy
  • 2
  • 2
  • 2
  • +2
1 Solution
 
jlevieCommented:
I think if you'll take a look at section 6 of the IP Masquerade HowTo (http://howto.tucows.com/LDP/HOWTO/IP-Masquerade-HOWTO.html) you'll find what you need. There's a good discussion of forwarding and how to do it for simple services, like smtp, www, etc.
0
 
samriCommented:
syzygy,

     You also might want to take a look at rinetd (internet ``redirection server'').

     The source code and the documentation is available at
       
         http://www.boutell.com/rinetd/


Good luck,

Samri.
0
 
alien_life_formCommented:
The way I do it is akin to the way
transparent proxying is done for
squid, and requires nothing
fancier than ipchains/ipfwadm depending if 2.0 or 2.2. The squid
docs (I don't have the URL) have
precise setup instructions - just
replace 80 with 25.
And, (if you use sendmail) disable identd lookup by setting the timeout
to zero in .cf (default is 30s), because identd does not take kindly this kind of redirection.

0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
syzygyAuthor Commented:
I've used samri's suggestion of rinetd, it works fine for TCP.


Now for bonus points, how do I do the same thing for UDP?  Now I find out I need to set up POP-3 as well.
0
 
BlackSunSetCommented:
Whell I whouldn't do the forwarding with ipportfw or ipautofw because you open your self to DenailOfService attack so I whould use redir to redirect the trafic from the server to the local box,use 25 for SMTP and 110 for Pop3.

redir --lport=25 --cport=25 --laddr=(Internet_IP) --caddr=10.0.0.2 --syslog
redir --lport=110 --cport=110 --laddr=(Internet_IP) --caddr=10.0.0.2 --syslog

0
 
syzygyAuthor Commented:
redir only works with TCP, not UDP.
0
 
samriCommented:
syzygy,
     beats me!.

    I guess I got to do another research on those. (hhmm.,. the bonus pints sounds rather attractive)


samri
0
 
alien_life_formCommented:
I don't see how POP3 is related with
UDP. AFAIK, POP3 runs on TCP.
0
 
BlackSunSetCommented:
syzygy: As Alien mentioned how does pop3 and smtp work with udp it beets me but next time if someone on your questions thanks be nice,
I sugest you start using Win since you don't know the difference between tcp and udp, pointing and clicking the mouse its always easier.
0
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.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now