Setting up DHCP

Issues related to configuring your network
Post Reply
andrewriley404
Posts: 3
Joined: 2019/10/20 11:13:59

Setting up DHCP

Post by andrewriley404 » 2019/10/20 11:22:14

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.

User avatar
TrevorH
Forum Moderator
Posts: 26955
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Setting up DHCP

Post by TrevorH » 2019/10/20 11:31:49

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.
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

andrewriley404
Posts: 3
Joined: 2019/10/20 11:13:59

Re: Setting up DHCP

Post by andrewriley404 » 2019/10/20 11:59:32

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?

User avatar
TrevorH
Forum Moderator
Posts: 26955
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Setting up DHCP

Post by TrevorH » 2019/10/20 16:11:34

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   
CentOS 5 died in March 2017 - migrate NOW!
CentOS 6 goes EOL sooner rather than later, get upgrading!
Full time Geek, part time moderator. Use the FAQ Luke

andrewriley404
Posts: 3
Joined: 2019/10/20 11:13:59

Re: Setting up DHCP

Post by andrewriley404 » 2019/10/20 18:38:43

Thanks so much! up and running!

User avatar
jlehtone
Posts: 2387
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Setting up DHCP

Post by jlehtone » 2019/10/22 08:18:38

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.)

Post Reply

Return to “CentOS 8 - Networking Support”