LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-12-2007, 11:11 AM   #1
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Rep: Reputation: 30
Port forwarding smtp


hiya

How do i port forward for smtp of my real ip (ISP ip) to my local ip.

Example i want to port forward all the mails coming to 202.89.16.54 port 25 to my local ip 192.168.1.44:25.
 
Old 12-12-2007, 04:07 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
this is 100% down to your router, nothing to do with linux at all, unless you're running a linux server as the ISP router, which presumably you'd have mentioned... http://portforward.com and check the details for your router.
 
Old 12-12-2007, 05:08 PM   #3
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
yeah my ISP ip is directly connected to my Linux box so how do i do it?
 
Old 12-12-2007, 06:04 PM   #4
SiegeX
Member
 
Registered: Jul 2004
Location: Silicon Valley, CA
Distribution: Slackware
Posts: 171

Rep: Reputation: 38
Code:
iptables -A PREROUTING -i $WAN_IF -d 202.89.16.54 -p tcp --dport 25 -j DNAT --to-destination 192.168.1.44
If your FORWARD policy is set to DROP then you'll need this too:
Code:
iptables -A FORWARD -o $LAN_IF -p tcp --dport 25 -j ACCEPT
If the IP 202.89.16.54 is dynamic, then just remove '-d 202.89.16.54'

Dont forget to set the LAN_IF and WAN_IF variables appropriately.

Last edited by SiegeX; 12-12-2007 at 06:07 PM.
 
Old 12-12-2007, 07:04 PM   #5
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
what do you exactly mean by "drop" becuz i would like to have both way i.e 192.168.1.44 should be able to send mails using port 25 or my ISP IP and also receive it, so what do u mean by "drop" there?

What does those variables WAN_IF and LAN_IF mean, are there keywords?
 
Old 12-12-2007, 07:42 PM   #6
SiegeX
Member
 
Registered: Jul 2004
Location: Silicon Valley, CA
Distribution: Slackware
Posts: 171

Rep: Reputation: 38
If you are not familiar with the DROP terminology then you should really read an iptables tutorial/howto. I recommend this one: http://iptables-tutorial.frozentux.n...-tutorial.html

And im not just trying to brush you off, if you enter in iptables rules willy-nilly and don't know what they mean then you are not doing yourself any justice and you're likely to break your connection altogether and have no idea how to undo it.
 
Old 12-13-2007, 06:33 AM   #7
kool_kid
Member
 
Registered: Sep 2004
Location: Dubai, UAE
Distribution: RHL
Posts: 350

Original Poster
Rep: Reputation: 30
i know one simple rule to undo settings is through service iptables restart for sure i will not be implementing this command in the Live Envirnoment untill i undestand it myself anyway thanks for the tut
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPCOP Port Forwarding SMTP problem Casket Linux - Networking 2 11-07-2007 09:15 PM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
port forwarding for pop3 and smtp sundar1712 Linux - Networking 2 05-16-2006 07:44 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
Postfis SMTP forwarding and Incoming SMTP pheasand Linux - Software 0 04-27-2005 05:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration