- 论坛徽章:
- 0
|
我根据网上说的,为了耍酷,用源代码编译的,装系统的时候没有选择DHCP包的,步骤是:
(主站:http://www.isc.org/index.pl?/sw/dhcp/)
sh# wget ftp://ftp.isc.org/isc/dhcp/dhcp-3.0.6.tar.gz
sh# wget ftp://ftp.isc.org/isc/dhcp/dhcp-3.0.6.tar.gz.asc
sh# wget http://www.isc.org/about/openpgp/pgpkey2006.txt
sh# mkdir ~/.gnupg
sh# gpg --import pgpkey2006.txt
sh# gpg --verify dhcp-3.0.6.tar.gz.asc
sh# tar -zxvf dhcp*.gz
sh# cd dhcp*
sh# ./configure
sh# make
sh# make install
sh# cp ./server/dhcpd.conf /etc
sh# gedit /etc/dhcpd.conf
写入以下并保存:
ddns-update-style interim;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name "mydomain.org";
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
range 192.168.1.150 192.168.1.200;
}
host haagen {
hardware ethernet 08:00:2b:4c:59:23;
fixed-address 192.168.1.222;
}
sh# touch /var/state/dhcp/dhcpd.leases
sh# route add -host localhost dev eth0
sh# route add -host 255.255.255.255 dev eth0 (为eth0网卡添加路由,将为挂在网卡eth0上的机子分配IP)
sh# gedit /etc/rc.d/rc.local (在最后一行增加: route add -host 255.255.255.255 dev eth0)
sh# shutdown -r now
重启机器后:
sh# dhcpd start
Internet Systems Consortium DHCP Server 4.0.0a2
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Wrote 0 leases to leases file.
No subnet declaration for start (no IPv4 addresses).
** Ignoring requests on start. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface start 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.
怎么会没有subnet呢?搞了我两天了,网上也有类似的问题,但都没解决,我再来这里看看有没有能解决的大哥
sh# vi /etc/sysconfig/dhcpd 里面有 HCPDARGS=eth0 |
|