Skip to content

How to have dedicated DHCP options bind to a specific SSID?

hellfi edited this page Feb 17, 2016 · 6 revisions

Identify SSID Interface

As the following configuration is applied to a specific interface, you need to identify which interface / virtual interface your SSID is using, to do so you can use the following command:

nvram show | grep WiFiTest

Which should result something similar to:

size: 48528 bytes (17008 left)

This example give us wl0.2 as the interface that we need to tweak.


DNSMasq Script

Create the following file:


Give it the following permission:

chmod +xxx /jffs/scripts/dnsmasq.postconf

Its content should be:

source /usr/sbin/
logger "dnsmasq-dhcp: Configure wl0.2 to have special DHCP"
ifconfig wl0.2 netmask
iptables -D INPUT -i wl0.2 -j ACCEPT
iptables -I INPUT -i wl0.2 -j ACCEPT
ebtables -t broute -D BROUTING -i wl0.2 -p ipv4 -j DROP
ebtables -t broute -I BROUTING -i wl0.2 -p ipv4 -j DROP
pc_append "
" /tmp/etc/dnsmasq.conf

Feel free to customize the DHCP option and range.

Service-start Script

You need to create this file to ensure the DHCP service is restarted after the WiFi interface have been mounted. Create the following file:


Give it the following permission:

chmod +xxx /jffs/scripts/services-start

Its content should be:

service restart_dnsmasq


You can restart the dnsmasq server by doing service:

service restart_dnsmasq

It does avoid to reboot the router.

Also ensure you DHCP configuration have the following configuration:


This last one produce more advance logs that could help you. Example:

available DHCP range: --
vendor class: MSFT 5.0
client provides name: Eric-PC
DHCPREQUEST(br0) 00:ff:57:99:d8:98 
tags: lan, br0
DHCPACK(br0) 00:ff:57:99:d8:98 Eric-PC
requested options: 1:netmask, 15:domain-name, 3:router, 6:dns-server, 
requested options: 44:netbios-ns, 46:netbios-nodetype, 47:netbios-scope, 
requested options: 31:router-discovery, 33:static-route, 121:classless-static-route, 
requested options: 249, 252, 43:vendor-encap
next server:
sent size:  1 option: 53 message-type  5
sent size:  4 option: 54 server-identifier
sent size:  4 option: 51 lease-time  1d
sent size:  4 option: 58 T1  12h
sent size:  4 option: 59 T2  21h
sent size:  4 option:  1 netmask
sent size:  4 option: 28 broadcast
sent size: 14 option: 81 FQDN  03:ff:ff:45:72:69:63:2d:53:65:6b:6b:65:69
sent size:  1 option:252   0a
sent size:  8 option:  6 dns-server,
sent size:  4 option:  3 router
Clone this wiki locally
You can’t perform that action at this time.