[Hampshire] accessing a server from within a LAN using the e…

Top Page

Reply to this message
Author: Victor Churchill
Date:  
To: Hampshire LUG Discussion List
Subject: [Hampshire] accessing a server from within a LAN using the external address does not work - why?
Hi,

I know I have come across this self same issue years ago when setting
up an IPCop for an office LAN, but I cannot remember the logic behind
it and wonder if somebody can clarify what is going on.

Simple topology:

Browser
192.168.11.6
|
|    Server
|    192.168.11.5
|       |

Internal Router
192.168.11.1
|
Cable Modem
82.999.999.198 (spot the obfuscated IP address)
variable
|
t'Internet


I have Apache2 on the server. The server is temporarily lodging in my
spare room while the company finds a new office (and some money to pay
for it...)
I have set up port forwarding on the Buffalo AirStation internal
router so that it allows http traffic to the server.

I can verify that the Buffalo is routing incoming traffic to the
Server by ssh'ing to a different external box on the 'Net; from there
I can say 'lynx http://82.999.999.198' and I see the appropriate
'Apache
yada yada server at 82.999.999.198 port 80' message. I can also do
this via a dynamic DNS name that I have set up 'victor.something.nu'

There are services I'd like to get at on the server while it is within
my home LAN but that may be the subject of a later mail. Right now I
find that from the Browser I can't see the Server by its external IP
address, nor by the dynamic DNS address, but I can see it when I
browse to the internal address.

http://192.168.11.5/ ... see Apache server response
http://82.999.999.198/ ... I see my Buffalo Router control page!! :-/
http://victor.something.nu/ ... same Buffalo router control page.

Obviously the Buffalo is doing the right thing with traffic from the
outside world and routing it to the server on the internal LAN.
But with requests coming from within the LAN it is returning its own
login page the same as if I had browsed to http://192.168.11.1/

Why is that?



p.s. In case anyone wonders why it matters:

On this server I have Apache2 (under Ubuntu 8.10) and a number of
virtual hosts for subdomains dev.example.net, trac.example.net,
wiki.example.net, svn.example.net etc. The virtual hosts are set up
based on an old static IP address from when the box was in the company
office in Sunbury. Now it is not there any more I would like to alter
the Apache config so that those hosts are available to me internally
and also to co workers externally. Previously the company's ISP was
set up to route traffic to xxx.example.net to the old office fixed IP
address 217.34. 999.999 (where xxx ⊂ [dev,trac,svn,wiki,mymeter] ),
but that fixed IP is no longer alive.

This will, I think, mean editing various files in the sites-available
directory.
E.g. for the files below, where the server used to map the virtual
hosts svn.example.net and trac.example.net to the fixed IP address
217.34.221.999, I expect to have to map it to the internal address
192.168.11.5 :
File /etc/apache2/trac.example.net
<VirtualHost 217.34.221.999:443>
ServerName trac.example.net

File /etc/apache2/svn.example.net
<VirtualHost 217.34.221.999:443>
ServerName svn.example.net

I hope that makes sense.

any comments gratefuly received!