LinuxDHCP network troubleshooting example

Source: Internet
Author: User
Tags network troubleshooting
Article Title: LinuxDHCP network troubleshooting example. Linux is a technology channel of the IT lab in China. Includes desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categories. An SuSE Linux 9.1 DHCP server is deployed on the network one day. DHCP is a Dynamic Host Configuration Protocol used to automatically provide IP addresses, subnet masks, and routing information to computers. The software installation process on the server and client is very simple. However, clients on the Network (using the operating system: Mandrake Linux 9.0 and SuSE Linux 9.1) cannot obtain IP addresses. According to experience, the Linux DHCP server may not be able to receive Request packets from DHCP clients with 255.255.255.255. Run the ifconfig-a command to query the NIC settings of the server:
[Root @ www cao] # ifconfig
Eth0 Link encap: Ethernet HWaddr 00: 50: FC: 56: 75: F5
Inet addr: 192.168.1.4 Bcast: 192.168.1.255 Mask: 255.255.255.0
Up broadcast running mtu: 1500 Metric: 1
RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 4 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 100
RX bytes: 0 (0.0 B) TX bytes: 240 (240.0 B)
Interrupt: 10 Base address: 0x2000
......
I did not find the MULTICAST settings above. Why does the system need the MULTICAST function? The reason is: to enable the dhcpd (dhcp daemon) to communicate with the DHCP client normally, the dhcpd must send packets to the IP address 255.255.255.255, however, in some Linux systems, the 255.255.255.255 IP address is used as the IP address of the subdomain (local subnet) broadcast in the listening area. Therefore, you need to add 255.255.255.255 to the route table to activate the MULTICAST function; run the following command: route add-host route 255.255 dev eth0.
Troubleshooting.
If an error message indicating 255.255.255.255: Unknown host occurs, first modify the file:/etc/hosts and add a line:
255.255.255.255 dhcp
Run the following command after saving the disk:
Route add-host route 255.255.255 dev eth0
To save the settings, add a line to the/etc/sysconfig/static-routes file:
Eth0 host 255.255.255.255

When the server is restarted, the route table is automatically set ). Then run the ifconfig query command to check whether clients using SuSE Linux 9.1 are working normally, but those using the Mandrake Linux 9.0 client still do not obtain the IP address. After referring to the Linux tool book and discussing with friends in the Linux community, we found that the problem lies in the incompatibility between the DHCP Client program used by the Mandrake Linux 9.0 client and the DHCP server.

Troubleshooting method: run the rpm command to uninstall the default DHCP Client Program dhclient used by the Mandrake Linux 9.0 client. install other client programs compatible with the DHCP server: dhcpcd.
#/Etc/rc. d/init. d/network stop
# Rpm-e dhclient
# Rpm-ivh dhcpcd-1.3.22pl4-2mdk.i586.rpm
#/Etc/rc. d/init. d/network start

The network and the new DHCP client will be started several seconds later. Run the ifconfig command to check that each Mandrake Linux 9.0 client has been assigned an IP address. Setting IP addresses for each computer in the network is troublesome. Using DHCP can solve these problems. The DHCP server can automatically assign IP addresses. However, when the server and client are incompatible, the client program must be changed. Linux provides four DHCP client programs: pump, dhclient, dhcpxd, and dhcpcd. Understanding the client programs of different Linux releases is important for the Linux network administrator.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.