LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-31-2005, 06:06 AM   #1
Sapient
Member
 
Registered: Oct 2003
Location: San Luis Obispo, CA
Distribution: SuSE
Posts: 196

Rep: Reputation: 30
Question Static Server / Dynamic IP Router?


I am attempting to setup up an Apache server on a dynamic network going through a Linksys Router.


The Linksys Router IP addresses are updated by the ISP. This assigns the Gateway and DNS servers.


Router Configuration:

Current Time : Wed, 31 Aug 2005 03:39:22
MAC Address : xx:xx:xx:xx:xx:xx
Router Name : WRT54GS
Host Name : mind
Domain Name : www.hingedmind.com

Configuration Type Login Type : Automatic Configuration - DHCP

IP Address : 24.205.232.14
Subnet Mask : 255.255.255.0

Default Gateway : 24.205.232.1
DNS 1 : 66.215.64.14
DNS 2 : 24.205.1.14
DNS 3 : 24.205.224.36
MTU : 1500

On the LAN however, the Linksys Router’s IP address is 192.168.1.1.

Local Network Configuration:

MAC Address : xx:xx:xx:xx:xx:xx
IP Address : 192.168.1.1
Subnet Mask : 255.255.255.0
DHCP Server : Enabled
Start IP Address : 192.168.1.100
End IP Address : 192.168.1.103

I setup the SuSe / Apache server to be a static IP address (192.168.1.200) which is outside the range the Linksys Router issues. I have the router set for the maximum number of clients to be four. Therefore, the range for the LAN is 192.168.1.100 - 192.168.1.103.

I also set the SuSe server to use 192.168.1.1 as the default Gateway address. This is the default LAN address of the Linksys router.
I set the server static IP address through the YaST / Network Devices / Network Card / Host Name - Server Name and turned off DHCP update (SuSe Enterprise 9).

I then setup a port forward on the Linksys router to point all "HTTP" and "HTTPS" requests to port 8000 on server 192.168.1.200. I am going this route because I suspect my provider is blocking port 80, which is the default port for HTTP.

Result:

When I type the URL in a browser on the SuSe server http://www.hingedmind.com:8000 the correct page displays. Anywhere else on the LAN or outside shows the default “Page cannot be displayed”

mind: # lsof -i tcp:8000

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd2-pr 2949 root 3u IPv6 951843 TCP *:irdmi (LISTEN)
httpd2-pr 2950 wwwrun 3u IPv6 951843 TCP *:irdmi (LISTEN)
httpd2-pr 2951 wwwrun 3u IPv6 951843 TCP *:irdmi (LISTEN)
httpd2-pr 2952 wwwrun 3u IPv6 951843 TCP *:irdmi (LISTEN)
httpd2-pr 2953 wwwrun 3u IPv6 951843 TCP *:irdmi (LISTEN)
httpd2-pr 2954 wwwrun 3u IPv6 951843 TCP *:irdmi (LISTEN)
httpd2-pr 2962 wwwrun 3u IPv6 951843 TCP *:irdmi (LISTEN)
httpd2-pr 2963 wwwrun 3u IPv6 951843 TCP *:irdmi (LISTEN)


Questions:

1) Anything obvious?

2) Do I need to go into the /etc/services file and define port 8000 for http like 80 is?

Currently it is assigned to:

Port Status Protocol and Application

8000 OPEN! irdmi
iRDMI

3) Why is it that when I set the server to a static IP address of (192.168.1.200) the Linksys Router still shows it as (192.168.1.103 or one of the other IP addresses it assigns to the local network) when I show the “DHCP Clients Tables” from the Linksys Router.

4) Anything new I can try?

Everything worked fine before I relocated to a new state. Now nothing works. I also changed cable broadband providers in the relocation. I think they are blocking certain ports.
 
Old 08-31-2005, 01:55 PM   #2
shane25119
Member
 
Registered: Aug 2003
Location: Illinois
Distribution: Linux Mint XFCE
Posts: 654

