Mac – No IP address given to router until after cloning MAC address from another computer

adsldhcpmac addressnetworkingrouter

This problem had me occupied most of the day until I finally solved it just a little while ago. Unfortunately I still don't understand why the problem surfaced in the first place or why my final "solution" worked. I'm hoping that someone can help me shed some light on this.

We have an ADSL connection and use a D-Link DSL-320B modem. We have a D-Link DIR-120 router connected to this modem. This has worked perfectly fine up until today when we disconnected the router and connected a computer (call it A) directly to the modem because it was getting an unusable connection through the router for some reason. We later also performed a factory reset on the DIR-120 router.

Unfortunately, after the above steps the router did not receive any IP address (through DHCP) from the ADSL connection anymore. During my attempts to debug this I noticed that my laptop (call it B) didn't get any IP address either (when connected directly to the modem). I noticed the following syslog entries repeating over and over while trying to connect:

Jun 2 19:30:12 jiddo-laptop dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
Jun 2 19:30:12 jiddo-laptop dhclient: DHCPOFFER of 80.70.144.221 from 80.70.144.254
Jun 2 19:30:12 jiddo-laptop dhclient: DHCPREQUEST of 80.70.144.221 on eth0 to 255.255.255.255 port 67
Jun 2 19:30:28 jiddo-laptop dhclient: last message repeated 2 times

At this point computer A could still get a connection just fine tho (when connected directly to the modem).

I then tried to change the MAC address of the router to an arbitrary one (a copy of computer B's MAC address but with the last digit increased by one). The router still did not get assigned any IP address.

Finally I tried making the router clone the MAC address of a third computer (call it C). C has never been connected directly to the modem. Doing this worked. After cloning the MAC address of computer C the router is immediately assigned an IP address and the internet connection works as it did prior to all this.

Now, my question is, why would computer B and the original MAC address of the router not be able to get an IP address while two other computers worked just fine? Why would changing to an arbitrary MAC address not work while cloning the MAC address of another computer did? Could the router's MAC address have been blocked by the ISP for some reason (and what could cause this)?

I found this question, but my situation seems more like a blacklisting of some MAC addresses rather then allowing just a single MAC address.

Does anyone have any experience or knowledge of this sort of situation?

Best Answer

It is common for an ADSL/DSL modem to learn the MAC address of the connected device and only work for that MAC address. Usually, this is done when the modem powers up. In other cases the MAC address is registered an upstream server run by the ISP.

In some cases, the memorized MAC address expires after some time. I would expect this occurs when the DHCP lease expires. The MAC address may be memorized on the ISP's DHCP server, rather than the modem. (Your modem will be registered with them as an authorized device.) In this case, the first device to ask for an address after the lease expires will be allowed to register. I expect this is what you encountered. You could verify this by disconnecting your computer until the lease expires and connecting a different device.

I believe that some ISPs use a DHCP server which tracks leases based on the ADSL/DSL modem's identification. The lease then tracks the MAC address, assigned IP address, and lease expriration time for each modem. Normally, the DHCP server would track MAC addresses, the assigned IP address, and expiration time. In both cases additional information provided in the DHCP request such as the device's name may also be tracked.

Many Home/Office routers can be configured to clone the MAC address of a connected computer. This allows them to take over an existing DHCP lease. Resetting the DIR-120 to factory settings would have cleared any cloned MAC address preventing you from regaining a lease tied to a cloned MAC address.

You may be able to switch MAC addresses by triggering a DHCP release before disconnecting the computer. This should end the existing lease, allowing you to obtain a new lease using a new MAC address. Obtaining a lease with a new MAC address will likely get you a new IP address. DHCP renewals usually don't change the IP address.

Related Question