zoukankan      html  css  js  c++  java
  • dhcpd:bad subnet number/mask combination. subnet

    今天在调试wifi热点启动hdcpd服务时出现报错"bad subnet number/mask combination. subnet 192.168.1.1"

    Internet Systems Consortium DHCP Server 4.1.1-P1
    Copyright 2004-2010 Internet Systems Consortium.
    All rights reserved.
    For info, please visit https://www.isc.org/software/dhcp/ 
    
    /etc/dhcpd.conf line 34: subnet 192.168.1.1 
    
     netmask 255.255.255.0 
    
    : bad subnet number/mask combination.
    subnet 192.168.1.1 
    
     netmask 255.255.255.0 
    
     
                                           ^
    Configuration file errors encountered -- exiting
    
    If you did not get this software from ftp.isc.org 
    
    , please
    get the latest from ftp.isc.org 
    
     and install that before
    requesting help.
    
    If you did get this software from ftp.isc.org 
    
     and have not
    yet read the README, please read it before requesting help.
    If you intend to request help from the dhcp-server@isc.org
    mailing list, please read the section on the README about
    submitting bug reports and requests for help.
    
    Please do not under any circumstances send requests for
    help directly to the authors of this software - please
    send them to the appropriate mailing list as described in
    the README file.
    
    exiting

    找到对应配置如下

    #
    # Sample configuration file for ISC dhcpd for Debian
    #
    # $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
    #
    
    # The ddns-updates-style parameter controls whether or not the server will
    # attempt to do a DNS update when a lease is confirmed. We default to the
    # behavior of the version 2 packages ('none', since DHCP v2 didn't
    # have support for DDNS.)
    ddns-update-style none;
    
    # option definitions common to all supported networks...
    option domain-name "voidliu";
    option domain-name-servers ns1.example.org, ns2.example.org;
    
    default-lease-time 600;
    max-lease-time 7200;
    
    # If this DHCP server is the official DHCP server for the local
    # network, the authoritative directive should be uncommented.
    #authoritative;
    
    # Use this to send dhcp log messages to a different log file (you also
    # have to hack syslog.conf to complete the redirection).
    log-facility local7;
    
    # No service will be given on this subnet, but declaring it helps the 
    # DHCP server to understand the network topology.
    
    
    subnet 192.168.1.1 netmask 255.255.255.0 {
    range 192.168.1.16 192.168.1.128;
    }
    # This is a very basic subnet declaration. #subnet 10.254.239.0 netmask 255.255.255.224 { # range 10.254.239.10 10.254.239.20; # option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org; #}

    原因是subnet网络地址最后一位必须是0,修改如下

    subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.16 192.168.1.128;
    }
  • 相关阅读:
    git设置用户名和邮箱
    D②商品列表:毫秒转换成时间;分页添加背景;$$搜索商品关键字 $$$清空
    C②参数管理:修改删除;空格分隔的字符串渲染成标签;动态编辑标签;删除标签
    有用的抓包工具Ethereal
    PHP与XML联手进行网站编程
    配置Apache 2.2+PHP 5.2.9支持OCI通过Oracle9i Client连接Oracle
    UTF8编码主页调用JS显示乱码问题解决办法
    WIndows 环境下安装php环境(php5.2.9+apache2.2安装过程)
    PHP5 在处理 XML 方面的改进
    marquee上下滚动停顿效果
  • 原文地址:https://www.cnblogs.com/tid-think/p/9105382.html
Copyright © 2011-2022 走看看