Dnsmasq – A simple DHCPv6 server for Embedded devices

Most of the embedded devices which is available in the market right now has some kind of network connectivity which is either wired or wireless. If the device is capable of running linux then we can make it act as router (for home/SOHO) and provide IPv6 addresses to the clients which connects to it. In this case the device which is providing the IP addresses is going to act as a DHCPv6 Server. There are a lot of options for doing this using many packages that is available.

Dnsmasq is one of them but it has very low requirements on the memory footprint which fits exactly into the embedded systems realm. Hoping that you have already installed or cross compiled dnsmasq for your device below are the options which can be used in the config file “/etc/dnsmasq.conf“.

interface=eth0 # Interface name could be wired or wireless
listen-address= # address to listen on
dhcp-range=,,24h # IPv4 range and lease time
dhcp-range=2001:db8::02, 2001:db8::ff,12h # IPv6 range and lease time
bind-interfaces # bind to the interface
server= # Google DNS server
enable-ra # Enable router advertisement
dhcp-authoritative # authoritative DHCP mode

As you can see, the config is very simple and provides ability to add both IPv4 and IPv6 addresses separately.  “enable ra” option makes sure the router advertisement packets are sent out onto the network periodically.  And also “dhcp-authoritative” option can be added if this device is the only DHCP server running in the network (which is mostly the case).

Pls note, using “-c” command line switch dnsmasq can be started with a particular config file of our choice.

The above config provides global IPv6 address to the local network. Pls refer to this blog for different type of IPv6 addresses.