Rep: Reputation: 53
Blocking ports sounds like a prime canidate here: you may want to try reconfiguringe Apache to give you http acccess on say port 82 and then give it a go. If you use IP redirection service like No-IP, they can auto redirect your IP for you.
 
Old 08-31-2005, 07:23 PM   #3
Sapient
Member
 
Registered: Oct 2003
Location: San Luis Obispo, CA
Distribution: SuSE
Posts: 196

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by shane25119
Blocking ports sounds like a prime canidate here: you may want to try reconfiguringe Apache to give you http acccess on say port 82 and then give it a go. If you use IP redirection service like No-IP, they can auto redirect your IP for you.

Thanks Shane.

I am attempting that with port 8000. If I look in the services file port 8000 is being used by the above service. Really trying to understand how I change that port to listen to http requests from the server side. I have Apache configured to listen on 8000. I also did a port forward on that port from the router.


Thanks
 
Old 09-01-2005, 05:51 AM   #4
Sapient
Member
 
Registered: Oct 2003
Location: San Luis Obispo, CA
Distribution: SuSE
Posts: 196

Original Poster
Rep: Reputation: 30
Update:


I am able to see the url locally when I type www.hingedmind.com:8000. I am not able to see it from any other computer on the LAN, however, I am able to see it if I use the static IP address I assigned i.e. 192.168.1.200:8000 from another computer.

This tells me I am listening on port 8000, so that seems to be working. Since I can see my virtual host locally (www.hingedmind.com:8000), that tells me Apache is correct.

mind: # lsof -i tcp:8000

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME

httpd2-pr 14281 root 3u IPv4 1908233 TCP www.hingedmind.com:http (LISTEN)
httpd2-pr 14282 wwwrun 3u IPv4 1908233 TCP www.hingedmind.com:http (LISTEN)
httpd2-pr 14283 wwwrun 3u IPv4 1908233 TCP www.hingedmind.com:http (LISTEN)
httpd2-pr 14284 wwwrun 3u IPv4 1908233 TCP www.hingedmind.com:http (LISTEN)
httpd2-pr 14285 wwwrun 3u IPv4 1908233 TCP www.hingedmind.com:http (LISTEN)
httpd2-pr 14286 wwwrun 3u IPv4 1908233 TCP www.hingedmind.com:http (LISTEN)
httpd2-pr 14303 wwwrun 3u IPv4 1908233 TCP www.hingedmind.com:http (LISTEN)

I am not sure why I cannot see the url www.hingedmind.com:8000 from another machine on the net; though I can see it using the static IP assigned 192.168.1.200:8000.

Perhaps router?
 
Old 09-01-2005, 12:45 PM   #5
Sapient
Member
 
Registered: Oct 2003
Location: San Luis Obispo, CA
Distribution: SuSE
Posts: 196

Original Poster
Rep: Reputation: 30
Current Configuration:


Apache:
Listen File:

<IfDefine SSL>
<IfDefine !NOSSL>
<IfModule mod_ssl.c>

Listen 443

</IfModule>
</IfDefine>
</IfDefine>

NameVirtualHost www.hingedmind.com:8000
Listen *:8000

Virtual Host:

<VirtualHost 192.168.1.200:8000>
ServerAdmin sapient@hingedmind.com
ServerName www.hingedmind.com
ServerAlias www.hingedmind.com

DocumentRoot /srv/www/htdocs

ErrorLog /var/log/apache2/hingedmind-error_log
CustomLog /var/log/apache2/hingedmind-access_log combined

HostnameLookups Off
UseCanonicalName Off
ServerSignature On

ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"

<Directory "/srv/www/cgi-bin">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>


<IfModule mod_userdir.c>
UserDir public_html
Include /etc/apache2/mod_userdir.conf
</IfModule>


<Directory "/srv/www/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>


Hosts File:

127.0.0.1 localhost

# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.1.200 www.hingedmind.com mind
 
Old 09-03-2005, 08:25 AM   #6
mickyg
Member
 
