Linux – How to assign specific IP addresses to wireless clients based on criteria (mac address, etc.) for a mobile device/phone

linuxlinux-networkingmobile-devicesnetworking

I want to assign a special (based on its MAC-address or speed of mobile device) IP addresses to each incoming mobile device/phone when it enter the range of my access-point (AP). I am not sure whether DHCP would be helpful to achieve the task. Any help or pointer would be highly appreciated.

Best Answer

This is usually done by assigning a 'reservation' for the client's MAC address on the DHCP server.

Basically a DHCP server uses has a range (called a pool) of addresses it can use which are assigned to a client. A reservation just tells it to always provide the same address when a DHCP request comes from a specific MAC address.

In order to do this, the device on your network that is providing addresses to users (the DHCP server) will need to support reservations. This could be the access point itself, a router (the most common), or an actual server. It's entirely possible that the device currently providing DHCP on your network might not support reservations, in which case the only real solution is to replace that device with something that does. (either by actually replacing it, or switching DHCP off and running DHCP on something that will allow reservations)

If we knew what device is currently providing addresses on your network we may be able to advise on whether it supports the required feature.