ET1530: Project - Week 11 - 13

Configuring DHCP Server for Both LAN and WLAN

 (Adapted from: https://help.ubuntu.com)

We will provide configuration settings for the DHCP server using the following methods:

·         Manual allocation (MAC address)

We will use this to assign IP addresses to servers in the trusted network and DMZ; and any addressable network devices.

·         Dynamic allocation (address pool)

All guest users are to have IP addresses in the range 10.1.1.200-220 using dynamic allocation.

·         Automatic allocation (using MAC address)

We assign automatic allocation for both wired and wireless PCs by registering the MAC addresses for all office users in both LAN and WLAN to have IP addresses in the range 10.1.1.20-60. We can also assign an IP address to the Cisco Aironet C1260 AP in this way by using the AP’s MAC address.

The last two methods can be considered "automatic" because in each case the DHCP server assigns an address with no extra intervention needed. The only difference between them is in how long the IP address is leased, in other words whether a client's address varies over time.

Configuration

We configure the service:

sudo nano /etc/dhcp/dhcpd.conf

 

# minimal sample /etc/dhcp/dhcpd.conf

default-lease-time 43200;

max-lease-time 86400;

 

option subnet-mask 255.255.255.0;

option broadcast-address 10.1.1.255;

option routers 10.1.1.1;

option domain-name-servers 10.1.2.2, 39.9.33.2;

option domain-name "pbil05.lab";

option ntp-servers 10.1.1.2;

 

subnet 10.1.1.0 netmask 255.255.255.0 {

        range 10.1.1.20 10.1.1.60;

        host ap {

                hardware ethernet DD:GH:DF:E5:F7:D7;

                fixed-address 10.1.1.3;

        }

}

This will result in the DHCP server giving clients an IP address from the range 10.1.1.20 - 10.1.1.60. It will lease an IP address for 43200 seconds (12 hours) if the client doesn't ask for a specific time frame. Otherwise the maximum (allowed) lease will be 86400 seconds (24 hours). The server will also "advise" the client to use 10.1.1.1 as the default-gateway and allocate an IP address of 10.1.1.3 to the Cisco AP.

After changing the config file we have to restart the dhcpd, or stop and start the service:

sudo /etc/init.d/isc-dhcp-server restart

sudo /etc/init.d/isc-dhcp-server stop

sudo /etc/init.d/isc-dhcp-server start