PDA

View Full Version : Setting up Static Environs



tcollinson
09-04-2004, 04:24 AM
Here is what I am trying to do in order to set up a Developement/QA environment:

1) I currently have a single cable connection (which works wonderfully with Linux)

2) I am planning to connectr it to a router (most likely a 4 port but the number doesn't really matter a whole heck of alot)

3) To the router I will be connecting 3 systems
a) A client machine
b) A development server
c) A Quality Assurance server

4) The client machine will be used to test the applications built on the development and QA servers.

5) In order to test the applications on the server realistically I would like to be able to go out to the net and access the servers as if I were coming in from off site (I hope I am putting this into words correctly)

Problem: The router Dynamically assigns IP addresses to the Development and QA servers. Is there a way to force these to have a static IP address (a registered IP) all the time so that I can go to my browser and access each server from it's respective static IP (developent and QA servers both have different yet static IP addresses)?

All three systems are running Debian (HDD install of knoppix).

Thanks for any help!!

T

shah
09-04-2004, 05:35 AM
1) You can set all pc to have static ip even though your router masquerading dynamic ip. What you need is to edit /etc/network/interfaces in every pc.:
Remove any dhcp statment and change with static.
Example:

auto lo eth0
iface lo inet loopback


iface eth0 inet static
address 192.168.0.5 ** static ip of your pc.
netmask 255.255.255.0 ** every pc and router must have same netmask
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1 ** gateway= your router ip

2) Your QA server should run apache server if you want your client to access it through internet. To run apache server run this command in root konsole: /etc/iinit.d/apache start.
Or run this command: update-rc.d apache defaults ...if you want apache to run automatically on boot. The default knoppix workspace for web is in /var/www.
You can point apache to read or point it to other folder by editing /etc/apache/httpd.conf.
Register a domain name if you want it to be access from outside (net). Or you could register freely available dynamic domain name service out there, ex:dyndns.org.
To test from client without going through net, just point browser to your server ip.

Harry Kuhman
09-04-2004, 08:42 AM
2) I am planning to connectr it to a router (most likely a 4 port but the number doesn't really matter a whole heck of alot)
You might find that it indeed does matter a whoe heck of a lot what router that you use. Some, like the SMC I'm using now, indeed have awful support for assigning IP addresses; they are given out dynamically and there is little or nothing that can be done on the router side to control IP assignment. Others I've seen (in particularl a DLink a few friends have) have some great and much needed features here - they let you lock an IP address to a MAC address DHCP still hands out IP addresses, but if you tell the router that a MAC address should always get a certain IP address, it happens, even if you just booted that computer from a new Knoppix CD without installing to the hard drive. And, of course, the reserved address never gets given to any other computer (even if it has not been assigned in a while) avoiding conflicts.

I've also seen some routers that let you work with ISP's who provide multiple IP addresses to a customer, and will let the router recognize the multiple addresses and route them to the correct local computer. This is important if you have an ISP who does provide multiple IP addresses, as many of the home DSL/Cable routers only deal well with one routable Internet address.

Of course, you can defeat DHCP assignment in your setup if you want; but you're far better of in doing a little research before you buy a router and get one with the features you need. That way even if you boot Knoppix from a CD or any other live distribution disc, things will still work as you expect.