What's new

Assign static IP address question

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

newnews

Regular Contributor
Hello,

The apple devices now have default to use "private address" for wifi connection which changing the mac address from time to time. This causes problem to assign a static ip address to them. However the hostname has never been changed on those devices. I wonder if it is possible to assign static ip address based on MAC or the hostsname. For example. I have "dhcp-host=00:90:A9:3B:5F:01,192.168.10.14,homecloud,3600", the router should assign 192.168.10.14 when a device popup with mac address 00:90:A9:3B:5F:01 or hostname "homecloud".

I wish it can be added in the future if it is not currently possible.
 
The dhcp-host directive does have an "id" field (i.e., a client identifier) that can be used to assign a static IP. And I've used it in the past w/ Ubuntu. But it requires the client to specify that specific field in its DHCP request, which most clients do NOT (at least in my experience).

Code:
dhcp-host=id:xyz,192.168.10.14,homecloud,3600

And given the fact it's already masking its real MAC address, I don't see why it would provide a consistent client identifier.

This is just another example of a growing trend to give higher priority to privacy over administrative control for security, network management, etc. And there are no easy answers to get around it short of perhaps whitelisting access based on MAC address. IOW, if the client chooses to obscure itself, it gets no access.
 
Hello,

The apple devices now have default to use "private address" for wifi connection which changing the mac address from time to time. This causes problem to assign a static ip address to them. However the hostname has never been changed on those devices. I wonder if it is possible to assign static ip address based on MAC or the hostsname. For example. I have "dhcp-host=00:90:A9:3B:5F:01,192.168.10.14,homecloud,3600", the router should assign 192.168.10.14 when a device popup with mac address 00:90:A9:3B:5F:01 or hostname "homecloud".

I wish it can be added in the future if it is not currently possible.
You are confusing static IP address with manually assigned via DHCP.
Yes, you can assign a static IP address at the client regardless of the MAC. However, when you go to another WIFI network you will still have the same static IP address and likely no internet access.
If you want to Manually Assign an IP address at the router just turn off the random MAC feature at the client.
 
For example. I have "dhcp-host=00:90:A9:3B:5F:01,192.168.10.14,homecloud,3600", the router should assign 192.168.10.14 when a device popup with mac address 00:90:A9:3B:5F:01 or hostname "homecloud".
This won't work as you want because that statement says give 00:90:A9:3B:5F:01 address 192.168.10.14 and override any hostname supplied by the client with "homecloud".

You would have to split it into two separate non-conflicting statements, e.g.:
Code:
dhcp-host=00:90:A9:3B:5F:01,homecloud
dhcp-host=192.168.10.14,homecloud
I'm not sure whether this is what you're asking for.

EDIT: Re-reading your post I don't believe you can assign the same IP address based on MAC address or host name. dnsmasq will see it as an error and refuse to start up. But if you're sure the client's host name doesn't change you can just use that instead of the MAC address.
Code:
dhcp-host=192.168.10.14,homecloud,3600
 
Last edited:
This won't work as you want because that statement says give 00:90:A9:3B:5F:01 address 192.168.10.14 and override any hostname supplied by the client with "homecloud".

You would have to split it into two separate non-conflicting statements, e.g.:
Code:
dhcp-host=00:90:A9:3B:5F:01,homecloud
dhcp-host=192.168.10.14,homecloud
I'm not sure whether this is what you're asking for.

EDIT: Re-reading your post I don't believe you can assign the same IP address based on MAC address or host name. dnsmasq will see it as an error and refuse to start up. But if you're sure the client's host name doesn't change you can just use that instead of the MAC address.
Code:
dhcp-host=192.168.10.14,homecloud,3600
Wonderful. That works. thanks
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top