今天在调试机器的WIFI热点,好不容易把dhcp编译打包进去,服务启动出现报错No subnet declaration for wlan0,详细信息如下:

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/ Wrote 0 leases to leases file. No subnet declaration for wlan0 (192.168.1.1 ).
** Ignoring requests on wlan0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface wlan0 is attached. ** Not configured to listen on any interfaces! 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.

经过排查分析,确认是dhcpd.conf中配置的网络与给wlan0的网络配置存在冲突,不在同一个网段内:

/etc/dhcpd.conf配置网段在10.11.0.0

但是wlan0的ip地址却配置在192.168.1.1

insmod /system/vendor/modules/8188eu.ko
#insmod /lib/8723bu.ko
sleep 2
ifconfig wlan0 up
ifconfig wlan0 192.168.1.1 netmast 255.255.255.0
sleep 1
hostapd /etc/hostapd.conf -B
touch /var/lib/dhcp/dhcpd.leases
dhcpd
#
# 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 "example.org";
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 10.11.0.0 netmask 255.255.255.0 {
range 10.11.0.30 10.11.0.254;
} # 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;
#}

只要将dhcpd.conf中的网络配置成和wlan0的启动设置一致即可解决。

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.16 192.168.1.128;
}

最新文章

  1. 企业站SEO记录
  2. html5 Application Cache 机制以及使用
  3. 荣品RP4412开发板烧写内核cannot load出错的原因
  4. [SQL]收缩数据库日志
  5. 【JSP】JSP基础学习记录(三)—— JSP的9个内置对象
  6. django1.9 创建数据表
  7. Redis笔记(一)Redis简介
  8. java的学习路线
  9. TTB 基本
  10. C#中通过位运算实现多个状态的判断
  11. HTML5 标准属性 NEW:HTML 5 中新的标准属性。 注释:HTML 4.01 不再支持 accesskey 属性:
  12. 织梦dedeCMS|系统基本配置标签
  13. iOS中的图像处理(三)——混合运算
  14. Display 和Visible 区别
  15. 微信小程序开发-第一弹
  16. centos/ubuntu 双击运行 .sh(shell)文件
  17. 【LeetCode每天一题】String to Integer (atoi)(字符串转换成数字)
  18. 安装logstash及logstash的初步使用-处理DNS日志
  19. COMPILING ACTIONSCRIPT 3.0 WITH SUBLIME TEXT 2
  20. httpClient创建对象、设置超时

热门文章

  1. java.net.NoRouteToHostException: Cannot assign requested address
  2. DFS与DFS迷宫问题
  3. 网络IO模型与Reactor模式
  4. CI框架 ::集成极光推送
  5. python FastAPI 初接触
  6. 势流理论笔记:03 Hess-Smith积分方法
  7. HBase 与 Cassandra 架构对比分析的经验分享
  8. mysql通过logstash同步数据到es
  9. 分析你的第一个Android程序
  10. Redis分布式锁的正确实现方式[转载]