Saturday, 30 December 2017

configure DHCP server in RHEL7

DHCP stands for 'Dynamic Host Configuration Protocol'
It is a protocol for assigning IP address to the host/computer system dynamically.

[root@localhost ~]# yum install dhcp

[root@localhost ~]# cd /etc/dhcp

[root@localhost dhcp]# cd /usr/share/doc

[root@localhost doc]# ls

dhcp-4.2.5/        dhcp-common-4.2.5/

[root@localhost doc]# cd dhcp-4.2.5

[root@localhost dhcp-4.2.5]# ls

dhcpd6.conf.example  dhcpd.conf.example  ldap

[root@localhost dhcp-4.2.5]# cp dhcpd.conf.example  /etc/dhcp/dhcpd.conf 

[root@localhost dhcp-4.2.5]# vim /etc/dhcp/dhcpd.conf

default-lease-time 600;

max-lease-time 7200;

subnet 192.168.0.0 netmask 255.255.255.0{

range 192.168.0.10  192.168.0.200 ;

}

[root@localhost dhcp-4.2.5]# systemctl restart dhcpd

[root@localhost dhcp-4.2.5]# systemctl enable dhcpd


------------------------------- Dhcp client configuration-------------------------

[root@client ~]# dhclient -v  enp2s0



No comments:

Post a Comment