Page 1 of 1

DHCP Server configure

Posted: 2023 May 03, 20:22
by Mihai
Install dhcp server

Code: Select all

[root @ centos ~]$ yum install dhcp
Edit configuration file dhcpd.conf

Code: Select all

[root @ centos ~]$ nano /etc/dhcp/dhcpd.conf
Add configuration example in the file

Code: Select all

ddns-update-style none;
subnet 192.168.0.0 netmask 255.255.255.0 {
option domain-name "domeniul-tau";
option domain-name-servers dns1.provider-internet, dns2.provider-internet;
# option domain-name-servers 192.168.0.1;
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option time-offset -18000; # Eastern Standard Time
# range 192.168.0.2 192.168.0.254;
default-lease-time 600;
max-lease-time 7200;
authoritative; }

host PC1 {option host-name "PC1.domeniul.tau"; hardware ethernet 01:23:45:AB:CD:EF; fixed-address 192.168.0.3;}
Edit dhcpd file and add the LAN interface

Code: Select all

[root @ centos ~]$ nano /etc/sysconfig/dhcpd
DHCPDARGS="eth1"
Start dhcp server

Code: Select all

[root @ centos ~]$ service dhcpd start
Starting dhcpd: [ OK ]