LinuxQuestions.org
Visit Jeremy's Blog.
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 06-24-2003, 03:40 PM   #1
Bungo2000
Member
 
Registered: Mar 2002
Location: San Francisco, CA
Distribution: Redhat 9
Posts: 35

Rep: Reputation: 15
Unhappy Contacting INTERNAL LAN server via domain name/full IP? STATIC ROUTES? Please Help!!


I'm hosting an apache/sendmail server inside my LAN which is accessable to the public.

The problem is, I want to be able to access the server with its FULL public domain name from other computers INSIDE the lan.

Currently, I have to use its INTERNAL IP address if I am inside the LAN, and attempting to use its full domain name fails. It also fails if I use the full IP address. I'm not exactly sure why this is the case, but it does make some sense, seeing as I am inside the network using the same IP as the server.

It works for people outside the LAN becuase of my router's port forwarding feature.

How can I make it so if I type in the full URL of one of my hosted domains, I will be able to access it from inside the LAN? Is this what the "static routes" feature on my router (Netgear MR814) is for?

Thanks for any help.

(Note: the reason I need this is that I will be using a laptop both inside and outside my LAN to access mail, and its very annoying to have to change the IP address every time I want to check mail depending on where I am! Also, I am hosting many domains, so it would be nice to be able to test apache's virtual domains without having to go through a proxy or asking a friend!)

Last edited by Bungo2000; 06-24-2003 at 03:44 PM.
 
Old 06-24-2003, 03:49 PM   #2
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
if you have real domain names that are resolvable, then it SHOULD work. The internal PCs should query whatever DNS servers they are setup to use and be given the IP. This should then point back to your Netgear router which should forward the request like normal. I don't know why this wouldn't work. I have the exact same setup that you just described and it works with no extra configuration. If you have a real domain name that points to your real ip address and the router forwards ports correctly then it should work the same as accessing any opther web page.

The static routes feature is for when you have multiple networks on your router and you want to give the routes for each. So, no you dont need to mess with static routes.
 
Old 06-24-2003, 04:05 PM   #3
Bungo2000
Member
 
Registered: Mar 2002
Location: San Francisco, CA
Distribution: Redhat 9
Posts: 35

Original Poster
Rep: Reputation: 15
Exclamation

Interesting. I can in fact ping my domains and IP addresses from inside the network and they go through... for some reason I thought this didn't work.

The problem must be with the server itself? Perhaps my /etc/hosts isnt set up correctly? What do I need to confirm with my server settings for this to work?

Remember it works fine using the IP or the domain from OUTSIDE the network, but not inside. It also works fine from INSIDE the network using the INTERNAL IP of the server.

Thanks again!
 
Old 06-24-2003, 04:08 PM   #4
Bungo2000
Member
 
Registered: Mar 2002
Location: San Francisco, CA
Distribution: Redhat 9
Posts: 35

Original Poster
Rep: Reputation: 15
Question

Just a note --

If I try and connect via SSH from inside the network using my server's full domain name, I get the error "connection refused". If I try the same but with a non-existant domain name, I get the error "server not found."
 
Old 06-25-2003, 04:07 PM   #5
Bungo2000
Member
 
Registered: Mar 2002
Location: San Francisco, CA
Distribution: Redhat 9
Posts: 35

Original Poster
Rep: Reputation: 15
Any ideas?
 
Old 06-26-2003, 04:04 PM   #6
Bungo2000
Member
 
Registered: Mar 2002
Location: San Francisco, CA
Distribution: Redhat 9
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks.
 
Old 06-26-2003, 05:27 PM   #7
artur
Member
 
Registered: Apr 2002
Location: Illinois, US
Distribution: Red Hat, Fedora, Yellow Dog, Debian, FreeBSD, Embedix
Posts: 106

Rep: Reputation: 15
router not sending traffic back to lan

Quote:
I'm hosting an apache/sendmail server inside my LAN which is accessable to the public.
This sentence appears to mean that your LAN is accessible to the public, meaning that your entire LAN is on public IPs. From the rest of your post I deduct that it is your server that is accessible through port forwarding or DMZ, not entire LAN and that your LAN is on NATted private IPs.

You didn't mention how your DNS is configured, but I presume that you use your ISP's DNS servers. In this case, when your laptop on your private LAN tries to resolve your website's name - it receives reply with your server's public IP, not the local LAN IP. It then sends http request to that public IP. Since your laptop is configured to use your router as default gateway, that http request gets sent to your router, which gets confused, because it receives on it's local interface packet addressed to IP which should be on the WAN interface. Since this looks suspicious, your router drops the packet. Even if it didn't drop it, this shouldn't work. If your router did NAT on that http request and forwarded it to your server, server would reply directly to your laptop, because it is on the same subnet. Thus your router would never have a chance to NAT the reply so that it looks like it came from where original packet was sent to. The reply would come from server with server's local IP to the laptop. Now laptop will get confused, because it just sent a packet to server's public IP and it hears reply from totally diferent IP.

It is possible, that some routers will do NAT no matter what and thus your original http request would get recipient's IP NATted from public to local and sender's IP from local to public and vice versa on the way back. This would make things work, but would cause all traffic to travel through router, which would load it unnecessarily and might be a potential security issue.

To make long story short, you need to learn about BIND 9, especially "views" feature and set up your own DNS server for all your LAN computers to use. The added benefit is that your internet connection will be faster thanks to faster DNS lookups.
 
Old 06-26-2003, 06:02 PM   #8
Bungo2000
Member
 
Registered: Mar 2002
Location: San Francisco, CA
Distribution: Redhat 9
Posts: 35

Original Poster
Rep: Reputation: 15
The "which is accessable to the public" is referring the apache/sendmail server, not the entire LAN.

I am using a remote DNS service (zoneedit.com) for my domains which is very good. From what I've read, BIND is incredably complicated to configure so I'm not too keen on doing that.

Is there no way to get this thing working without running a seperate BIND server?

Last edited by Bungo2000; 06-26-2003 at 06:12 PM.
 
Old 06-27-2003, 10:27 AM   #9
artur
Member
 
Registered: Apr 2002
Location: Illinois, US
Distribution: Red Hat, Fedora, Yellow Dog, Debian, FreeBSD, Embedix
Posts: 106

Rep: Reputation: 15
not so bad

I was afraid of BIND too. But once I started playing with it, it turned out not to be so bad. Just get your feet wet with it and you'll know if you want to go that route.
The only other solution I can think of is to put your web server on public IP, outside of your NATed LAN. That's not very secure and will complicate your access to it if you also use it for a file server.
 
  


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
How do I config static routes? mikezang Linux - Networking 4 10-31-2005 10:29 AM
Max Static Routes? roundst Linux - Networking 2 07-28-2005 02:51 AM
automatic static routes? eantoranz Linux - Networking 5 07-19-2005 08:30 PM
Setting static routes on LAN cranium2004 Linux - Networking 3 01-06-2005 11:57 PM
static-routes in Mandrake 10.0 tallthom Mandriva 1 09-27-2004 12:51 AM

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

All times are GMT -5. The time now is 04:11 PM.

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