MDI DHCP Server Implementation
MDI DHCP Server Implementation:
OS Version RHEL 6.1 (x86_64)
ROOT Password : ghL@#W01GS
Set the hostname
[root@mdidhcpserver dhcp]# vim /etc/sysconfig/network
NETWORKING=yes HOSTNAME=mdidhcpserver
Set IP address
[root@mdidhcpserver dhcp]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 HWADDR=ec:b1:d7:3c:10:07 NM_CONTROLLED=no ONBOOT=yes IPADDR=192.168.1.10 NETMASK=255.255.0.0 GATEWAY=192.168.12.25 TYPE=Ethernet BOOTPROTO=none IPV6INIT=no USERCTL=no
Restart network service:
[root@mdidhcpserver dhcp]# /etc/init.d/network restart [root@mdidhcpserver dhcp]# chkconfig network on [root@mdidhcpserver dhcp]# service NetworkManager stop [root@mdidhcpserver dhcp]# chkconfig NetworkManager off
Flush the firewall rules:
[root@mdidhcpserver dhcp]# iptables -F [root@mdidhcpserver dhcp]# service iptables stop [root@mdidhcpserver dhcp]# chkconfig iptables off
Disable the selinux:
[root@mdidhcpserver dhcp]# setenforce 0
Disable selinux from file:
[root@mdidhcpserver dhcp]# vim /etc/sysconfig/selinux
#This file controls the state of SELinux on the system. #SELINUX= can take one of these three values: #enforcing - SELinux security policy is enforced. #permissive - SELinux prints warnings instead of enforcing. #disabled - No SELinux policy is loaded. SELINUX=disabled #SELINUXTYPE= can take one of these two values: #targeted - Targeted processes are protected, #mls - Multi Level Security protection. SELINUXTYPE=targeted
Install DHCP package
rpm -ivh dhcp-4.1.1-19.P1.el6.x86_64.rpm
Configuring DHCP Server
Edit configuration file and make below entries
[root@mdidhcpserver dhcp]# vim /etc/dhcp/dhcpd.conf
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.sample
# see 'man 5 dhcpd.conf'
log-facility local5;
authoritative;
subnet 192.168.0.0 netmask 255.255.0.0 {
range 192.168.13.1 192.168.22.254;
option domain-name-servers 192.168.10.83, 192.168.12.25;
option domain-name "mdi.ac.in";
option routers 192.168.12.25;
option broadcast-address 192.168.15.255;
default-lease-time 43200;
max-lease-time 86400;
}
#MAC binding for host
host DESKTOP-NH1KCIO {
hardware ethernet 44:8a:5b:72:53:b2;
fixed-address 192.168.12.215;
# filename "vmunix.passacaglia";
# server-name "toccata.fugue.com";
}
Assign the network interface:
[root@mdidhcpserver ~]# vim /etc/sysconfig/dhcpd
Make below entry:
DHCPDARGS=eth0
After configuration Restart DHCP Service
[root@mdidhcpserver ~]# /etc/init.d/dhcpd restart [root@mdidhcpserver ~]# chkconfig dhcpd on
Disable dhcpd6 service
[root@mdidhcpserver dhcp]# /etc/init.d/dhcpd6 stop [root@mdidhcpserver dhcp]# chkconfig dhcpd6 off
Enabling log
[root@mdidhcpserver ~]# vim /etc/rsyslog.conf
Make below entry in rsyslog.conf file
# Save DHCP log local5.* /var/log/dhcpd.log
Restart rsyslog service
[root@mdidhcpserver ~]# /etc/init.d/rsyslog status rsyslogd (pid 1349) is running... [root@mdidhcpserver ~]# /etc/init.d/rsyslog restart