Linux Box as a DHCP Server
Operating System: Centos 6.3
In this setup, client machines on the LAN are assigned IP addresses automatically unlike the previous setup where IP addresses were being assigned manually.
To configure;
Install dhcp package via terminal;
[root@telweb]# yum install dhcp* -y
Copy the available sample dhcp configuration at /usr/share/doc/dhcp*
[root@telweb]# Cd /usr/share/doc/dhcp*
[root@telweb]# Cp dhcpd.conf.sample /etc/dhcp/dhcpd.conf
If asked to replace the existing dhcpd.conf at /etc/dhcp/ , answer with an yes.
To configure the dhcp, edit the file /etc/dhcp/dhcp.conf
[root@telweb]# Vi /etc/dhcp/dhcpd.conf
Go to the section highlighted below and edit it to suit your network;
--------------------------------------------------------------------------------------------------------------------
# A slightly different configuration for an internal subnet.
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.50 192.168.2.100;
option domain-name-servers 8.8.8.8;
option domain-name "net.telweb.com";
option routers 192.168.2.1;
option broadcast-address 192.168.2.255;
default-lease-time 600;
max-lease-time 7200;
}
--------------------------------------------------------------------------------------------------------------------
Then save the file
In this setup, client machines on the LAN are assigned IP addresses automatically unlike the previous setup where IP addresses were being assigned manually.
To configure;
Install dhcp package via terminal;
[root@telweb]# yum install dhcp* -y
Copy the available sample dhcp configuration at /usr/share/doc/dhcp*
[root@telweb]# Cd /usr/share/doc/dhcp*
[root@telweb]# Cp dhcpd.conf.sample /etc/dhcp/dhcpd.conf
If asked to replace the existing dhcpd.conf at /etc/dhcp/ , answer with an yes.
To configure the dhcp, edit the file /etc/dhcp/dhcp.conf
[root@telweb]# Vi /etc/dhcp/dhcpd.conf
Go to the section highlighted below and edit it to suit your network;
--------------------------------------------------------------------------------------------------------------------
# A slightly different configuration for an internal subnet.
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.50 192.168.2.100;
option domain-name-servers 8.8.8.8;
option domain-name "net.telweb.com";
option routers 192.168.2.1;
option broadcast-address 192.168.2.255;
default-lease-time 600;
max-lease-time 7200;
}
--------------------------------------------------------------------------------------------------------------------
Then save the file
Done!!
Comments
Post a Comment