Click to See Complete Forum and Search --> : Webserver/port access problems.


Gogeta_44
06-13-2004, 09:48 PM
I'm trying to run a webserver from Slackware machine but i'm having problems. I'm using apache (httpd) and I have a host setup on dyndns.org . I have a linksys router with the ip 192.168.6.106 When i give it the ip 192.168.6.106 (the ip that the router assigns me) it works fine but only for people on networked to my router. I found that most routers assign 192.168.x.xxx to you. I found my "real" ip when i went to www.ip-calculator.com (i'll refer to it as 45.233.367.798 but im not going to post my ip on the net). So when i give dyndns 192.168.6.106 it works for people on my network but no one else. Now when i give dyndns 45.233.367.798 it asks for my routers username and password. This sounded like a very simple problem. At first, i thought port 80 must be closed, ran nmap on:
192.168.6.1
192.168.6.106
45.233.367.798
and all of them had 1 thing in common, port 80 was always open! I have no idea way its not working! Please help me.

Gaxus
06-13-2004, 10:22 PM
I have this problem with my belkin router. Hopefully your router is not as dumb as mine, but I'll post what the problem is on mine just in case.

Something you should do before hand though is to make sure that you have configured port forwarding for port 80 to the local ip of the webserver. Either that or make sure your webserver is set up as a DMZ...

Now on to the problem...

What happens is because you are part of the local network, the router identifies you as someone who is allowed access to its own web interface.

The following is how I interpreted the problem that was happening to me, although I am by far no network guru so if I am wrong in some aspect I would love to be corrected.

192.168.2.2 = the local machine wanting to connect to the server
http://jl.dyndns.org = the domain name of the server
45.233.367.798 = the internet ip
192.168.2.3 = the local ip of the webserver's machine


192.168.2.2 wants to access http://jl.dyndns.org
192.168.2.1 (router) gets request from 192.168.2.2
192.168.2.1 (router) looks up jl.dyndns.org
192.168.2.1 (router) finds this to be 45.233.367.798
192.168.2.1 (router) says "Hey! I know this IP ADDRESS, IT IS MY ADDRESS!"
192.168.2.1 (router) says "192.168.2.2 wants to access port 80 on 45.233.367.798-- which is me!"
192.168.2.1 (router) says "Because 192.168.2.2 is a local machine he is my friend, and so he's allowed to look at my goodies!!!"
192.168.2.1 (router) displays its own web server login screen to 192.168.2.2


You still want to set 45.233.367.798 as the IP in dyndns.

This way all connections made outside of your local network should connect fine to the proper server. The router will/should obviously reject any connections made to it on port 80 that are from the outside. Although in your case you don't want it to reject them, but forward them to the correct local IP of your webserver (set up port forwarding...).

What this means though, is that just your local machines will be unable to access your web server via the dyndns domain name.

A way to solve this is to edit the /etc/hosts file and map the domain name to the correct IP.

(lets say 192.168.2.3 is your webservers local ip) E.G:


192.168.2.3 jl.dyndns.org


With windoze there is also a file called HOSTS (or maybe host?) you will have to edit, but you're gonna have to search your hd for that one. ;)

dcg
06-13-2004, 10:24 PM
hey

i guess my first question is: when you say "Now when i give dyndns 45.233.367.798", do you mean that you statically assign this ip address to that particular computer system? if so, is this computer still "behind" that router, as in protected from the internet by that router? additionally, did your isp assign you a static, public ip address?

Gogeta_44
06-14-2004, 01:02 AM
Thanks for the help!
I have a couple questions:
My wedsite name is darkstar44.homelinux.net and the ip my router assigns me is 192.168.6.106 so do i add:

192.168.6.106 darkstar44.homelinux.net

to the hosts file? I just changed the ip of dyndns to 45.233.367.798. And is that all i should do?

Gaxus
06-14-2004, 07:55 AM
Yes, and remember to set up port forwarding. I think that should be fine!

I think the best way to test it would be just to ask someone who is located outside of your local network to try to connect to it by using the dyndns domain name.

Also you may want to add other aliases to the hosts file, e.g. if you are going to be using the 'www' subdomain (remember, dyndns supports wildcards, although it doesn't really seem to work so well):


192.168.6.106 darkstar44.homelinux.net www.darkstar44.homelinux.net


That will alias both domain names to go to 192.168.6.106 instead of resolving with a DNS.

But remember that this host file needs to be updated for each local machine who wants to access your computer using that domain name instead of typing in that local ip... this isn't a server-side solution unfortunately.

Gogeta_44
06-14-2004, 10:57 AM
So does that meen anyone who wants to access my website has to put it in there hosts file?!?!?!

EDIT:Looking back it looks like i need to setup port forwarding to my local ip (192.168.6.106), how would i do that?

Gaxus
06-14-2004, 11:10 AM
So does that meen anyone who wants to access my website has to put it in there hosts file?!?!?!
No. Only those people who are inside your network and who wish to access your machine by entering the dyndns domain name need to put it in their hosts file (that includes your webserver's computer as well).

Other wise they can still access it by entering the machine's local IP in their web browser: http://192.168.6.106

:Looking back it looks like i need to setup port forwarding to my local ip (192.168.6.106), how would i do that?
Your router should handle it. Read its documentation; it should be somewhere. Most likely you will find you can configure it in the router's web configuration thingy:

http://192.168.6.1

Gogeta_44
06-14-2004, 11:12 AM
Thanks! everyone's been a real help! Now all I have to do is try to find my router password.

Gogeta_44
06-14-2004, 04:12 PM
I got my router password and I modified:
1.Under DHCP I added 192.168.6.106
2.Under DDNS I added my account/host info but it says "DDNS server is currently closed." under status.
3.And finally under forwarding and then UPnP i enabled port forwarding from port 80 using tcp to 192.168.6.106.

I'm not sure if it works but i know that the same things happen with people on my network (cant use my domain and have to get to it through my ip). Could someone go to http://darkstar44.homelinux.net and tell me if it works. (note you should see "under construction")

Thanks!

EDIT:3.And finally under forwarding and then UPnP i enabled port forwarding from port 80 using tcp to 192.168.6.106.
I just had to disable it because with it on i cant get to my router through 45.233.367.798 and i have to use 192.168.6.1.

Edit2:also, my ip, 45.233.367.798 i'm told is dynamic (not static) but has never changed.

Gaxus
06-14-2004, 04:35 PM
I just had to disable it because with it on i cant get to my router through 45.233.367.798 and i have to use 192.168.6.1.

That is what is meant to happen! That is the whole problem/point!!! Connecting to your router's screen via its local IP only is no problem, and is what is meant to happen anyway! I saw this thread a min ago and was connected to your site; then it just timed out when I tried to click on the "here" link!!! Re-enable it dammit! :mad: :p

Gogeta_44
06-14-2004, 04:37 PM
ok, there. tell me if it works now.

Gaxus
06-14-2004, 04:39 PM
Welcome to Slackware Haven, another unofficial site for slackware help and packages. Right now we're under heavy construction.


Legal-
Slackware is a registered trademark of Patrick Volkerding and Slackware Linux, Inc. We agree to follow the terms and conditions at: http://slackware.com/trademark/trademark.php.

Slackware Haven is copyright 2004


Works for me now. :D ;)

Gogeta_44
06-14-2004, 04:41 PM
Thanks to everyone who helped me with this!!!!!!!
Now i have a working dns site!!
:D :D :D :) :) :D :D :D