zoukankan      html  css  js  c++  java
  • DHCP

     部署dhcpd服务程序

    [root@localhost ~]# yum install dhcp
    [root@localhost ~]# cat /etc/dhcp/dhcpd.conf
    # DHCP Server Configuration file.
    # see /usr/share/doc/dhcp*/dhcpd.conf.example
    # see dhcpd.conf(5) man page

    自动管理IP地址

    [root@localhost ~]# vim /etc/dhcp/dhcpd.conf
    ddns-update-style none;
    ignore client-updates;
    subnet 192.168.10.0 netmask 255.255.255.0 {
    range 192.168.10.50 192.168.10.100;
    option subnet-mask 255.255.255.0;
    option routers 192.168.10.10;
    option domain-name-servers 192.168.10.10;
    default-lease-time 21600;
    max-lease-time 43200;
    }

    [root@localhost ~]# systemctl restart dhcpd
    [root@localhost ~]# systemctl enable dhcpd
    ln -s '/usr/lib/systemd/system/dhcpd.service' '/etc/systemd/system/multi-user.target.wants/dhcpd.service'
    [root@localhost ~]# systemctl status dhcpd
    Active: active (running) since Tue 2019-11-26 11:47:32 CST; 12s ago

    [root@localhost
    ~]# iptables -F
    [root@localhost ~]# service iptables save
    iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]

    分配固定IP地址

    [root@localhost ~]# cat /var/log/messages
    Aug 13 20:14:13 localhost dhcpd: DHCPACK on 192.168.10.50 to 00:0c:29:e3:37:19 (Linuxprobe-PC) via eno16777728
    [root@localhost ~]# vim /etc/dhcp/dhcpd.conf
    host boss {
            hardware ethernet 00:0c:29:e3:37:19;
            fixed-address 192.168.10.88;
    }
    host ding {
            hardware ethernet 00:0c:29:1d:84:69;
            fixed-address 192.168.10.99;
    }
    [root@localhost ~]# systemctl restart dhcpd
  • 相关阅读:
    leetcode1118
    Kaggle练习002--Predict survival on the Titanic(Titanic Disaster)
    leetcode1111
    leetcode1110
    leetcode1109
    练习题|网络编程-socket开发
    web网页练习
    Bootstrap框架
    JQuery框架2.位置属性|筛选方法|事件
    Jquery框架1.选择器|效果图|属性、文档操作
  • 原文地址:https://www.cnblogs.com/dinghailong128/p/12178396.html
Copyright © 2011-2022 走看看