Registered: Oct 2004
Location: UK
Distribution: Ubuntu/Kubuntu
Posts: 249

Rep: Reputation: 30
Quote:
Questions:

1) Anything obvious? ...

I then setup a port forward on the Linksys router to point all "HTTP" and "HTTPS" requests to port 8000 on server 192.168.1.200. I am going this route because I suspect my provider is blocking port 80, which is the default port for HTTP.
First of all, why would your ISP block the default http port?

Anyway...

To me, this essentially makes 192.168.1.200 a proxy server and/or the gateway server for all other machines on the LAN and should be set up as such.

So basically what I understand is happening is this: 192.168.1.100 (PC on LAN) sends a request for http://www.google.co.uk (or whatever) to your Linksys router 192.168.1.1, which forwards the request to your ISP. Your ISP responds to 192.168.1.1 and because it's an HTTP request, your router now directs the response to 192.168.1.200. Which means 192.168.1.100 never gets a response and hence gives the messsage that the page cannot be displayed.


Quote:
3) Why is it that when I set the server to a static IP address of (192.168.1.200) the Linksys Router still shows it as (192.168.1.103 or one of the other IP addresses it assigns to the local network) when I show the “DHCP Clients Tables” from the Linksys Router.
When a DHCP server/router acting as a server assigns an IP to a client it gives that IP/MAC combination a lease time. Which means when the client disconnects from the LAN (i.e. PC is turned off) the DHCP server doesn't then give that IP address to the next connecting client straight away, it holds on to it until the lease expires or the PC reconnects and the lease is "refreshed". My guess would be the the lease time on your router is set to forever, meaning the router will always show the SuSE server as having a 'claim' to that IP. To sort this out change the lease time and wait for it to expire. This will release that IP address. You can then reset the lease time to forever if that's how you want it but this pretty much defeats the point of using a DHCP server when you only have 4 PCs on your network. You might as well set every PC to a static IP if you were going to set the lease time to forever.

Quote:
4) Anything new I can try?

Everything worked fine before I relocated to a new state. Now nothing works. I also changed cable broadband providers in the relocation. I think they are blocking certain ports.
Have you tried setting the SuSE server to be the default gateway or the proxy server on one of the other PC's on the LAN to see if that works?

Quote:
I am able to see the url locally when I type www.hingedmind.com:8000. I am not able to see it from any other computer on the LAN, however, I am able to see it if I use the static IP address I assigned i.e. 192.168.1.200:8000 from another computer.

This tells me I am listening on port 8000, so that seems to be working. Since I can see my virtual host locally (www.hingedmind.com:8000), that tells me Apache is correct.
This sounds to me like a DNS issue on the other PC on the LAN. It doesn't seem to be able to resolve the host name www.hindgedmind.com to the IP address 192.168.1.200. This is probably due to the fact that most home routers can't resolve host names to static IP because the router didn't assign the IP address so didn't ask for the hostname. They are generally only able to resolve host names of dynamically assigned IP address.

I don't know what OS you're using on the other PC's on your LAN but I would suggest looking in (i think it's) /etc/resolv.conf in Linux or C:\WINDOWS\system32\drivers\etc\hosts in windows 2k/XP and adding the hostname and IP address to that. These files act as a local DNS server to the machine. It should look in these files to resolve host names before going to it's DNS server.

Hope that's not too much to take in and I hope I've helped.
 
Old 09-03-2005, 12:57 PM   #7
Sapient
Member
 
Registered: Oct 2003
Location: San Luis Obispo, CA
Distribution: SuSE
Posts: 196

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by mickyg
First of all, why would your ISP block the default http port?

Anyway...

To me, this essentially makes 192.168.1.200 a proxy server and/or
the gateway server for all other machines on the LAN and should be set up as such.

So basically what I understand is happening is this: 192.168.1.100 (PC on LAN)
sends a request for http://www.google.co.uk (or whatever) to your Linksys
router 192.168.1.1, which forwards the request to your ISP. Your ISP responds to
192.168.1.1 and because it's an HTTP request, your router now directs the response to
192.168.1.200. Which means 192.168.1.100 never gets a response and hence gives the
messsage that the page cannot be displayed.



