我试图在我的Debian计算机上configuration一个DHCP服务器来运行一个tftp服务器。 我有1个eth0,这是eth0。 我跟着几个教程,但没有一个跟我一起工作。 我安装了dhcp3-server,这是我的/etc/dhcp3/dhcpd.conf文件:
subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.10 192.168.1.100; option domain-name-servers 192.168.1.1; option netbios-name-servers 192.168.1.1; option routers 192.168.1.1; option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; default-lease-time 86400; max-lease-time 676800; }
我不需要一个非常复杂也不安全的configuration。 我所需要的只是连接到networking的所有计算机都将通过DHCP服务器获取IP地址。 我甚至不需要启动服务,因为我偶尔会使用它。 networking没有任何其他的DHCP服务器运行。 问题是我无法启动服务,当我看看/ var / log / syslog,我得到这个错误:
Nov 17 19:15:58 debian dhcpd: Not configured to listen on any interfaces! Nov 17 19:17:01 debian /USR/SBIN/CRON[2311]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Nov 17 19:18:43 debian dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1 Nov 17 19:18:43 debian dhcpd: Copyright 2004-2010 Internet Systems Consortium. Nov 17 19:18:43 debian dhcpd: All rights reserved. Nov 17 19:18:43 debian dhcpd: For info, please visit https://www.isc.org/software/dhcp/ Nov 17 19:18:43 debian dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1 Nov 17 19:18:43 debian dhcpd: Copyright 2004-2010 Internet Systems Consortium. Nov 17 19:18:43 debian dhcpd: All rights reserved. Nov 17 19:18:43 debian dhcpd: For info, please visit https://www.isc.org/software/dhcp/ Nov 17 19:18:43 debian dhcpd: Wrote 0 leases to leases file. Nov 17 19:18:43 debian dhcpd: Nov 17 19:18:43 debian dhcpd: No subnet declaration for eth0 (192.168.1.27). Nov 17 19:18:43 debian dhcpd: ** Ignoring requests on eth0. If this is not what Nov 17 19:18:43 debian dhcpd: you want, please write a subnet declaration Nov 17 19:18:43 debian dhcpd: in your dhcpd.conf file for the network segment Nov 17 19:18:43 debian dhcpd: to which interface eth0 is attached. ** Nov 17 19:18:43 debian dhcpd: Nov 17 19:18:43 debian dhcpd: Nov 17 19:18:43 debian dhcpd: Not configured to listen on any interfaces!
我不知道你是否需要它,但这里是我的ifconfig输出:
eth0 Link encap:Ethernet HWaddr f0:4d:a2:f1:38:dc inet addr:192.168.1.27 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: 2a01:e35:8bb7:2480:f24d:a2ff:fef1:38dc/64 Scope:Global inet6 addr: fe80::f24d:a2ff:fef1:38dc/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2733 errors:0 dropped:0 overruns:0 frame:0 TX packets:2697 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1110122 (1.0 MiB) TX bytes:476771 (465.5 KiB) Interrupt:18 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:126 errors:0 dropped:0 overruns:0 frame:0 TX packets:126 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:7884 (7.6 KiB) TX bytes:7884 (7.6 KiB)
将eth0添加到/etc/default/isc-dhcp-server INTERFACES行。
我刚刚写了关于在VirtualBox中build立一个FAI实验室,其中包括configurationDHCP和TFTP服务器。 你可以在这里find这篇文章: http : //plathrop.tertiusfamily.net/2011/11/01/fai-lab-with-virtualbox-part-i.html – 你会想跳到我configurationDCHP的部分用于PXE引导。
虽然这篇文章是为Ubuntu编写的,但是在Debian上这些说明应该完全一样。