Linux appears 169.254.0.0

problem found:

I haven't touched the routing table information, but when I checked it, I found that the network address route of 169.254.0.0 appeared.

# route -n

	Kernel IP routing table
	Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
	0.0.0.0         172.16.1.254    0.0.0.0         UG    0      0        0 eth1
	10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
	169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
	169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth1
	172.16.1.0      0.0.0.0         255.255.255.0   U     0      0        0 eth1

problem causes:

169.254.0.0 was originally a preset ip address network segment generated when the DHCP (Dynamic Host Configuration Protocol) service in the windows system local area network environment encountered an address conflict. The default mechanism for address conflicts is set during the operation of the DHCP service.

As for this mechanism also used by Linux, 169.254.0.0 exists, so it doesn't matter what it is, because it can't be used on the Internet. However, the emergence of 169.254.0.0 must be caused by conflicts caused by setting up an IP address.

**

The principle when DHCP automatically obtains an IP address:
01. The host opens the DHCP function
02. The host sends a DHCP request packet to the switching network (broadcast transmission)
03. The DHCP server receives the request packet and responds to the packet
04. Host Receive the response packet to configure the address information, and reply to the DHCP confirmation packet
05. The DHCP server will adjust the IP address pool information
06. According to the lease time information, the DHCP server will confirm whether the address will continue to be used, if not, the address will be recycled. Assign to other hosts

**

Solution:

Linux online environment:

Add at the end of the file

# vim /etc/sysconfig/network
	NOZEROCONF=yes
# systemctl restart network

There is also a situation in VMware Workstation:
this type of address conflict usually occurs when cloning multiple hosts. It is caused by two or more virtual machines with the same IP address running, causing an address conflict. An address is automatically assigned by dhcp. segment.

At this time, it is not easy to turn off one, because the discovery time (Discover Time) of the default mechanism is 1 hour as the dividing line.

In the implementation of NE80E/40E, if a conflicting IP address is found, we can redistribute this IP address for use after 1 hour. When there is a conflicting IP address and the detection time does not exceed 1 hour, run the reset dhcp server conflict all command to release the conflicting IP address.

Solution:
1. Shut down multiple hosts that may conflict (route -n check which hosts have the address and shut down) to release the address. Simply restarting the network card will not work! ! !

2. Turn on one of the hosts and reset a brand new ip address (must be brand new!), in order to re-identify dhcp, the address pool information is also automatically updated, restart the network card to take effect.

3. Change the new IP you just set to the IP you should set, and you must restart the host (restarting the network card does not take effect at this time) to take effect.
why? Please see the DHCP default mechanism above.

4. Turn on other hosts in turn. Check whether the address is valid. If you do not follow the above method to continue the setting takes effect.

For lazy people: everything will be fine when you sleep and wake up! ! !
why? Please see the DHCP default mechanism above.

For more exciting content, please follow the WeChat public account to get

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_45320660/article/details/106199383