设为首页 收藏本站
查看: 566|回复: 0

[经验分享] centos 6.0 dhcp 报错及解决

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-2-10 07:33:56 | 显示全部楼层 |阅读模式
1.安装centos 6.0 dhcp 服务
1
2
3
4
5
6
[iyunv@localhost ~]#   yum install dhcp -y
Centos6,安装的时候出现,
Transaction Check Error:
  file /usr/share/man/man5/dhcp-eval.5.gz from install of dhcp-common-12:4.1.1-43.P1.el6.centos.i686 conflicts with file from package dhclient-12:4.1.1-12.P1.el6.i686
  file /usr/share/man/man5/dhcp-options.5.gz from install of dhcp-common-12:4.1.1-43.P1.el6.centos.i686 conflicts with file from package dhclient-12:4.1.1-12.P1.el6.i686
Error Summary




发现dhclient有冲突,yum remove dhclient,连带的NetworkManager也卸载了。
1
2
[iyunv@localhost ~]#   yum install dhcp -y  成功安装
[iyunv@localhost ~]# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf




[iyunv@localhost ~]# /etc/init.d/dhcpd restart
正在启动 dhcpd:                                           [失败]
1
2
3
4
5
6
7
8
9
10
11
[iyunv@localhost ~]# tail -l /var/log/messages
Feb  2 21:09:23 localhost dhcpd:
Feb  2 21:09:23 localhost dhcpd: This version of ISC DHCP is based on the release available
Feb  2 21:09:23 localhost dhcpd: on ftp.isc.org.  Features have been added and other changes
Feb  2 21:09:23 localhost dhcpd: have been made to the base software release in order to make
Feb  2 21:09:23 localhost dhcpd: it work better with this distribution.
Feb  2 21:09:23 localhost dhcpd:
Feb  2 21:09:23 localhost dhcpd: Please report for this software via the CentOS Bugs Database:
Feb  2 21:09:23 localhost dhcpd:     http://bugs.centos.org/
Feb  2 21:09:23 localhost dhcpd:
Feb  2 21:09:23 localhost dhcpd: exiting.




以上没有日志找不出什么问题,然后调试命令看看哪里报错了!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[iyunv@localhost ~]#  /usr/sbin/dhcpd restart   #调试命令
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/dhcp/dhcpd.conf line 114: 192.168.20.10 (262): expecting IP address or hostname
  next-server "192.168.20.10"
               ^
/etc/dhcp/dhcpd.conf line 114: expecting a parameter or declaration
  next-server "192.168.20.10";
                             ^
/etc/dhcp/dhcpd.conf line 115: unexpected end of file
^
Configuration file errors encountered -- exiting
This version of ISC DHCP is based on the release available
on ftp.isc.org.  Features have been added and other changes
have been made to the base software release in order to make
it work better with this distribution.
Please report for this software via the CentOS Bugs Database:
    http://bugs.centos.org/
exiting.




1
2
3
4
5
6
7
8
9
10
11
12
[iyunv@localhost ~]# vi /etc/dhcp/dhcpd.conf  # 配置如下
subnet 192.168.20.0 netmask 255.255.255.0 {
  range 192.168.20.100 192.168.20.200;
  option domain-name-servers ns1.internal.example.org;
  option domain-name "internal.example.org";
  option routers 192.168.20.10;
  option broadcast-address 192.168.20.255;
  default-lease-time 600;
  max-lease-time 7200;
  filename "pxelinux.0";
  next-server 192.168.20.10; 这里不需要双引号
}



以上修改了发现可以启动但是起来有out了。还是继续找原因。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[iyunv@localhost ~]# service dhcpd restart
正在启动 dhcpd:                                           [确定]
[iyunv@localhost ~]# /etc/init.d/dhcpd status
dhcpd 已死,但 pid 文件仍存
[iyunv@localhost ~]# tail -f /var/log/messages
Feb  3 02:12:49 localhost dhcpd: This version of ISC DHCP is based on the release available
Feb  3 02:12:49 localhost dhcpd: on ftp.isc.org.  Features have been added and other changes
Feb  3 02:12:49 localhost dhcpd: have been made to the base software release in order to make
Feb  3 02:12:49 localhost dhcpd: it work better with this distribution.
Feb  3 02:12:49 localhost dhcpd:
Feb  3 02:12:49 localhost dhcpd: Please report for this software via the CentOS Bugs Database:
Feb  3 02:12:49 localhost dhcpd:     http://bugs.centos.org/
Feb  3 02:12:49 localhost dhcpd:
Feb  3 02:12:49 localhost dhcpd: exiting.
Feb  3 02:12:49 localhost kernel: type=1400 audit(1422900769.294:87): avc:  denied  { setgid } for  pid=4606 comm="dhcpd" capability=6  scontext=unconfined_u:system_r:dhcpd_t:s0 tcontext=unconfined_u:system_r:dhcpd_t:s0 tclass=capability  

大概的意思就是启动dhcp连接读取系统文件被denied,就查找相关权限;

[iyunv@localhost ~]#  /usr/sbin/dhcpd restart
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/
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Wrote 0 class decls to leases file.
Wrote 0 deleted host decls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wrote 0 leases to leases file.
No subnet declaration for restart (no IPv4 addresses).
** Ignoring requests on restart.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface restart is attached. **
Not configured to listen on any interfaces!
This version of ISC DHCP is based on the release available
on ftp.isc.org.  Features have been added and other changes
have been made to the base software release in order to make
it work better with this distribution.
Please report for this software via the CentOS Bugs Database:
    http://bugs.centos.org/
exiting.
[iyunv@localhost ~]# ls -l /etc/dhcp/dhcpd.conf
-rw-r--r--. 1 root root 3626 2月   3 02:17 /etc/dhcp/dhcpd.conf  #显示root用户
[iyunv@localhost ~]# vi /etc/init.d/dhcpd
prog=dhcpd    #
user=root    #原先是dhcpd    改为root
group=root   # #原先是dhcpd  改为root
exec=/usr/sbin/dhcpd
lockfile=/var/lock/subsys/dhcpd
pidfile=/var/run/dhcpd.pid
statedir=/var/lib/dhcpd
改完重试一下!
[iyunv@localhost ~]# service dhcpd restart
关闭 dhcpd:                                               [确定]
正在启动 dhcpd:                                           [确定]
[iyunv@localhost ~]# ps -ax | grep dhcpd
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ
4992 ?        Ss     0:00 /usr/sbin/dhcpd -user root -group root
4996 pts/1    S+     0:00 grep dhcpd






运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-42304-1-1.html 上篇帖子: RHEL6.4安装使用ajenti:一款好用的VPS控制面板 下篇帖子: linux中安装软件
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表