Michael_Tong
近期目标:按时吃药,努力做个正常人。

目录

    操作命令
    apt-get install -y isc-dhcp-server
    vi /etc/default/isc-dhcp-server
    我的修改内容为INTERFACES="ens192"

    vi /etc/dhcp/dhcpd.conf

    root@localhost:~# egrep "^[^#]"  /etc/dhcp/dhcpd.conf
    ddns-update-style none;
    option domain-name "example.org";
    default-lease-time 600;
    max-lease-time 7200;
    log-facility local7;
    subnet 1.1.1.0 netmask 255.255.255.0 {
      range 1.1.1.10 1.1.1.30;
      option domain-name-servers 1.1.1.1;
      option subnet-mask 255.255.255.0;
      option routers 1.1.1.1;
      option broadcast-address 1.1.1.255;
      default-lease-time 600;
      max-lease-time 7200;
    }
    

    保存退出,然后重启dhcp服务service isc-dhcp-server restart
    netstat -uap可查看dhcp服务是否正常
    /var/lib/dhcp/dhcpd.leases记录了所有isc-dhcp-server分配的IP地址信息
    可参考http://blog.topspeedsnail.com/archives/5924

    posted on 2019-02-18 15:57  Michael_Tong唐唐  阅读(1233)  评论(0编辑  收藏  举报