Home > IT Architecture, Linux, Systems > linux dhcp config

linux dhcp config

June 8th, 2016
yum install dhcp

vi /etc/dhcpd.conf

    ddns-update-style ad-hoc;
    default-lease-time 600;
    max-lease-time 7200;

    subnet 192.168.144.0 netmask 255.255.248.0 {
        range 192.168.149.112 192.168.149.113;
        option domain-name-servers 10.135.82.180, 10.135.82.188;
        option routers 192.168.144.1;
    }

    subnet 192.168.128.0 netmask 255.255.248.0 {
    }

    host andy {
        hardware ethernet 00:16:3E:86:51:DC;
        fixed-address 10.1.1.100;
    }

/etc/init.d/dhcpd start


[root@dhcpd ~]# ls -l /var/lib/dhcp/dhcpd.leases

[root@dhcpd ~]# lsof -i :67
    COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
    dhcpd 28207 root 5u IPv4 1019206 UDP *:bootps

[root@client ~]# dhclient eth0 -s 192.168.149.109

PS:

1. Here's an article about how DHCP works. You can get more info here and here.
2.For security reason, the DHCP offer packages sent from DHCP server we build may
  get blocked. So we need ask Network Support to config DHCP relay on their DHCP 
  server to relay specified requests to use our own DHCP server. 
  
  As indicated below: 

      Jun  8 09:22:50 host1 dhclient: No DHCPOFFERS received.

Good Luck!


Categories: IT Architecture, Linux, Systems Tags:
Comments are closed.