Page 1 of 1
Setting up DHCP
Posted: 2019/10/20 11:22:14
by andrewriley404
im new to centOS 8 and im trying to set up a dhcp server.
iv got to the point where i have downloaded DHCP and checked the files with ls which gives me
dhclient.conf and dhclient.d
iv gone into the dhclient file and seen the sample file is /usr/share/doc/dhclient/dhclient.conf.example
i would then normally cp over this file to the dhclient.conf but if i look at this file it appears empty so there is not point copying it over. also if i do try to copy it over it says "no such file or directory.
can anyone help with setting up a dhcp please and im very new to this so a step by step guide will help a lot.
Re: Setting up DHCP
Posted: 2019/10/20 11:31:49
by TrevorH
How did you install it? The files you mention are not server related, both of those are for the DHCP client not the server and the file you're really looking for is not /usr/share/doc/dhclient/dhclient.conf.example it is /usr/share/doc/dhcp-client/dhclient.conf.example.
Use rpm -ql or repoquery -l to get a list of the files supplied by the packages you have installed so that you can see the right filenames to use.
Re: Setting up DHCP
Posted: 2019/10/20 11:59:32
by andrewriley404
thanks for the quick response
i used "yum install dhcp" to download it. is this the right way? this is what i used in centOS 7 not sure if its different in centOS8
iv also tried the 2 commands you suggested and i got command not found... and no arguments given for query, could you give me an example of how to write them in please?
Re: Setting up DHCP
Posted: 2019/10/20 16:11:34
by TrevorH
The repoquery command is part of the yum-utils package. You may need to install that to get it. The
rpm -ql ... command wants a package name given to it in order to list the files it contains.
There is no package called 'dhcp' in CentOS 8. The list of packages that can be installed can be found by running
yum list dhcp\* but the client is called dhcp-client and the server is called dhcp-server.
Code: Select all
[root@centos8 ~]# dnf list dhcp\*
Last metadata expiration check: 0:55:33 ago on Sun Oct 20 16:13:37 2019.
Installed Packages
dhcp-client.x86_64 12:4.3.6-30.el8 @anaconda
dhcp-common.noarch 12:4.3.6-30.el8 @anaconda
dhcp-libs.x86_64 12:4.3.6-30.el8 @anaconda
Available Packages
dhcp-client.i686 12:4.3.6-30.el8 BaseOS
dhcp-libs.i686 12:4.3.6-30.el8 BaseOS
dhcp-relay.x86_64 12:4.3.6-30.el8 BaseOS
dhcp-server.i686 12:4.3.6-30.el8 BaseOS
dhcp-server.x86_64 12:4.3.6-30.el8 BaseOS
Re: Setting up DHCP
Posted: 2019/10/20 18:38:43
by andrewriley404
Thanks so much! up and running!
Re: Setting up DHCP
Posted: 2019/10/22 08:18:38
by jlehtone
andrewriley404 wrote: ↑2019/10/20 11:22:14
im trying to set up a dhcp server.
Out of curiosity, do you want
the dhcp server or will
any dhcp server suffice?
(There is 'dnsmasq' in AppStreams and it is a much simpler dhcp server.)