Thursday, 31 March 2016

DHCP Server RHEL7

DHCP Server :: Dynamic Host Control protocol

Port Number 67
Package: dhcp*
service : dhcpd.service
config file: /etc/dhcp/dhcpd.conf

[root@server7 ~]# yum install dhcp*
Loaded plugins: langpacks
Package 12:dhcp-common-4.2.5-27.el7.x86_64 already installed and latest version
Package 12:dhcp-libs-4.2.5-27.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package dhcp.x86_64 12:4.2.5-27.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================
 Package                          Arch                               Version                                       Repository                            Size
==============================================================================================================================================================
Installing:
 dhcp                             x86_64                             12:4.2.5-27.el7                               rhel_dvd                             506 k

Transaction Summary
==============================================================================================================================================================
Install  1 Package

Total download size: 506 k
Installed size: 1.4 M
Is this ok [y/d/N]: y
Downloading packages:
dhcp-4.2.5-27.el7.x86_64.rpm                                                                                                           | 506 kB  00:00:00    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 12:dhcp-4.2.5-27.el7.x86_64                                                                                                                1/1
  Verifying  : 12:dhcp-4.2.5-27.el7.x86_64                                                                                                                1/1

Installed:
  dhcp.x86_64 12:4.2.5-27.el7                                                                                                                                

Complete!
[root@server7 ~]# systemctl enable dhcpd.service
ln -s '/usr/lib/systemd/system/dhcpd.service' '/etc/systemd/system/multi-user.target.wants/dhcpd.service'
[root@server7 ~]# systemctl start dhcpd.service
[root@server7 ~]# firewall-cmd --permanent --add-service=dhcp
success
[root@server7 ~]# firewall-cmd --reload
success
[root@server7 ~]# cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
cp: overwrite ‘/etc/dhcp/dhcpd.conf’? y
[root@server7 ~]# vim /etc/dhcp/dhcpd.conf


## Default Line Number 48 ###
# A slightly different configuration for an internal subnet.
subnet 172.25.7.0 netmask 255.255.255.0 {
  range 172.25.7.20 172.25.7.22;
  option domain-name-servers ns1.internal.example.org;
  option domain-name "example.com";
  option routers 172.25.7.2;
  option broadcast-address 172.25.7.255;
  default-lease-time 600;
  max-lease-time 7200;
}


:wq! (Save & Exit)

#systemctl restart dhcpd.service

No comments:

Post a Comment