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 09-29-2005, 06:33 PM   #1
shazam75
Member
 
Registered: Oct 2004
Location: Australia, Brisbane
Distribution: Gentoo
Posts: 296

Rep: Reputation: 30
Cannot see my webserver using the external IP address


I have got apache up and running on my Linux machine. My friend can see my web pages using the external IP Address.

ALso I can see my own web pages using my internal IP address eg 192.168.1.2, BUT i cannot see it using the external address.

Even on another computer on my local network I cannot see it.

It is not the firewall as I have it turned off.

Any suggestions welcome

Regards
Shelton.
 
Old 09-29-2005, 06:36 PM   #2
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
What kind of local network do you have setup? Is it running through a router with NAT enabled? I am assuming you won't be able to access it with that IP since it is out of the network range for your subnet.
 
Old 09-29-2005, 06:42 PM   #3
shazam75
Member
 
Registered: Oct 2004
Location: Australia, Brisbane
Distribution: Gentoo
Posts: 296

Original Poster
Rep: Reputation: 30
Yes it is running though my ADSL modem which is a router with NAT applied. My subnet mask is 255.255.255.0

Regards
Shelton.
 
Old 09-29-2005, 07:53 PM   #4
unreal128
Member
 
Registered: Jun 2003
Distribution: SuSE, Slackware, Gentoo
Posts: 207

Rep: Reputation: 30
This makes sense then. The external IP will not be available because your PC won't know how to route the data since it whole conception of the network is in the 192.168.0.x range. Is their a particular reason why you need to use the other IP?
 
Old 09-29-2005, 09:31 PM   #5
shazam75
Member
 
Registered: Oct 2004
Location: Australia, Brisbane
Distribution: Gentoo
Posts: 296

Original Poster
Rep: Reputation: 30
Hi Unreal

I wanted to see my webpages from the external address - I mean if it does not work as you explaned -then I understand.

Thnks for replies.

Regards,
Shelton.
 
Old 09-29-2005, 09:33 PM   #6
shazam75
Member
 
Registered: Oct 2004
Location: Australia, Brisbane
Distribution: Gentoo
Posts: 296

Original Poster
Rep: Reputation: 30
Then how is it possible to see other external web sites Unreal - like www.google.com ?

Regards
Shelton.

Last edited by shazam75; 09-29-2005 at 09:36 PM.
 
Old 09-30-2005, 01:03 AM   #7
Elomis
Member
 
Registered: Dec 2004
Location: Sydney
Distribution: SUSE
Posts: 89

Rep: Reputation: 15
Talking This is how DNS works

Ok, so you know what DNS is right? every computer has an IP and every network has a bunch of IPs? And you understand that routing details how to get network to and from computers in networks?

The reason why you can't see the page internally is because you don't have a route to it, your network and the internet don't have information on how to get to the external address of your web site. The reason you can see google is because DNS servers from your ISP and routers of your ISP have information on how to translate www.google.com into the IP of google, route the traffic, and bring the page back.

What you DO have in your internal network, is a route to the web page on the internal IP. What your friend has, is a route and/or a DNS entry to the external IP.
So in short, two things determine if you can see a web page. A router contains the route to the page, and a DNS server has a name<->number translation. You are missing one or the other in any case where you can't see the page.
 
Old 09-30-2005, 02:41 AM   #8
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Hope this explains what is going on here;

When you send the request it goes from your box on the lan to the router which then sends the request out using the wan ip address allocated by the isp. Since the ip address of the request and the response are the same the system gets confused and says that it cannot be found.
This can be overcome using network loopback (I don't know how to do this so don't ask) or by finding a public proxy server or using a different ip address to make the request. A public proxy server is one which redirects requests form one ip and makes it look like it is coming its coming from the proxy server thereby allowing the request. I have used this method and it works well. Make sure that the proxy server allows you to do this! You can also use a dial-up connection because this will come from a different ip.

Edit: You'll find a list of proxy servers here . Use the anonymous ones on port 80. To do this with Mozilla/FireFox go to Edit -> Preferences -> Connection - Manual proxy configuration and enter the address and use port 80.

Last edited by TigerOC; 09-30-2005 at 02:58 AM.
 
Old 09-30-2005, 02:44 AM   #9
shazam75
Member
 
Registered: Oct 2004
Location: Australia, Brisbane
Distribution: Gentoo
Posts: 296

Original Poster
Rep: Reputation: 30
ok thanks for the explantion Tiger!
 
Old 09-30-2005, 06:02 AM   #10
sti2envy
Member
 
Registered: Sep 2004
Posts: 43

Rep: Reputation: 15
The easiest way is to edit /etc/hosts file,

insert something like

192.168.1.x www.yourdomain.com www

where 192.168.1.x would be your internal IP address of your web server, can be any class A,B or C and www.yourdomain.com would be the FQDN. So whenever you type www.yourdomain.com or www into your browser url, it resolves to the 192.168.1.x where your web server would be
 
Old 09-30-2005, 06:36 AM   #11
Snowbat
Member
 
Registered: Jun 2005
Location: q3dm7
Distribution: Mandriva 2010.0 x86_64
Posts: 338

Rep: Reputation: 31
My router (Linksys WRT54G) adds a loopback route for the public IP address and does not suffer from this problem. Any machine on my LAN can browse the public-facing web server using my router's public IP address or dyndns.org hostname.

Last edited by Snowbat; 09-30-2005 at 06:37 AM.
 
Old 09-30-2005, 08:09 PM   #12
shazam75
Member
 
Registered: Oct 2004
Location: Australia, Brisbane
Distribution: Gentoo
Posts: 296

Original Poster
Rep: Reputation: 30
hi sti2envy
yes that fixed the problem - it was the host file that I needed to make an enty!

Thanks again!

Regards
Shelton.
 
Old 09-30-2005, 08:32 PM   #13
mcd
Member
 
Registered: Aug 2003
Location: Denver, CO
Distribution: CentOS, Debian
Posts: 825

Rep: Reputation: 33
Quote:
My router (Linksys WRT54G) adds a loopback route for the public IP address and does not suffer from this problem. Any machine on my LAN can browse the public-facing web server using my router's public IP address or dyndns.org hostname.
i had a linksys router at my old house that did the same thing. i've since used both a microsoft wireless router and a different linksys cable modem/gateway/router, and neither of them allows that by default. i asked why, and was told that it's a design decision: that computers inside a LAN should only communicate with the server inside the LAN. routing traffic through the gateway to the external interface and then back in to the server creates extra complexity and sucks up extra system resources.

while this is probably more applicable to large networks, i think it's still good policy to be efficient whenever possible.
 
  


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 can I get my external IP address from behind a NAT? Moses420ca Linux - Networking 23 01-25-2013 05:35 AM
Can't access my apache2 webserver using external address from LAN eldoran Linux - Networking 6 10-26-2008 03:51 PM
apache webserver - can see from internal but not external filpee Linux - Networking 5 03-20-2005 12:31 AM
How do I get external IP address of router... The_JinJ Linux - Networking 2 02-05-2005 07:43 AM
external ip address dica Linux - Networking 8 10-05-2003 09:57 PM

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

All times are GMT -5. The time now is 11:25 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