Get used to the ISP practice of blocking common ports. ISP's block common
ports, http 80, 8080 to discourage customers from running web servers. Most now offer
a business class static IP address.


-------
Architecture:

SUSE Enterprise server has a static IP of 192.168.1.200

SUSE Server is running Apache Web Server.

LAN is cable broadband through a Gateway Linksys Router with DHCP enabled.
The configuration on the Linksys router allows you to set a certain number of DHCP
users. If you set it for 4 then the router will hand out 4 IP addresses maximum to client machines.

The default router IP address is 192.168.1.1 which is for LAN (Internal network) only.
The ISP assigns the router IP address and three DNS servers (WAN).

I have four machines on my LAN, the router is configured to hand out four IP
addresses starting with 192.168.1.xxx. I set mine to start with 192.168.1.100.
The ranges is 192.168.1.100 – 192.168.1.103. Anytime there is a DHCP renew then
the client machines IP addresses can change within the range.

In this case, I also have a SUSE server with a static IP address that I set 192.168.1.200.
I set this outside the range so that it would not be changed. I set 192.168.1.1 (LAN/Internal
IP address for the Linksys router) as the gateway on the SUSE server.

On the Linksys router, I setup a port forward for any requests coming in on port 80
to be directed to 192.168.1.200, which is where the SUSE/Apache server resides.

Port Range

Application Start End Protocol IP Address Enable

http 80 80 tcp/udp 192.168.1.200 x
-----


Quote:
When a DHCP server/router acting as a server assigns an IP to a client it
gives that IP/MAC combination a lease time. Which means when the client disconnects
from the LAN (i.e. PC is turned off) the DHCP server doesn't then give that IP
address to the next connecting client straight away, it holds on to it until the lease
expires or the PC reconnects and the lease is "refreshed". My guess would be the
the lease time on your router is set to forever, meaning the router will always show
the SuSE server as having a 'claim' to that IP. To sort this out change the lease time
and wait for it to expire. This will release that IP address. You can then reset the
lease time to forever if that's how you want it but this pretty much defeats the point
of using a DHCP server when you only have 4 PCs on your network. You might as
well set every PC to a static IP if you were going to set the lease time to forever.
"Lease time is not set for eternity."

"Have you tried setting the SuSE server to be the default gateway or the proxy
server on one of the other PC's on the LAN to see if that works?"

"The Linksys router serves as the gateway. 192.168.1.1 All other machines on the
LAN are Windows."


Quote:
This sounds to me like a DNS issue on the other PC on the LAN. It doesn't
seem to be able to resolve the host name www.hindgedmind.com to the
IP address 192.168.1.200. This is probably due to the fact that most home routers
can't resolve host names to static IP because the router didn't assign the IP address
so didn't ask for the hostname. They are generally only able to resolve host names of
dynamically assigned IP address.
"Linksys makes this possible."


