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.
-
DHCP is the standard method for clients to negotiate an address. – Zoredache Sep 19 '13 at 15:50
-
I know you said Linux, but in Windows now we have: http://technet.microsoft.com/en-us/library/hh831538.aspx - not sure if something exists in the Linux world akin to this. – TheCleaner Sep 19 '13 at 15:58
-
2@TheCleaner Muahahahaha - ISC DHCP supports client class matching since 3.0 which means it has been supported in a mainline release for more than a decade by now and the feature has been present in alpha/beta releases since around 1999. – the-wabbit Sep 19 '13 at 16:11
-
@syneticon-dj - well there you go! Can you tell my Linux exposure is limited to building an XBMC box? – TheCleaner Sep 19 '13 at 16:13
2 Answers
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.

- 5,381
- 15
- 23
-
Thanks "USD Matt"! Actually I am using RaspberryPi as a WLAN router. It is connected to the Internet via 3G USB donggle, additionally it is equipped with a WiFi antenna. As mentioned, this AP/router is supposed to assign IP addresses to mobile-nodes based on their speed (considering that some sensor on RasberryPI detect the speed of the mobile device) or their mac-addresses (considering info from manufacturer field from MAC address). – imkhan Sep 19 '13 at 16:22
technically speaking the access-point is a layer 2 device and it does not operate on the IP level - it is not aware of ip addresses at all, it just forwards frames based on MAC addresses.
you probably refer to access point integrated with a router and dhcp server [aka any cheap 'wireless gateway/soho router' device having 1 WAN port, 4 LAN ports and WIFI interface].
DHCP server - regardless if you use one built into the 'soho wifi router' or separate connected to the same LAN segment as your access point - will be the right solution to control address assignment to the devices connecting via the wireless network [and the cabled one too].

- 29,981
- 6
- 66
- 109
-
I think you might have read the title and not the question itself. ;) So I updated the question's title. – TheCleaner Sep 19 '13 at 16:00
-
Actually I am using RaspberryPi as a WLAN router. It is connected to the Internet via 3G USB donggle, additionally it is equipped with a USB WLAN antenna. As mentioned, this AP/router is supposed to assign IP addresses to mobile-nodes based on their speed or their mac-addresses bud I don't know where to start? "+1" – imkhan Sep 19 '13 at 16:14