Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 09-16-2005, 03:03 AM   #1
Registered: Sep 2005
Location: Bangladesh
Distribution: RH 7.2, 8, 9, Fedora
Posts: 217

Rep: Reputation: 30
Question NAT and Port Forwarding

Here is the story... I have a static public ip from my isp X.X.X.X my gateway given by my isp is A.B.C.D I want to share my net connection using the private ip block for 4 to 5 pcs in my home. There, one of the PC is my mail server providing pop3, webmail, smtp and secure webmail (ports 25, 80, 110, 443). My linux box for NAT is running under RH9 and having iptables. Now, The eth0 is the WAN interface, ip: X.X.X.X, gw A.B.C.D eth1 is the LAN interface, ip, (no gw, since default gw is A.B.C.D) I need all the pcs from the LAN to have the net connection. By the same time, ports should be forwarded to the mail server ( for ppl from the WAN to access and check and send mail. I am now diong it somehow, but it's not working well. My LAN users can not send mail using the server located inside the LAN through WAN. Means when they use from lan, they get nothing. but if they try from the outside of the lan, they can get it. I can solve it using a dns in local lan. but is there any way to do it directly?? I previously used a device from D-Link that provided me the NAT and virtual server functions. Then i could do it. But I can not do like the previous. Now i just want to replace the device with a linux box. Can any one tell me what can i do?? i need a script just simple... and simple.... plz help me....
Old 09-16-2005, 04:31 AM   #2
Registered: Aug 2004
Distribution: Gentoo, Suse, Fedora, Debian
Posts: 86

Rep: Reputation: 15
As I can understand you meean to say that the only problem is in accessing the mail server from the local LAN..
The Clients should access the mail server, with the local lan's IP(, then it would be OK I guess.
Old 09-16-2005, 07:58 AM   #3
Registered: Sep 2005
Location: Bangladesh
Distribution: RH 7.2, 8, 9, Fedora
Posts: 217

Original Poster
Rep: Reputation: 30
Ya.. but what i want is to access it using the FQDN instead of the ip. Is there any way?? Except setting up a local dns mapped to the local ip.
Also I need a script just to understand and compare with mine... And this script will provide:-
1.) NAT for sharing the connection.
2.) Port forwarding (25, 110) to [x.x.x.x:25 --->Fwd to ---->
The script will provide only these two things. No other special things. The rest of the seciruty will be set up later.
Can any one??


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
SSH port forwarding thru a NAT Firewall whoever Linux - Networking 3 07-29-2005 03:24 AM
Port Forwarding without NAT on an old Kernel linuxpyro Linux - Networking 0 06-02-2004 12:31 PM
iptables + NAT + Port forwarding problem SirGertrude Linux - Networking 9 05-14-2004 04:02 AM
NAT Port forwarding problems! nidputerguy Linux - Networking 4 01-31-2004 10:29 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:32 PM.

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