The router sends the same IP to two devices, why is the network good and bad sometimes?
I've been using my printer for two and a half years without any problems, but it suddenly became like this a while ago.: I can ping successfully, but the printing service just doesn't work. I powered off the printer for ten seconds and the symptoms disappeared. ; Came back again in the evening. The next morning it was normal, then it happened again in the afternoon. It took me three days to figure it out. The problem was not with the printer, but with the router sending the same address to the two machines.
This kind of problem is much harder to detect than a disconnection. The whole family was disconnected and everyone saw it. ; IP duplication is hit and miss, you can't even say it's broken. I will break down the three sources of address pooling, issuance of duplicate numbers, and manually fill in the pool, and then talk about how to judge and fix it.
The router only issues numbers within a certain number, which is called the address pool.
First, let’s explain clearly the rules for issuing calls. The router does not issue numbers randomly. There is a designated address pool in the background. The default for home computers is 192.168.1.100 Issued to 199, a full hundred numbers. When you look through the device list, you see that the IP addresses of your home devices are all in the early 100s. This is the reason. The Xiaomi one is 192.168.31.100 To 199, the network segments are different and the pool size is the same number.
The pool is in the "LAN Settings" in the background, and some are called "DHCP Server". Xiaomi is hidden in the LAN settings of common settings, and Mercury Tenda is hidden under the network parameters of advanced settings. There are only two valid reasons for changing the pool: The first is to make room for devices with manual fixed addresses, and the second is that there are literally hundreds of devices at home. If you get to this point, I advise you to clear the zombie devices first.
One hundred account holders are enough. I counted 49 mobile phones, computers, cameras, sweepers, and speakers in total at home, accounting for half of the pool. Those Zigbee light bulb sockets are resold through the gateway and do not occupy the pool.
I wrote about the time when I turned off the DHCP switch and the WiFi in the whole house was full, but no one could get online. When I turned off the router DHCP with my hand, the whole house was disconnected that night. , all about this machine that issues numbers. The switch was not moved this time, because the number was too heavy.
How did the number get heavier?: There is a typical rollover point on each of the two coming roads.
The first way is that the printer does not ask for the number itself. Most printers default to DHCP, but my old laser machine was slow to start up and get a number. I thought it kept losing connections, so I filled in an address directly on the printer panel.: 192.168.1.105 . This number happened to fall into the pool. One day I bought a new mobile phone and connected it to WiFi. The router sent it upwards from 100 to 105. Both of them had 105.
The turning point lies in the performance of "good times and bad times". After the printer is turned on, it first occupies 105 ; When the mobile phone is connected, the router has already remembered 105 and given it to the mobile phone. The ARPs of the two devices are broadcast separately. Which network card number corresponds to 105 in the gateway's ARP table depends on who reported it last. Whoever turns it on later works better, and the other one starts spinning. The first two times I restarted the printer, the symptoms changed sides. This is the reason.
The second route is more subtle: There is more than one machine issuing numbers at home. When the sub-router is changed to the AP, the switch forgets to turn off DHCP, or the switch dials and sends the number by itself in the optical modem routing mode. These are typical cases. The symptom of this situation is that half of the devices can access the Internet and half cannot, and each refers to its own gateway. It is not a simple duplication of numbers.
| origin | how happened | Typical performance |
|---|---|---|
| The hand-filled address fell into the pool | The printer/NAS manually filled in the number between 100 and 199 in the device. | That device disappears and appears, restarts and changes sides. |
| DHCP sends duplicate number | The device's network number has not been returned, and the zombie record is occupying the space. | The number obtained by the new device collides with the offline old device |
| Both machines are issuing calls | DHCP is not turned off on the secondary router, or the optical modem is still in routing mode. | Half of the devices can access the Internet, and each gateway refers to its own |
How to determine if it is a duplicate IP and not some other problem?
The three symptoms put together are basically it. First, it is good and bad sometimes, and if you change the boot order of the device, the symptoms will change. ; The second is that it can be pinged but cannot be used. Files cannot be transferred, printing cannot be done, and the NAS mapping is disconnected. ; Third, the same IP in the background device list has two different network card numbers, or the same address sometimes displays "Unknown Device" and sometimes displays the printer.
The judgment method can be completed in two nights. First clear the ARP table on the computer, and then Windows arp -d , Mac knock sudo arp -d 192.168.1.105 ,Then arp -a Look at which network card number 105 corresponds to. Then go to the network settings of the two devices to see their addresses. The same IP but different network card numbers are confirmed.
Add another cheap verification: Connect the two devices suspected of conflicting directly to the router with network cables and test the ping again. If the ping is successful, it means that the three-layer address is accessible. If it cannot be pinged, it means that the conflict occurs at the gateway arbitration layer - only the latest one is kept in the ARP table. This set of judgments is consistent with The difference between MAC address and IP address That article is connected, MAC is the device ID card, IP is the house number issued, and the conflict occurs at the house number level.
Of the three methods of repair, the first choice is background binding, not manual filling.
The preferred modification method is to do it in the background of the router and not in the device. There is an "address binding" or "static IP allocation" in the background, which is tied to the device's MAC address. The device will still automatically get a number, but it will get the same one every time. Key devices such as printers, NAS, and cameras should all be tied up in this way. It’s done in two steps on Xiaomi router. 192.168.31.1 Two-step binding to fixed IP write the most detailed ; The batch of Mercury’s Tengda Fixed IP for the device in the background Just walk through it once.
The second option is to move the address filled in by hand outside the pool. One rule: The pool is 100 to 199, so you fill in 1 to 50, or 201 and onward. 192.168.1.50 , 192.168.1.201 Either way, fill in the gateway 192.168.1.1 , mask 255.255.255.0 , fill in one router for DNS 223.5.5.5 . After filling in the information, ping the gateway and it will work. Don't think this number is ugly. It is outside the pool. If the router cannot send it, it cannot hit it.
The third type is DHCP with sub-router. When the AP uses the sub-router, DHCP must be turned off, and the number is uniformly sent by the main router. If you miss this step, the addresses of all devices in the house will jump randomly, and the addresses will change every time you restart the network, which is more annoying than having repeated IP addresses. The article about changing the old route to AP Don’t throw away extra routers This is one of the four steps, don’t miss it.
Two things to check
One thing is those offline zombie records in the background. The device has been disconnected from the network but the account has not been returned. There are a bunch of "offline but occupied account" records in the list. It does not affect the situation normally, but it pops up when the pool becomes nervous. I counted 23 of them in my house, and I felt relieved immediately after clearing half of the pool.
The other thing is the random MAC of the phone. Mobile phones with private addresses will change a set of network card numbers every time they change scenarios. The router will issue a new number as a new device, and the pool will be slowly eaten up. This is probably where the unrecognizable manufacturer names in the equipment list come from. Wrote before Use the first six digits of MAC to name the background device , 80% of the equipment that cannot be recognized is on this line.
Three pitfalls and ending sequence
I have stepped on three pitfalls. first one: After the repair, the problem remains the same - the old address is still in the device's hand and has not been released. I have to restart the device to get the new number. second: The MAC bound in the background was copied incorrectly. Because the random address was changed, it meant that it was not bound. third: I thought that changing the router would be enough. In fact, the optical modem was still in routing mode and issued calls by itself. After changing one, there was no change. In this case, first check which address the gateway is. 192.168.1.1 The router is sending the message, and the gateway is 192.168.2.1 There is a high probability that the optical modem is emitting light.
| order | action | What to see |
|---|---|---|
| first step | Find the same IP in the background and hang two sets of MAC | Are there any duplicate addresses? |
| Step 2 | arp -d then look at arp -a | Which IP does the gateway point to? |
| Step 3 | Tie the IP of key equipment in the background | Is the address stable after restarting? |
| Step 4 | Move the hand-filled address outside the pool | Is pinging the gateway possible? |
| Step 5 | Turn off DHCP on the secondary router | Is the gateway the only one? |
Follow this sequence, and in most cases the decision will be finalized in the second step. After repairing, remember to go back to the background and refresh the device list to see if the printer is stable with the bound number - it is not complete until it is stable.
