weixin_42340144
柳罐罐
采纳率30.8%
2018-06-30 21:00 阅读 3.5k

树莓派3启动dnsmasq服务失败怎么办

20

启动的时候会出现
Job for dnsmasq.service failed. See 'systemctl status dnsmasq.service' and 'journalctl -xn' for details.
我用这个systemctl status dnsmasq.service命令出现了这样的提示

root@raspberrypi:/# systemctl status dnsmasq.service
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; disabled)
Drop-In: /run/systemd/generator/dnsmasq.service.d
└─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
Active: failed (Result: exit-code) since Sun 2018-07-01 23:27:13 JST; 43s ago
Process: 4417 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=1/FAILURE)
Process: 4413 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

Jul 01 23:27:13 raspberrypi dnsmasq[4413]: dnsmasq: syntax check OK.
Jul 01 23:27:13 raspberrypi dnsmasq[4417]: dnsmasq: junk found in command line
Jul 01 23:27:13 raspberrypi systemd[1]: dnsmasq.service: control process exited, code=exited status=1
Jul 01 23:27:13 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Jul 01 23:27:13 raspberrypi systemd[1]: Unit dnsmasq.service entered failed state.

我的dnsmasq配置如下

root@raspberrypi:/# cat /etc/dnsmasq.conf
bind-interfaces

interface=wlan1

dhcp-range=192.168.150.2,192.168.150.10,12h

日志文件

Jul 1 06:21:59 raspberrypi systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Jul 1 06:21:59 raspberrypi dnsmasq[1119]: dnsmasq: syntax check OK.
Jul 1 06:21:59 raspberrypi dnsmasq[1123]: dnsmasq: junk found in command line
Jul 1 06:21:59 raspberrypi dnsmasq[1123]: junk found in command line
Jul 1 06:21:59 raspberrypi dnsmasq[1123]: FAILED to start up
Jul 1 06:21:59 raspberrypi systemd[1]: dnsmasq.service: control process exited, code=exited status=1
Jul 1 06:21:59 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Jul 1 06:21:59 raspberrypi systemd[1]: Dependency failed for Host and Network Name Lookups.
Jul 1 06:21:59 raspberrypi systemd[1]: Unit dnsmasq.service entered failed state.

有人知道该怎么办吗,我是想用树莓派建立一个热点的,就是这个dnsmasq不好用啊,我的配置什么的在ubuntu系统下成功运行起来了的,但是复制到树莓派上之后用ap-hotspot创建热点之后手机一直连不上wif,连接超时并且不能获得ip地址,我用的是外接的无线网卡,并没有用自带的网卡,外接网卡是waln1,是不是因为有双网卡不能用bind?我不是很清楚
运行sudo dnsmasq
然后出现了 dnsmasq:unknown interface wlan1 这样的返回
怎么办啊!!很急很急

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • dabocaiqq dabocaiqq 2018-07-01 02:11
    点赞 评论 复制链接分享
  • oyljerry oyljerry 2018-07-01 03:20

    systemctl查看一下服务具体启动失败的信息。

    点赞 评论 复制链接分享
  • zwzwzwzwzxt 繁宵微梦 2018-07-01 03:27

    尝试使用sudo /etc/init.d/dnsmasq restart重启一下服务,如果还是不行,那估计就是你的dnsmasq版本比较新,而你的配置文件里使用了一些早就被官方摒弃了的语法和参数。
    把你的dnsmasq的配置文件*.conf还有具体的错误日志syslog贴出来,这样大家会更容易分析错误的原因以及提供解决办法。

    点赞 评论 复制链接分享
  • weixin_40630341 weixin_40630341 2018-07-01 05:43

    把你的dnsmasq的配置文件*.conf还有具体的错误日志syslog贴出来,这样大家会更容易分析错误的原因以及提供解决办法

    点赞 评论 复制链接分享

相关推荐