Forum Home
Press F1
 
Thread ID: 55898 2005-03-22 06:03:00 LAN + Router + Home mail/web server = Few troubles l0gic (6781) Press F1
Post ID Timestamp Content User
336853 2005-03-22 06:03:00 Hey guys, I've just set myself up a nice little RH9 box to host a few of my little websites and to run my email aswell..

But I have a few problems accessing the server from within the internal LAN.

Ok so..

Server IP - 192.168.1.200
Laptop IP - 192.168.1.3
Router IP - 192.168.1.254 ( And also the static external IP )
Domain Name ( example.com from here on ) poiting to the routers external IP

Router is a Nokia M1122.

From anywhere outside of my 192.168.1.* LAN I can browse to www.example.com and see my website, can also check webmail, etc..

From in side my 192.168.1.* LAN, I can only access the server by browsing to the servers IP ( http://192.168.1.200/ ) - If I try to browse to www.example.com I just get the routers login page.

Now, I know I can edit my hosts file to just redirect any connections to www.example.com to 192.168.1.200 but this really isn't that good as I also like to use my laptop at work, and if it connects to 192.168.1.200 on my works network it'll find nothing.

Does anyone know how I can set my router to ignore these requests?

I was thinking of trying to set my router to use a different port for it's web interface, but the option doesn't seem to be there.

Any help would be great.

P.S.
I've set the router up to forward http requests on port 80 to my server.. 'Pin hole' I believe these rules are called.
l0gic (6781)
336854 2005-03-22 06:48:00 I'm not quite sure what the problem is. The router shouldn't do anything if a host on the 192.168.1.x LAN wants to contact another hoston the LAN. A router handles access to and from the outside world. The 192 range isn't routable.

I would just put a line for the server in the laptop's hosts file like:
"192.168.1.200 www.example.home example myserver "

Then you could do "http://example" or any of the other names (aliases) you want to give it.

As soon as you use the external name (presumably registered in the DNS system) it must use an external "real" IP address, and the only way you can access it is by going out through the router then back again.
Graham L (2)
336855 2005-03-22 07:02:00 you could set up the server as a DNS server......

all computers in the 192.168 world check the server for DNS.

the server is set to give a dns of 192.168.1.200 for example.com and hand off to your ISPs DNS for all other DNS stuff.
robsonde (120)
336856 2005-03-22 07:08:00 you could set up the server as a DNS server......

all computers in the 192.168 world check the server for DNS.

the server is set to give a dns of 192.168.1.200 for example.com and hand off to your ISPs DNS for all other DNS stuff.

Gross overkill. There is a server, one client and a router in the LAN. A hosts file is quicker. And better. The KISS principle applies here. It's non-trivial setting up a DNS server.

Apart from anything else, the name "www.example.com" should have one and only one (routable) IP address associated with it. A DNS server should never be set up to tell lies.
Graham L (2)
336857 2005-03-22 07:24:00 Gross overkill . There is a server, one client and a router in the LAN . A hosts file is quicker . And better . The KISS principle applies here . It's non-trivial setting up a DNS server .

Apart from anything else, the name "www . example . com" should have one and only one (routable) IP address associated with it . A DNS server should never be set up to tell lies .


sorry , i dident see that you only have one other computer in the system .


however for a system where more computers are involved i think the internal DNS system is best, as for having a DNS server that gives a difrent IP for internal to external . . . . I see nothing wrong with it . how is is such a bad thing?
robsonde (120)
336858 2005-03-22 07:27:00 I'm not quite sure what the problem is. The router shouldn't do anything if a host on the 192.168.1.x LAN wants to contact another hoston the LAN. A router handles access to and from the outside world. The 192 range isn't routable.

The problem is that I have an actual domain name.. And when I type that name into a browser it goes to DNS and then the DNS server points back to my routers external IP, which if I'm behind my router (if I'm connected to my home 192.168.1.* LAN) the router takes over and you see the web-interface.

It works fine from any other location outside of my home LAN.


I would just put a line for the server in the laptop's hosts file like:
"192.168.1.200 www.example.home example myserver "

Then you could do "http://example" or any of the other names (aliases) you want to give it.

This is what I was using, but because I move a lot between my home LAN and my works LAN, I'm constantly having to comment/uncomment the line in my hosts file.. Which is quite a hassle when I have to do it 6+ times a day.


As soon as you use the external name (presumably registered in the DNS system) it must use an external "real" IP address, and the only way you can access it is by going out through the router then back again.

Exactly that, when connected to my home LAN and I type www.example.com (not my actual domain name) into my browser it'll go out through the router to my DNS servers, which then point back at my routers external IP, which is correct. But my router shows me the web-interface for the router instead of the webpage on the server. - If I plug in at work and type www.example.com into my browser it'll go straight to the webpage on the server.

--

I'm not really new to networking or anything.. Basically all I want to do is tell my router to only listen for http requests on a port other than 80.. So that instead of it pulling it's web-interface out, it'll pass me through to my server.

But the option isn't anywhere to be found in the router.

:(
l0gic (6781)
336859 2005-03-22 07:40:00 As I said, where is the problem? You don't need to keep changing the hosts file .

You use the registered external name when you are at work . That uses the DNS address resolution, and routers link you with your server behind your router . You use the different, local, name which is handled by the hosts file when you are at home . When yyou are at home, you are in the same network as the server . Routing is neither needed nor desirable . Make the hosts file, then leave it alone .

There isn't an option in the router to tell it to route to the LAN from the LAN . That's not how it works . Routers act as gateways between networks .

Why go looking for complicated ways of doing something straightforward?
Graham L (2)
336860 2005-03-22 07:59:00 Hrmmn, I might have to stick with the hosts thing then.

I was hoping on being able to enter www.example.com from either location and see the same thing.
l0gic (6781)
336861 2005-03-22 11:50:00 l0gic,

You suggested the best way which was changing your host file to point to it, another alternative is to create your own caching DNS server, good thing about this, if the primary fails (your own) then the secondary DNS server will be used, and this will pick up your site, so no need to change the host file.

Cheers,


KK
Kame (312)
336862 2005-03-22 22:55:00 Hrmmn, I might have to stick with the hosts thing then.

I was hoping on being able to enter www.example.com from either location and see the same thing.

I had exactly the same problem as you but fortunately my router had an option to change the port number that you use to access it. All I did was change it to a different number and then hey presto any requests from inside or outside my lan went straight to my website. Im guessing your stuck if you router doesnt have this option.

B.
Barnabas (4562)
1 2