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

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。