Quote:
I don't know what OS you're using on the other PC's on your LAN but I would suggest
looking in (i think it's) /etc/resolv.conf in Linux or C:\WINDOWS\system32\drivers\etc\hosts in
windows 2k/XP and adding the hostname and IP address to that. These files act as a local DNS
server to the machine. It should look in these files to resolve host names before going to it's
DNS server.
"I had this done already."

"Currently I can see the url www.hingedmind.com from any machine on the LAN.
Outside they are getting the default error “The page cannot be displayed”."


Quote:
Hope that's not too much to take in and I hope I've helped.
"I appreciate all help and thoughts. Thanks,"
 
Old 09-04-2005, 06:03 AM   #8
Sapient
Member
 
Registered: Oct 2003
Location: San Luis Obispo, CA
Distribution: SuSE
Posts: 196

Original Poster
Rep: Reputation: 30
I checked my resolv.conf file and it looks correct.


nameserver 66.215.64.14
nameserver 24.205.1.14
nameserver 24.205.224.36
search www.hingedmind.com
 
Old 09-04-2005, 05:45 PM   #9
shane25119
Member
 
Registered: Aug 2003
Location: Illinois
Distribution: Linux Mint XFCE
Posts: 654

Rep: Reputation: 53
Try this...

My ISP (SBC) allows me to use port 80, but for some reason on my network I can only see my pages by using the local address. Ask someone outside your network (i.e. post it here) to check it out and see if it works.
 
Old 09-04-2005, 05:56 PM   #10
Sapient
Member
 
Registered: Oct 2003
Location: San Luis Obispo, CA
Distribution: SuSE
Posts: 196

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by shane25119
Try this...

My ISP (SBC) allows me to use port 80, but for some reason on my network I can only see my pages by using the local address. Ask someone outside your network (i.e. post it here) to check it out and see if it works.

Thanks for the response Shane.

I have done that several times. They are getting "Page cannot be displayed" error.

If you get a chance, ping this and let me know what you get in return. www.hingedmind.com
 
Old 09-04-2005, 09:32 PM   #11
shane25119
Member
 
Registered: Aug 2003
Location: Illinois
Distribution: Linux Mint XFCE
Posts: 654

Rep: Reputation: 53
I'm getting a host not found.... have you had others try pinging you by IP?
 
Old 09-05-2005, 06:00 AM   #12
Sapient
Member
 
Registered: Oct 2003
Location: San Luis Obispo, CA
Distribution: SuSE
Posts: 196

Original Poster
Rep: Reputation: 30
Shane, give it another try. I think there was another problem.

Try pinging www.hingedmind.com


Thanks
 
Old 09-05-2005, 11:55 AM   #13
mickyg
Member
 
Registered: Oct 2004
Location: UK
Distribution: Ubuntu/Kubuntu
Posts: 249

Rep: Reputation: 30
I tried pinging it:

C:\Documents and Settings\mickyg>ping www.hingedmind.com

Pinging www.hingedmind.com [24.205.232.14] with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 24.205.232.14:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

p.s. completely got the wrong end of the stick with my earlier thread, thought pc's on your local LAN couldn't connect, didn't realise you meant PC's from the Internet.

Just a thought, shouldn't this web server be on a DMZ?
 
Old 09-05-2005, 12:02 PM   #14
bheibert
LQ Newbie
 
Registered: Sep 2005
Location: Lafayette IN USA
Posts: 2

Rep: Reputation: 0
Router & Linux

I am new here

I have a router
Here is what my Mac networking says:
I want to get internet setup on my iBook laptop running Ubuntu Linux

Configure IPv4: Using DHCP
IP Adress: 192.168.0.100
Subnet Mask: 255.255.255.0
Router: 192.168.0.1
DHCP Client ID: heibert
IPv6 address: fe80:0000:0000:0000:020a:95ff:fe75:8238

How do I set it up in Linux?

My other machine running MacOS X is setup for internet

If there is any other information needed let me know
 
Old 09-05-2005, 02:25 PM   #15
shane25119
Member
 
Registered: Aug 2003
Location: Illinois
Distribution: Linux Mint XFCE
Posts: 654

Rep: Reputation: 53
I am still getting a request timed out here....

You may want to recheck your router's configuration, that you are allowing port 80 to go to the IP address of the server.

as for the new member's question: That should do the tick, you shouldn't need anything special, Ubuntu should just recognize your ethernet connection.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
IP Addressing static and dynamic Hockeyfan Linux - Networking 1 10-24-2005 07:06 PM
Dynamic IP to Static Temujin_12 *BSD 2 06-10-2005 04:58 PM
changing from dynamic to static ip sterrenkijker Debian 4 05-24-2004 04:11 PM
Static vs Dynamic Big Al Linux - Networking 2 12-08-2003 03:10 PM
NS with static or dynamic IP cijunet Linux - Networking 3 05-08-2003 11:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:34 PM.

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