Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if the dhcp startup exception of Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to do abnormal dhcp startup of Linux". In daily operation, I believe that many people have doubts about how to deal with abnormal dhcp startup of Linux. The editor has consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubt of "how to do abnormal dhcp startup of Linux". Next, please follow the editor to study!

Recently, automatic installation of Centos requires Linux's dhcp service. Use yum-y install dhcp to install the rpm package of dhcp and dhcp-common, and report an abnormal error when starting dhcp.

Since dhcp is an operating system and service, you can check the operating system log / var/log/messages for dhcp startup failure. The error in using service dhcpd start Times is as follows:

[root@localhost log] # tail-f messages

May 13 20:30:45 localhost dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1

May 13 20:30:45 localhost dhcpd: Copyright 2004-2010 Internet Systems Consortium.

May 13 20:30:45 localhost dhcpd: All rights reserved.

May 13 20:30:45 localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/

May 13 20:30:45 localhost dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file

May 13 20:30:45 localhost dhcpd: Wrote 0 leases to leases file.

May 13 20:30:45 localhost dhcpd:

May 13 20:30:45 localhost dhcpd: No subnet declaration for eth2 (192.168.48.134).

May 13 20:30:45 localhost dhcpd: * * Ignoring requests on eth2. If this is not what

May 13 20:30:45 localhost dhcpd: you want, please write a subnet declaration

May 13 20:30:45 localhost dhcpd: in your dhcpd.conf file for the network segment

May 13 20:30:45 localhost dhcpd: to which interface eth2 is attached. **

May 13 20:30:45 localhost dhcpd:

May 13 20:30:45 localhost dhcpd:

May 13 20:30:45 localhost dhcpd: Not configured to listen on any interfaces!

May 13 20:30:45 localhost dhcpd:

May 13 20:30:45 localhost dhcpd: This version of ISC DHCP is based on the release available

May 13 20:30:45 localhost dhcpd: on ftp.isc.org. Features have been added and other changes

May 13 20:30:45 localhost dhcpd: have been made to the base software release in order to make

May 13 20:30:45 localhost dhcpd: it work better with this distribution.

May 13 20:30:45 localhost dhcpd:

May 13 20:30:45 localhost dhcpd: Please report for this software via the CentOS Bugs Database:

May 13 20:30:45 localhost dhcpd: http://bugs.centos.org/

May 13 20:30:45 localhost dhcpd:

May 13 20:30:45 localhost dhcpd: exiting.

For the error report when dhcp starts No subnet declaration for eth, you need to check the confirmation message:

1. The ethn Nic of dhcp error message and the dhcp configuration file determine that subnet is 192.168.48.0 in the same network segment.

[root@myserver tftpboot] # cat / etc/dhcpd.conf

Ddns-update-style none; # sets the DHCP server mode

Ignore client-updates; # forbids client updates

Subnet 192.168.48.0 netmask 255.255.255.0 {# set network segment

Option routers 192.168.48.254; # set the gateway

Range 192.168.48.160 192.168.48.200; # set the range of dhcp server IP address lease

Default-lease-time 604800; # default lease time

Max-lease-time 605800; # maximum lease time

Next-server 192.168.48.134; # tftp server address

Filename "pxelinux.0"; # File name under the root directory of the tftp server

}

[root@myserver tftpboot] #

2. When using a vmware virtual machine, you need to note that the subnet configured by dhcp is in the network segment where the eth0 network card Ip is located, and the eth0 cannot be hostonly, but can be bridge mode or NAT mode.

At the same time, you need to ping the Ip address of your own network card in the linux host.

Then, instead of using service dhcpd start to start dhcp, use dhcpd-cf / etc/dhcpd.conf eth2 to specify the network card that dhcp listens to when dhcp starts.

The dhcp starts up and starts normally.

[root@myserver tftpboot] # dhcpd-cf / etc/dhcpd.conf eth2

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/

He config file

Wrote 2 leases to leases file.

Listening on LPF/eth2/00:0c:29:89:78:3d/192.168.48.0/24

Sending on LPF/eth2/00:0c:29:89:78:3d/192.168.48.0/24

Sending on Socket/fallback/fallback-net

[root@myserver tftpboot] # There's already a DHCP server running.

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.

[root@myserver tftpboot] # service dhcpd status

Dhcpd (pid 2501) is running...

[root@myserver tftpboot] #

If you need to boot dhcp automatically, and then use the command chkconfig dhcp on, you can add dhcpd-cf / etc/dhcpd.conf eth2 to / etc/rc.local

At this point, the study on "what to do about the abnormal dhcp startup of Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report