Howto install and configure DHCP Server on Fedora 17

Howto install and configure DHCP Server on Fedora 17

1. Install DHCP package by yum :

[root@fedora17 ~]# yum install -y dhcp
fedora/metalink | 8.3 kB 00:00
fedora | 4.2 kB 00:00
fedora/primary_db | 12 MB 00:23
updates/metalink | 3.3 kB 00:00
updates | 4.7 kB 00:00
updates/primary_db | 5.9 MB 00:11
Resolving Dependencies
–> Running transaction check
—> Package dhcp.i686 12:4.2.4-16.P2.fc17 will be installed
–> Processing Dependency: dhcp-libs(x86-32) = 12:4.2.4-16.P2.fc17 for package: 12:dhcp-4.2.4-16.P2.fc17.i686
–> Processing Dependency: dhcp-common = 12:4.2.4-16.P2.fc17 for package: 12:dhc p-4.2.4-16.P2.fc17.i686
–> Processing Dependency: libisc-export.so.92 for package: 12:dhcp-4.2.4-16.P2. fc17.i686
–> Processing Dependency: libdns-export.so.95 for package: 12:dhcp-4.2.4-16.P2. fc17.i686
–> Running transaction check
—> Package bind-libs-lite.i686 32:9.9.0-4.fc17 will be updated
–> Processing Dependency: libdns-export.so.93 for package: 12:dhclient-4.2.4-0. 4.rc1.fc17.i686
–> Processing Dependency: libisc-export.so.90 for package: 12:dhclient-4.2.4-0. 4.rc1.fc17.i686
—> Package bind-libs-lite.i686 32:9.9.2-3.P1.fc17 will be an update
–> Processing Dependency: bind-license = 32:9.9.2-3.P1.fc17 for package: 32:bin d-libs-lite-9.9.2-3.P1.fc17.i686
—> Package dhcp-common.i686 12:4.2.4-0.4.rc1.fc17 will be updated
—> Package dhcp-common.i686 12:4.2.4-16.P2.fc17 will be an update
—> Package dhcp-libs.i686 12:4.2.4-0.4.rc1.fc17 will be updated
—> Package dhcp-libs.i686 12:4.2.4-16.P2.fc17 will be an update
–> Running transaction check
—> Package bind-license.noarch 32:9.9.0-4.fc17 will be updated
—> Package bind-license.noarch 32:9.9.2-3.P1.fc17 will be an update
—> Package dhclient.i686 12:4.2.4-0.4.rc1.fc17 will be updated
—> Package dhclient.i686 12:4.2.4-16.P2.fc17 will be an update
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
dhcp i686 12:4.2.4-16.P2.fc17 updates 491 k
Updating for dependencies:
bind-libs-lite i686 32:9.9.2-3.P1.fc17 updates 633 k
bind-license noarch 32:9.9.2-3.P1.fc17 updates 74 k
dhclient i686 12:4.2.4-16.P2.fc17 updates 263 k
dhcp-common i686 12:4.2.4-16.P2.fc17 updates 164 k
dhcp-libs i686 12:4.2.4-16.P2.fc17 updates 131 k

Transaction Summary
================================================================================
Install 1 Package
Upgrade ( 5 Dependent packages)

