Saturday, September 19, 2020

Network Monitoring, Static Addresses, and WiFi Extenders

In my previous post, I wrote about turning a Raspberry Pi into a network monitor, using Nagios and arpwatch. If you want to use Nagios to monitor networked equipment, then each piece of monitored equipment needs to have a static IP address--an IP address that never changes. Most networked devices are configured by default to request an IP address via DHCP (Dynamic Host Configuration Protocol) from the WiFi router, and by default, WiFi routers will assign a dynamic IP address--an IP address that might be different each time the device boots up.

There are two ways to go about assigning static IP addresses. You can configure each networked node's network interface, using whatever management tools the node might have. You'd have to manually configure each device, and you'd need to keep track of the IP addresses so that you don't accidentally assign two nodes the same address. You'd also want to be sure that all the IP addresses lie outside the range of dynamic addresses that your WiFi router doles out.

 

The easier, more centrally managed solution is to use your WiFi router to assign static addresses. Most WiFi routers let you configure static addresses that the router will assign via DHCP. This is probably a writable table of MAC (media access control) addresses and their corresponding static IP addresses, as in the image above--on this router, the table is called a DHCP reservations list. The beauty of this approach is that you only need to configure your WiFi router and then reboot your networked equipment. This is the method I used.

All went well--until I added a WiFi extender to our home network. We live in a split-level home, and our WiFi router sits on a shelf in a closet on the ground floor. Signal strength is not the best on the top floor. We'd recently visited some friends, who'd asked me to configure a new WiFi extender they'd bought, a TP-Link AC750. It wasn't hard to set up, and it seemed to work fine. Back at home, I decided to buy one for the top floor. When it arrived, I configured it and reconfigured a couple pieces of equipment to use the extender. The extender worked well, except that monitored devices that used the extender no longer were visible in Nagios. A quick glance showed that they'd new IP addresses, not their static IP addresses. What had happened?

 

I logged into our WiFi router's management interface and looked at the client status. I could see that the TP-Link had changed the MAC addresses of the devices that were using the WiFi extender. The TP-Link had substituted the first three bytes of its MAC address for the first three bytes of each device's MAC address. The simple fix was to change the MAC address in the DHCP reservations list to match the new MAC address the TP-Link was using.

I don't know whether the altering of MAC addresses by the TP-Link is common to all DHCP relays, or whether this is something unique to this brand of WiFi extender. In any case, although it's annoying to have to change the DHCP reservations list every time I switch a device from the WiFi router to the extender or vice-versa, it's not a difficult work-around.


No comments: