LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Ubuntu 6.10 Server With Router (http://www.linuxquestions.org/questions/linux-server-73/ubuntu-6-10-server-with-router-536479/)

jtatarin 03-11-2007 04:52 AM

Ubuntu 6.10 Server With Router
 
Hello. I've installed a simple LAMP server using SSH on a workstation on my network and everything is working fine inside my network but I can't access my server outside of my network. I have read countless linux articles and tutorials but I haven't found the solution to my problem. I have followed the tutorial here howtoforge.com/perfect_setup_ubuntu_6.10_p3 but I think I am not understanding one of the steps when it comes down to binding a static IP to my box so it can be used behind my linksys 4-port router. What settings do I need to put in my /etc/network/interfaces file? The tutorial suggests:

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

However I'm not sure what I need to put in for each value.

The lan IP i'd like my linux box to use is 192.168.1.9. I can access my router by 192.168.1.1 My netmask is 255.255.255.0. My WAN Ip is 67.49.90.44. Im not sure what I neet to put in for network gateway and broadcast. I was able to access my box from within the network by removing gateway broadcast and network and putting in the same valus I do for my windows maching but I was unable to log in from outside.. I have opened all the ports I needed in my router. I'm pretty sure all I need to figure out is this file.

JimBass 03-11-2007 10:59 AM

No, the problem is on the router. If you have assigned 192.168.1.9 to the LAMP server, then the router needs to be configured to port forward any requests it receives at port 80 on the public address on the internal address 192.168.1.9 at port 80.

As long as on the LAN you can see the site by 192.168.1.9 in the address bar, then just get the port forwarding set from the 67.49.90.44 at 80 to 192.168.1.9 at 80.

The gateway is the router's address, which you said is 192.168.1.1, and broadcast is 192.168.1.255. This is all basic networking info. A little google time or a search here would have solved this for you easily.

Code:

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.9
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Peace,
JimBass

jtatarin 03-11-2007 10:17 PM

Thanks a bunch. I have re-installed linux on my server and try to re-do everything fresh. I am still unable to to browse my apache webserver from the internet. I know my server is connected because I am able to download packets via wget. I have added Those lines to my /etc/network/interfaces aswell. I can access my server via PUTTY using my WAN IP but I can't browse my webserver using my wan ip. Seems I have pinpointed the problem with apache there much be a config thats set up improperly. Any suggestions?

JimBass 03-11-2007 10:36 PM

Can you see the website on the linux box by sending another computer on your LAN to http://192.168.1.9 ? If that works and going to the WAN address doesn't, then it is 2 possible things.

1) The router is not forwarding correctly
2) Your ISP is blocking connections at port 80

If you only have one site on the machine, and you can reach it locally, then it also has to be fine for the public IP, it just becomes a question of if the public port 80 is correctly mapped to the private IP at port 80. Please double check that the same way you forward port 22 for SSH is also forwarded for port 80.

Peace,
JimBass

jtatarin 03-12-2007 12:56 PM

Hey Jim thanks for your reply. Yes I am able to view the website on my network by visiting 192.168.1.19. In apache's port config file I have port 80 and port 443 as suggested to howtoforge tutorial. Both ports have been opened in my router. It's interesting that I am only having problems with my webserver, my SSH server is working. I am now led to beleive the problem is my ISP blocking port 80 (socal.rr) however less than 2 weeks ago I was able to run a windows web server (abyss web server) on port 80 which worked. S0 either the that's not the problem or out of bad luck my ISP JUST blocked port 80 recently. I am going to try and change ports in the apache config file. Is there a way I can tell if my ISP blocked port 80, or do I just have to call them?

JimBass 03-12-2007 01:22 PM

I'd simply call, you're not doing anything wrong by asking if you can run a webserver.

The fact that it worked on windows but not on linux makes it sound even more like you don't have the mapping done right. You didn't mention that in your last post. You have to explicitly map WAN IP port 80 to 192.168.1.9 port 80.

If your ISP is recently blocking you, don't change apache at all. Leave it be at 80, and use your router to translate to port. If 80 is blocked, then have port 81 on the WAN IP forwarded to 192.168.1.9 port 80 on the LAN. The only drag about that is the url will then need to be changed to end with :81. That will be the case regardless of how you change the port if that is the problem. For example, what was http://yoursite.com will now become http://yoursite.com:81

Peace,
JimBass


All times are GMT -5. The time now is 08:13 AM.