Sorry if this sounds a bit muddled; I am fairly new to networking. My goal is to have two or more subnets on one network. When I add a new server to the network (a virtual machine), I want to be able to have an external application run a command on the server that tells it which subnet to get on. To do do this, I believe that I must specify multiple subnets in my dhcpd.conf file on my router, each with its own private IP:
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.0.0 netmask 255.255.255.0 {
use-host-decl-names on;
option routers 192.168.0.1;
option domain-name-servers 10.15.1.40;
range 192.168.0.2 192.168.0.250;
}
subnet 192.168.1.0 netmask 255.255.255.0 {
use-host-decl-names on;
option routers 192.168.1.1;
option domain-name-servers 10.15.1.40;
range 192.168.1.2 192.168.1.250;
}
My question is, how do I tell the new server which of the router's IPs it needs to contact to set up its networking? Is there a configuration file I can edit with a boot script to specify the router IP? As far as I know when there's only one router IP on a switch it gets the router's private IP automagically.
The servers are CentOS 5 and the router is Debian.