Solved

Port Forwarding (SMTP)

Posted on 2000-02-16
9
404 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 1

Author Comment

by:syzygy
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Expert Comment

by:BlackSunSet
Comment Utility
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
Comment Utility
redir only works with TCP, not UDP.
0
 
LVL 15

Expert Comment

by:samri
Comment Utility
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
Comment Utility
I don't see how POP3 is related with
UDP. AFAIK, POP3 runs on TCP.
0
 

Expert Comment

by:BlackSunSet
Comment Utility
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now