Page 1 of 1

Problems with server access

Posted: 24 Aug 2011, 12:12
by ole
hi,
My internet connection at home are like this:

|1|Fiber connection|| --> |2|regular router|| --> |3|web server||

I use a domain address (pointing to my external IP) to assess the server.
The first router (#1) are managed by my ISP and I can only access it through their webpages. I have set this router in DMZ. All port forwarding are done in my router (#2).

Today I have problems using the domain when I am home (behind the router). When I type in my domain name or external IP, my computer tries to access router #1, and I get a "username/password required" message.
This cause problems when I create backup scripts, This means I have to choose between using my external or local IP. I have clanged the hosts file on my Desktop PC, but I cannot do this on my Laptop because I use it to access the server when I'm not home

Can anyone tell me if I get the same problem if I use B3 as router and web server (replace #2 and #3 with b3).

Just ask if you don't understand my explanation, and sorry for my bad English.

Thank you :)

Re: Problems with server access

Posted: 24 Aug 2011, 17:14
by Ubi
router #1 is not in your schedule, unless router #2 is the same as router #1. If not, you seem to have 3 routers in serial?? In both cases I failed to understand what you mean. Can you elaborate?

Re: Problems with server access

Posted: 24 Aug 2011, 17:55
by ole
#1 is a box where the fiber cable comes in, and it have two Ethernet ports for tv, and one for internet. This "router" is only accessible through my ISP's webpage. I can only choose some basic settings like wifi and firewall.
I connected a D-link router in #1 and do all the management like port forwarding etc from this one. I hopes this was more clarifying

Re: Problems with server access

Posted: 25 Aug 2011, 15:18
by Ubi
So, when you type in your external IP from the outside world, you get the correct response (meaning: you get Bubba). However, when you enter the external IP address from within the LAN, you get the webhost of your #1 router. This is a routing issue in your router #1. This box is actually the only box in your network that really has this IP address, so it is correct in answering to your IP request.

Will this behavior stop when you insert your bubba between your desktop and your #1 router? No.
Can you change Bubba so that it does work the way you want it? Yes, but it requires some high-skill IPtables hacking. It's certainly possible though.

The easier route I think is getting your #1 router to forward request coming from LAN to a specific internal address.

Re: Problems with server access

Posted: 25 Aug 2011, 16:21
by ole
Thank you very much for you reply :) One last question
Is it possible to set up a local DNS server on the b3 that redirect "my-domain-com" to the b3's local IP?
Will this make it possible for me to use "my-domain-com" both home and world wide?

Re: Problems with server access

Posted: 25 Aug 2011, 18:49
by 6feet5
A quick fix (instead of a local DNS) is to change your hosts file on your computer so the address point to the b3 address.

I've had a similar problem where I can reach the server from the outside, but trying from the inside will fail. I never figured out why the router refused to forward the request when sent from the inside (restarting it would help, but after a couple of days it no longer worked, crappy firmware I guess). The easy fix was adding an entry to the hosts file. Perhaps not the best solution, but it worked for me :-)

/Johan

Re: Problems with server access

Posted: 26 Aug 2011, 03:54
by ole
Thank you, but as I wrote in my first post. I have done this for my desktop computers, and i works well. This solution cause problems with my laptop since I often use it to connect to my server when I'm not home.

I wonder if it possible to use b3 as a local DNS server so it automatically redirects mydomain to the servers local IP? (in this case I am planing to replace the b3 with #2 and #3).

Thanks for all help

Re: Problems with server access

Posted: 26 Aug 2011, 04:28
by ryz
There is already an DNS server running on the B3 which has the host name of the B3 in it so that you can use that name to access the B3. Adding an new host name should most likely not be to difficult but I do not know how since I never have done it.

Re: Problems with server access

Posted: 26 Aug 2011, 06:58
by Ubi
it's quite easy, there are many help pages
http://tldp.org/HOWTO/DNS-HOWTO.html
http://www.brennan.id.au/08-Domain_Name ... _BIND.html

Be sure to make your desktop/laptop add the B3 in their nameserver list if you do not use the B3 as a DHCP server!

Re: Problems with server access

Posted: 26 Aug 2011, 18:00
by ole
Thank you all for good feedback!