What's new
  • 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!

Static DHCP DNS without MAC Address Possible?

Thanks for the update @Debu , glad you got it working as you wanted.

I'd like to make a couple of comments if you don't mind.:rolleyes:

hosts.add
Contains just IPs that I either need to have static or are place holders for VMs that I will bring up with a static IP. Also I a Server Pool File system that uses a Virtual IP and this seems to be the only way to just create an IP and hostname.
I have about 50 or so IPs in here, but here is a short example of a few.
Code:
192.168.1.3 cisco
192.168.1.4 verizon
192.168.1.5 basement
Because these are static entries you should adjust your DHCP server's IP pool starting address to begin after these.

dnsmasq.conf.add
Contains IPs that dhcp will bind to specific Mac addresses. Useful where a device is using DHCP and you want to control it's IP from a central location
Code:
##Hardcoded Mac Address for Static DHCP##
##VM 1 ##
dhcp-host=00:11:22:33:44:55,192.168.1.148
This is effectively the same as setting up entries in the GUI's "DHCP list", so it could be done there instead.

But in the GUI with LAN->DHCP Server, when I use the pull down, it won't just let me add an IP and hostname. It makes me have to either place a mac address or pick a mac address. The problem is that sometimes I don't have a mac yet since it isn't generated at that moment.
That's correct. A DHCP server works on MAC addresses not IP's. IP-to-hostname is done by DNS or the hosts file.
 
One thing that might help you simplify the mechanics is that you can put your script in a dnsmasq postconf script. That scripts always gets run after dnsmasq.conf has been generated but before dnsmasq gets started. That way, your changes get applied every time dnsmasq needs to be restarted by the firmware - no need to restart it yourself.
 
One thing that might help you simplify the mechanics is that you can put your script in a dnsmasq postconf script. That scripts always gets run after dnsmasq.conf has been generated but before dnsmasq gets started. That way, your changes get applied every time dnsmasq needs to be restarted by the firmware - no need to restart it yourself.
That's a really good point.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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

Staff online

Back
Top