Total download size: 1.7 M
Downloading Packages:
(1/6): bind-libs-lite-9.9.2-3.P1.fc17.i686.rpm | 633 kB 00:01
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 1aca3465: NOK EY
Public key for bind-libs-lite-9.9.2-3.P1.fc17.i686.rpm is not installed
(2/6): bind-license-9.9.2-3.P1.fc17.noarch.rpm | 74 kB 00:00
(3/6): dhclient-4.2.4-16.P2.fc17.i686.rpm | 263 kB 00:01
(4/6): dhcp-4.2.4-16.P2.fc17.i686.rpm | 491 kB 00:01
(5/6): dhcp-common-4.2.4-16.P2.fc17.i686.rpm | 164 kB 00:00
(6/6): dhcp-libs-4.2.4-16.P2.fc17.i686.rpm | 131 kB 00:00
——————————————————————————–
Total 307 kB/s | 1.7 MB 00:05
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-i386
Importing GPG key 0x1ACA3465:
Userid : “Fedora (17) <fedora@fedoraproject.org>”
Fingerprint: cac4 3fb7 74a4 a673 d81c 5de7 50e9 4c99 1aca 3465
Package : fedora-release-17-1.noarch (@anaconda-0)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-i386
Running Transaction Check
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : 12:dhcp-libs-4.2.4-16.P2.fc17.i686 1/11
Updating : 12:dhcp-common-4.2.4-16.P2.fc17.i686 2/11
Updating : 32:bind-license-9.9.2-3.P1.fc17.noarch 3/11
Updating : 32:bind-libs-lite-9.9.2-3.P1.fc17.i686 4/11
Installing : 12:dhcp-4.2.4-16.P2.fc17.i686 5/11
Updating : 12:dhclient-4.2.4-16.P2.fc17.i686 6/11
Cleanup : 12:dhclient-4.2.4-0.4.rc1.fc17.i686 7/11
Cleanup : 12:dhcp-common-4.2.4-0.4.rc1.fc17.i686 8/11
Cleanup : 32:bind-libs-lite-9.9.0-4.fc17.i686 9/11
Cleanup : 32:bind-license-9.9.0-4.fc17.noarch 10/11
Cleanup : 12:dhcp-libs-4.2.4-0.4.rc1.fc17.i686 11/11
Verifying : 32:bind-license-9.9.2-3.P1.fc17.noarch 1/11
Verifying : 12:dhcp-common-4.2.4-16.P2.fc17.i686 2/11
Verifying : 32:bind-libs-lite-9.9.2-3.P1.fc17.i686 3/11
Verifying : 12:dhcp-4.2.4-16.P2.fc17.i686 4/11
Verifying : 12:dhcp-libs-4.2.4-16.P2.fc17.i686 5/11
Verifying : 12:dhclient-4.2.4-16.P2.fc17.i686 6/11
Verifying : 32:bind-libs-lite-9.9.0-4.fc17.i686 7/11
Verifying : 12:dhcp-libs-4.2.4-0.4.rc1.fc17.i686 8/11
Verifying : 12:dhclient-4.2.4-0.4.rc1.fc17.i686 9/11
Verifying : 12:dhcp-common-4.2.4-0.4.rc1.fc17.i686 10/11
Verifying : 32:bind-license-9.9.0-4.fc17.noarch 11/11

Installed:
dhcp.i686 12:4.2.4-16.P2.fc17

Dependency Updated:
bind-libs-lite.i686 32:9.9.2-3.P1.fc17 bind-license.noarch 32:9.9.2-3.P1.fc17
dhclient.i686 12:4.2.4-16.P2.fc17 dhcp-common.i686 12:4.2.4-16.P2.fc17
dhcp-libs.i686 12:4.2.4-16.P2.fc17

Complete!

2. Set static IP address for DHCP Server:

[root@fedora17 ~]# vi /etc/sysconfig/network-scripts/ifcfg-p3p1
UUID=”e115eceb-1c9c-4cc8-a536-264e352d5839″
NM_CONTROLLED=”yes”
HWADDR=”00:0C:29:6C:C5:B0″
BOOTPROTO=”static”
DEVICE=”p3p1″
ONBOOT=”yes”
IPADDR=192.168.117.2
NETMASK=255.255.255.0
BROADCAST=192.168.117.255
NETWORK=192.168.117.0
GATEWAY=192.168.117.1

3. Configure DHCP subnet for our network:

[root@fedora17 ~]# vi /etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
# see dhcpd.conf(5) man page
#
subnet 192.168.117.0 netmask 255.255.255.0 {
range 192.168.117.10 192.168.117.254;
option domain-name “ithelpblog.com”;
option domain-search “ithelpblog.com”, “linux.ithelpblog.com”, “windows.ithelpblog.com”, “cisco.ithelpblog.com”;
option domain-name-servers 192.168.117.3;
option routers 192.168.117.1;
}

4. Configure listening Interface to DHCP:

[root@fedora17 ~]# vi /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS=”p3p1

5. Start DHCP Server:

[root@fedora17 ~]# systemctl start dhcpd.service

6. DHCP Start at boot by command:

[root@fedora17 ~]# systemctl enable dhcpd.service

7. Client gets IP Address from DHCP Server:

That’s all. Thanks for using IThelpblog.com. If you have any query, please comment here.

 

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>