[Dnsmasq-discuss] DHCP assignment with dynamic VLANs

Andrea Galvani and.galva at gmail.com
Mon Oct 21 16:52:02 BST 2013


Hello everyone.

I'm running dnmasq 2.62 on a OpenWRT router and I'm trying to understand 
if this DHCP configuration is feasable or not:

The address space that I'm using for my network is 10.1.1.0 /24.
When a new user accesses my network through Wi-Fi I need to give him a 
private network just for comunicating with the router, so I DYNAMICALLY 
allocate a /30 vlan interface just for him. This vlan interface's 
address space is NOT part of my network address space, for example it 
can be 10.2.2.120 /30.
In this case, the router will configure 10.2.2.122 as its address for 
the new vlan and the user must obtain 10.2.2.121 through DHCP.
I know the user's MAC address so I thought about a static assignment.

I added this to dnsmasq.conf
---
# the IP pool for the VLAN
dhcp-range=set:vlan6,10.1.2.120,10.1.2.123

# static IP for the user
dhcp-host=br-lan,00:0d:88:65:5a:5d,10.1.2.121

# tagging the user
dhcp-host=00:0d:88:65:5a:5d,set:vlan6

# options for user...
dhcp-option=tag:vlan6,3,10.1.2.122
dhcp-option=tag:vlan6,54,10.1.2.122
dhcp-option=tag:vlan6,1,255.255.255.252
dhcp-option=tag:vlan6,28,10.1.2.123
dhcp-option=tag:vlan6,6,10.1.2.122
dhcp-option=tag:vlan6,15,vlan6
---

"br-lan" is my lan interface which is bridged to wireless
"vlan6" is the tag I use to distinguish the options for my user/vlan. I 
set the router's address on the vlan as dgw and server identifier, the 
/30 netmask and the broadcast address.

As a result I get:
"no address range available for DHCP request via br-lan"

But if I set a DHCP range for br-lan (10.1.1.0 /24) the user will get an 
address from BR-LAN POOL, ignoring the static assignment and the part 
regarding the vlan!

Basically the user gains access to the LAN and sends a broadcast DHCP 
Discover on that interface. What should happen is that this user is in 
someway "redirected" on the new VLAN interface (different address pool), 
and obtains an IP of that interface.

Is it possible to have a behaviour like this with dnsmasq?

Thanks for your attention

Andrea




More information about the Dnsmasq-discuss mailing list