DHCP - Brandon-Duffy/SYS-265 GitHub Wiki

  1. Install the DHCP server package:

    yum install -y dhcp
    
  2. Create a backup of the default configuration file:

    cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak
    
  3. Create a new configuration file with the following content:

default-lease-time 604000;
max-lease-time 604010;

subnet 172.16.1.0 netmask 255.255.255.0 {
    option routers 162.16.1.2;
    option subnet-mask 255.255.255.0;
    option domain-name "kitten.local"'
    option domain-name-servers 172.16.1.2;
    range 172.16.1.100 172.16.1.150;
}
  1. Enable and start the DHCP server:

    systemctl enable dhcpd
    systemctl start dhcpd
    
  2. Configure the firewall to allow DHCP traffic:

    firewall-cmd --permanent --add-service=dhcp
    firewall-cmd --reload
    
  3. Create the admin user "kitten1" and set the password "ropebucket1!":

    adduser kitten1
    echo "kitten1:ropebucket1!" | chpasswd
    
  4. Add the "kitten1" user to the sudoers file:

    echo "kitten1 ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers