This is Part 1 of our Cisco ASA System Management series – Installing a DHCP server on Ubuntu 18.04. A DHCP (Dynamic Host Configuration Protocol) Server is a network server that automatically assigns IP addresses to client devices from a range of available, configured addresses. If you have lots of network devices, it might be considereda pain to go around to each one and configure it manually – as long as there are IP addresses remaining in the pool and you’ve defined the subnet, why not allow a DHCP server to assign this IP addresses automatically?
Let’s take a look at our topology:
So we log onto our Ubuntu server, open a terminal, login and make sure we login as root so that we don’t have to keep typing “sudo” to access our commands (cd .. just means we are going back one directory):
OK, that’s great. Now we will update the package repository
OK, now onto actually doing the DHCP installation itself. We’re going to be using the isc-dhcp-server package
Type Y and then enter.
After this let’s verify that the DHCP server is actually running
Aaah crap! This isn’t going the way that we expected – we now need to do some troubleshooting as to why the DHCP server isn’t running….
And stopping and restarting the service isn’t helping:
I think that it must be because we haven’t defined a lease-time and a range – let’s do that now.
The config file is the dhcpd.conf and it’s found in the DHCP directory under /etc/dhcp (use ctrl+C to exit the above screen):
Then I pressed ctrl+X, which gave me this screen – here I typed Y and enter on the next screen when asked if I wanted to change the name (which I didn’t).
Let’s restart the service and see if that made any difference
Shit! Stilll a problem – what the heck is going on!?
OK, props to this blog here – https://stackoverflow.com/questions/67928140/isc-dhcp-server-status-failed-failed-with-result-exit-code which led me in the right direction.
First I need to run the journalctl _PID command – my PID here is 23800
Oh my days!! It’s telling me exactly where the error is – I haven’t commented out the } after line 39.
If you didn’t know where line 39 was you can use Notepad++ or an online program like YAMLlint to find where the offending line is.
Let’s jump back into the dhcpd.conf file again and take another look:
This is the offending # – I’m going to delete that, save the file, restart the service and look again:
And this is what it looks like after I’ve deleted the #
Don’t forget to ctrl+x, type Y and then press enter.
OK let’s restart the service and try again:
The smell of success!!
Cisco ASA configuration
The hard part of this was the Ubuntu 18.04 configuration – the configuration on the ASA is very easy – just a couple of lines.
This is the configuration before enable DHCP on the ASA (we’re looking at Gig0/2 interface):
And here’s the config after:
Ta-daa!!