Fedora Linux Support Community & Resources Center
  #1  
Old 22nd March 2009, 11:42 AM
andy2008 Offline
Registered User
 
Join Date: Feb 2009
Posts: 63
Port forwarding question.

Hi guys!
I have a question regarding port forwarding.
I have a fedora server, with two eth cards: eth0 ---> external IP, eth1 ----> LAN IP
I use SNAT for connection sharing. I also have an internet domain hosted on this server... let's call it www.mydomain.com
Anyway, one of our computers in the LAN has some kind of web server on it, which must be accessed from the internet on the port 23700.
So, using iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 23700 -j DNAT --to 192.168.1.25 (the IP of the network computer)
Everything works perfectly fine from outside the lan.
When I type www.mydomain.com:23700, I connect to that computer.
My problem is that inside the lan, typing www.mydomain.com:23700 does not work! It only works if I enter it by IP 192.168.1.25:23700
Is there any way to make the server forward my request to that specific computer even if I'm inside the LAN?
Reply With Quote
  #2  
Old 22nd March 2009, 02:07 PM
PatMcLJr's Avatar
PatMcLJr Offline
Registered User
 
Join Date: Apr 2005
Location: earth
Posts: 1,130
maybe you could use some kind of dns to point to the local box on home lan?

Pat Jr.
__________________
x--x--x
http://www.gnu.org/philosophy/free-sw.html
Freedom is never Free.
Pat Jr.
Reply With Quote
  #3  
Old 22nd March 2009, 03:17 PM
wneumann Offline
Registered User
 
Join Date: Dec 2004
Posts: 511
You can add www.mydomain.com to /etc/hosts with the ip address 192.168.1.25
Reply With Quote
  #4  
Old 23rd March 2009, 06:29 AM
andy2008 Offline
Registered User
 
Join Date: Feb 2009
Posts: 63
Quote:
Originally Posted by wneumann View Post
You can add www.mydomain.com to /etc/hosts with the ip address 192.168.1.25
Tried it... and it still doesn't work. From the linux machine, it works, if I ping www.mydomain.com it pings 192.168.1.25, but computers in LAN still ping the server when they ping www.mydomain.com... and that's a good thing, because I only want this to work when using port 23700, otherwise all requests must go to the linux machine (which hosts the main website for the domain, etc)
Reply With Quote
Reply

Tags
forwarding, port, question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about iptables and port forwarding Magice Servers & Networking 4 25th December 2008 09:57 PM
Port Forwarding/Opening Question. cmatheson1 Servers & Networking 1 8th June 2008 03:13 AM
port forwarding, not forwarding?!!! Stranger Servers & Networking 2 29th September 2005 07:53 AM


Current GMT-time: 13:08 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat