|
2020年3月开始准备认真学习Linux.
在学习DHCP服务器时遇到问题:
[root@localhost ~]# service dhcpd restart
Starting dhcpd: [FAILED]
检查了log记录:
Mar 19 13:02:47 localhost dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
Mar 19 13:02:47 localhost dhcpd: Copyright 2004-2010 Internet Systems Consortium.
Mar 19 13:02:47 localhost dhcpd: All rights reserved.
Mar 19 13:02:47 localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Mar 19 13:02:47 localhost dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Mar 19 13:02:47 localhost dhcpd: Wrote 0 leases to leases file.
Mar 19 13:02:47 localhost dhcpd:
Mar 19 13:02:47 localhost dhcpd: No subnet declaration for eth0 (192.168.163.129).
Mar 19 13:02:47 localhost dhcpd: ** Ignoring requests on eth0. If this is not what
Mar 19 13:02:47 localhost dhcpd: you want, please write a subnet declaration
Mar 19 13:02:47 localhost dhcpd: in your dhcpd.conf file for the network segment
Mar 19 13:02:47 localhost dhcpd: to which interface eth0 is attached. **
Mar 19 13:02:47 localhost dhcpd:
Mar 19 13:02:47 localhost dhcpd:
Mar 19 13:02:47 localhost dhcpd: Not configured to listen on any interfaces!
Mar 19 13:02:47 localhost dhcpd:
Mar 19 13:02:47 localhost dhcpd: This version of ISC DHCP is based on the release available
Mar 19 13:02:47 localhost dhcpd: on ftp.isc.org. Features have been added and other changes
Mar 19 13:02:47 localhost dhcpd: have been made to the base software release in order to make
Mar 19 13:02:47 localhost dhcpd: it work better with this distribution.
Mar 19 13:02:47 localhost dhcpd:
Mar 19 13:02:47 localhost dhcpd: Please report for this software via the CentOS Bugs Database:
Mar 19 13:02:47 localhost dhcpd: http://bugs.centos.org/
Mar 19 13:02:47 localhost dhcpd:
Mar 19 13:02:47 localhost dhcpd: exiting.
[root@localhost ~]#
说No subnet declaration for eth0 (192.168.163.129).
我的虚拟机网络配置:
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:E5:DD:75
inet addr:192.168.163.129 Bcast:192.168.163.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee5:dd75/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3093 errors:0 dropped:0 overruns:0 frame:0
TX packets:2409 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:224983 (219.7 KiB) TX bytes:2337377 (2.2 MiB)
Interrupt:19 Base address:0x2000
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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@localhost ~]# cat /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
# next-server 192.168.0.79;
# filename "pxelinux.0";
allow booting;
allow bootp;
subnet 192.168.163.0 netmask 255.255.255.0 {
option routers 192.168.163.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.163.255;
# option nis-domain "domain.org";
# option domain-name "192.168.0.10";
# option domain-name-servers 192.168.0.11;
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;
range 192.168.163.150 192.168.163.200;
host ns {
hardware ethernet 00:1a:a0:2b:38:81;
fixed-address 192.168.163.101;
}
哪里的配置有错呢?求助。。