Solved

Port Forwarding (SMTP)

Posted on 2000-02-16
9
422 Views
Last Modified: 2010-03-18
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
Comment
Question by:syzygy
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2529814
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
 
LVL 15

Accepted Solution

by:
samri earned 20 total points
ID: 2530090
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
 
LVL 3

Expert Comment

by:alien_life_form
ID: 2531931
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:syzygy
ID: 2533300
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
 

Expert Comment

by:BlackSunSet
ID: 2533528
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
 
LVL 1

Author Comment

by:syzygy
ID: 2533581
redir only works with TCP, not UDP.
0
 
LVL 15

Expert Comment

by:samri
ID: 2533710
syzygy,
     beats me!.

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


samri
0
 
LVL 3

Expert Comment

by:alien_life_form
ID: 2533982
I don't see how POP3 is related with
UDP. AFAIK, POP3 runs on TCP.
0
 

Expert Comment

by:BlackSunSet
ID: 2540313
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

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question