Linux学习之DHCP服务器

  1. 安装:yum install -y dhcp*

  2. 关闭selinux

  3. 服务器配置静态IP:BOOTPROTO=static

               IPADDR=192.168.100.1

               NETMASK=255.255.255.0

               GATEWAY=192.168.100.250

  4. 配置:cp /usr/...dhcpd.conf.sample /etc/dhcp/dhcpd.conf

        vim /etc/dhcp/dhcpd.conf

    default-lease-time 259200;

    max-lease-time 518400;

    option domain-name "sample.com";

    option domain-name-servers 114.114.114.114;

     

    subnet 192.168.100.0 netmask 255.255.255.0{

    range 192.168.100.2 192.168.100.100;

    option routers 192.168.100.250;}

  5. 启动:/etc/init.d/dhcpd start

       chkconfig dhcpd on

  6. 查看已出租的IP:cat /var/lib/dhcpd/dhcpd.lease

posted @ 2017-05-03 16:44  enginex  阅读(156)  评论(0编辑  收藏  举报