Difference between revisions of "Basic DHCP Server Setup"

From CSLabsWiki
Jump to: navigation, search
(Changed DNS IPs)
(Improved config)
Line 1: Line 1:
 
==What is this?==
 
==What is this?==
This page describes the setup of a basic dhcp server for the 144 subnet to get the lab machines in COSI and the ITL online using a host with only one NIC.
+
This page describes the setup of a basic dhcp server to get the lab machines in COSI and the ITL online using a host with only one NIC.
The setup described was used in January 2014 to quickly get the lab back online using CRUX 3.1.
+
The setup described was based on one that was used in January 2014 to quickly get the lab back online using CRUX 3.1 after a failed server.
 +
 
 +
This setup is suitable for long-term use.
  
 
==Setup==
 
==Setup==
Line 11: Line 13:
 
This will place a startup script in /etc/rc.d/. (At least with sysV) You may want to enable it to run on startup.
 
This will place a startup script in /etc/rc.d/. (At least with sysV) You may want to enable it to run on startup.
  
You need to set a static IP on the DHCP server box. Instructions to do this can be found elsewhere. You need to pick one in the 144 subnet if you only have one NIC.
+
You need to set a static IP on the DHCP server box. Instructions to do this can be found elsewhere.
  
Once you have a static IP, configure the DHCP server by modifying /etc/dhcpd.conf. The example below assumes that the address of the PXE server (if applicable) is 128.153.145.AAA. Pick your IP range carefully. In this example it goes from 128.153.144.150 to 128.153.144.254.
+
Once you have a static IP, configure the DHCP server by modifying /etc/dhcpd.conf. The example below assumes that the address of the PXE server (if applicable) is 128.153.145.10. Pick your IP range carefully. In this example it goes from 128.153.144.150 to 128.153.144.254.
  
 
<code><pre>
 
<code><pre>
 
option domain-name-servers 128.153.0.254,128.153.5.254;
 
option domain-name-servers 128.153.0.254,128.153.5.254;
 
option domain-name "clarkson.edu";
 
option domain-name "clarkson.edu";
option subnet-mask 255.255.255.0;
+
option subnet-mask 255.255.254.0;
 
option routers 128.153.144.1;
 
option routers 128.153.144.1;
subnet 128.153.144.0 netmask 255.255.255.0 {
+
authoritative;
 +
subnet 128.153.144.0 netmask 255.255.254.0 {
 
range 128.153.144.150 128.153.144.254;
 
range 128.153.144.150 128.153.144.254;
 
}
 
}
 
allow booting;
 
allow booting;
 
allow bootp;
 
allow bootp;
next-server 128.153.145.AAA;
+
next-server 128.153.145.10;
 
filename "/pxe/pxelinux.0";
 
filename "/pxe/pxelinux.0";
 +
 
</pre></code>
 
</pre></code>
 +
 +
Make sure to touch /var/db/dhcpd.leases or the server will fail silently.
  
 
Then, just start dhcpd and it should hopefully work.
 
Then, just start dhcpd and it should hopefully work.

Revision as of 20:35, 13 June 2015

What is this?

This page describes the setup of a basic dhcp server to get the lab machines in COSI and the ITL online using a host with only one NIC. The setup described was based on one that was used in January 2014 to quickly get the lab back online using CRUX 3.1 after a failed server.

This setup is suitable for long-term use.

Setup

Install a dhcp server. On CRUX, this is:

prt-get depinst dhcp

This will place a startup script in /etc/rc.d/. (At least with sysV) You may want to enable it to run on startup.

You need to set a static IP on the DHCP server box. Instructions to do this can be found elsewhere.

Once you have a static IP, configure the DHCP server by modifying /etc/dhcpd.conf. The example below assumes that the address of the PXE server (if applicable) is 128.153.145.10. Pick your IP range carefully. In this example it goes from 128.153.144.150 to 128.153.144.254.

option domain-name-servers 128.153.0.254,128.153.5.254;
option domain-name "clarkson.edu";
option subnet-mask 255.255.254.0;
option routers 128.153.144.1;
authoritative;
subnet 128.153.144.0 netmask 255.255.254.0 {
	range 128.153.144.150 128.153.144.254;
}
allow booting;
allow bootp;
next-server 128.153.145.10;
filename "/pxe/pxelinux.0";

Make sure to touch /var/db/dhcpd.leases or the server will fail silently.

Then, just start dhcpd and it should hopefully work.