LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-11-2007, 04:52 AM   #1
jtatarin
LQ Newbie
 
Registered: Mar 2007
Posts: 10

Rep: Reputation: 0
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.
 
Old 03-11-2007, 10:59 AM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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

Last edited by JimBass; 03-11-2007 at 11:00 AM.
 
Old 03-11-2007, 10:17 PM   #3
jtatarin
LQ Newbie
 
Registered: Mar 2007
Posts: 10

Original Poster
Rep: Reputation: 0
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?
 
Old 03-11-2007, 10:36 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
Old 03-12-2007, 12:56 PM   #5
jtatarin
LQ Newbie
 
Registered: Mar 2007
Posts: 10

Original Poster
Rep: Reputation: 0
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?
 
Old 03-12-2007, 01:22 PM   #6
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu + Kubuntu + Xubuntu + edubuntu + Ubuntu Server linux-ishu Ubuntu 12 01-17-2008 07:55 PM
Using Ubuntu...trying to connect to router jlsp Linux - Networking 2 02-17-2007 12:06 PM
RH8 server is NAT router, but getting a new router. WorldBuilder Linux - Networking 1 06-08-2006 05:54 PM
Win2k and ubuntu router tokenringman38 Linux - Newbie 6 06-04-2006 05:09 AM
ubuntu box as router tnadenichek Linux - Networking 6 05-09-2005 02:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration