Link to home
Start Free TrialLog in
Avatar of Dwight Baer
Dwight BaerFlag for Canada

asked on

Ubuntu 14.04.6 - how to start and stop the DHCP server

I'm a new Ubuntu administrator.  I need to stop the DHCP server permanently, not just for this session.  Ubuntu 14.04.6
 
As a bonus ... if you could please help me with how to start the DHCP service in Ubuntu 18.04.4

Thanks.
Avatar of Dr. Klahn
Dr. Klahn

Much depends on what version of dhcp is being used on the system, but if it is either of the standard DHCPs then these commands should stop it, then remove it permanently.  One of the remove commands should fail.  If both fail, then some other version of DHCP is being used.

sudo /etc/init.d/dhcp stop
sudo apt-get remove isc-dhcp-server
sudo apt-get remove dhcp3-server


Be 100% sure that the system has been configured properly for static addressing before doing this.  If there is any error, on the next reboot the system will only be accessible from the console - and if it doesn't have one, there will be considerable inconvenience getting it running again.
ASKER CERTIFIED SOLUTION
Avatar of Mazdajai
Mazdajai
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dwight Baer

ASKER

Dr. Klahn,

/etc/init.d/dhcp:  No such file or  directory.

I have attached a pdf file containing the output of "fine / -name "*dhcp*" - for both Ubuntu 14.04.6 and 18.04.4

Thanks
dhcp-related.pdf
Mazdajai:

Your suggestion produced:  "status:  Unknow job:  isc-dhcp-server"

Attached please find everything on my system related to "isc-dhcp-server"

Thanks
isc-dhcp-server-related.pdf
(I apologize for my spelling typos on both my previous messages.)
What about if I just kill the dhcpd process?  See attached

Thanks
suggestion-kill-dhcpd.pdf
OK, then your system inits with systemd instead of SysV init and uses dhcp3.  This should stop the service:

service dhcp3-server stop

and then remove it with the apt command line as previous above.
cat /run/dhcp-server/dhcpd.pid:

1358
"service dhcp3-server stop" produces:

dhcp3-server:  unrecognized service
Thanks Dr. Klahn and Mazdajai.

I spoke to someone who was around when this was installed.  I think the dhcpd daemon had something to do with ltsp.

Anyway ... I'm going to give up on shutting it down properly.  I learned a lot from this exercise.  I'm just going to physically shut the machine down when I'm ready.  Then it will be "repurposed".
There's a very good likelihood some other process is handling DHCP address/lease management.

Ubuntu Tahr (14.04) is so old +  various hosting companies can setup DHCP in all manner of ways... I'd start here...

ps auxww | grep dhcp

Open in new window


See what processes come up.

You might find some combination of dhclient + dnsmasq are handling your DHCP.

Then you'll interact with your hosting company or admin staff about how best to effect DHCP changes so machines survive.

Note: If you're running any type of container system... let's see... with Trusty this will likely be LXC... nuking DHCP will likely also destroy all container communications, as DHCP wiring is used for LXC (and all other similar systems) for container communications.

Careful: DHCP ca be intertwined with your entire network setup, so if you do successfully kill off all DHCP related processes, this will also likely kill off your entire machine connectivity... so be sure you cut + paste all steps you take into a text file, so if you have to reboot in single user mode to get your machine to work again, you know exactly what to do.

Tip: Might be best to open a 2nd question describing the problem you're trying to solve, as... nuking DHCP might be near impossible... I say "near" because you can do anything you, given sufficient time + money + acceptable long down time...
Thanks David!  I appreciate your thoughtful suggestions.