1.安装centos 6.0 dhcp 服务
[[email protected] ~]# 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也卸载了。
[[email protected] ~]# yum install dhcp -y 成功安装 [[email protected] ~]# cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf
[[email protected] ~]# /etc/init.d/dhcpd restart
正在启动 dhcpd: [失败]
[[email protected] ~]# 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.
以上没有日志找不出什么问题,然后调试命令看看哪里报错了!
[[email protected] ~]# /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.
[[email protected] ~]# 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; 这里不需要双引号 }
时间: 2024-10-12 17:03:45