想要安装一个dhcp服务器。但是客户的环境不让用yum源安装。那就用源文件安装吧。参考文档https://www.crazycen.com/linux/514.html

1.tar zxvf dhcp-4.3.1.tar.gz 

2.cd dhcp-4.3.1

3. ./configure && make && make install

 

[root@test ~]# cat /etc/dhcpd.conf
subnet 192.168.0.0 netmask 255.255.255.0{
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option domain-name "test.com";
range 192.168.0.10 192.168.0.200;
default-lease-time 21600;
max-lease-time 43200;
}
[root@test ~]#

 

[root@test ~]# dhcpd
Internet Systems Consortium DHCP Server 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcpd.conf
Database file: /var/db/dhcpd.leases
PID file: /var/run/dhcpd.pid
Can't open lease database /var/db/dhcpd.leases: No such file or directory --
check for failed database rewrite attempt!
Please read the dhcpd.leases manual page if you
don't know what to do about this.

If you think you have received this message due to a bug rather
than a configuration issue please read the section on submitting
bugs on either our web page at www.isc.org or in the README file
before submitting a bug. These pages explain the proper
process and the information we find helpful for debugging..

exiting.
[root@test ~]#

 

[root@test ~]# touch /var/db/dhcpd.leases
[root@test ~]# dhcpd
Internet Systems Consortium DHCP Server 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Config file: /etc/dhcpd.conf
Database file: /var/db/dhcpd.leases
PID file: /var/run/dhcpd.pid
Wrote 0 leases to leases file.

No subnet declaration for eth2 (172.16.1.14).
** Ignoring requests on eth2. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth2 is attached. **


No subnet declaration for eth1 (10.6.188.252).
** Ignoring requests on eth1. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth1 is attached. **

Listening on LPF/eth0/38:ea:a7:8c:6d:88/192.168.0.0/24
Sending on LPF/eth0/38:ea:a7:8c:6d:88/192.168.0.0/24
Sending on Socket/fallback/fallback-net
[root@test ~]#

 

 

posted on 2017-07-27 09:29  uxiuxi  阅读(876)  评论(0)    收藏  举报