[Dnsmasq-discuss] IP address based on switch port number (option 82)

Simon Kelley simon at thekelleys.org.uk
Tue Feb 16 13:27:36 GMT 2010


Ignacio.Bravo at belden.com wrote:
> Simon Kelley <simon at thekelleys.org.uk> wrote on 16/02/2010 10:38:56:
> 
>> Ah, yes. That's a bug, a rather obvious face-plant bug ;-)
>>
>> What version of Ubuntu are you using? I have test release which fixes 
>> this and should solve the unicast-renewal problem and I can probably 
>> send it to you as a Debian/Ubuntu package.
>>
>> Simon.
> 
> Hi Simon,
> Ubuntu 9.04 april 2009

OK, that's the one recent version I don't have ready access too. I can 
talk you through building the packages from source.

download

http://www.thekelleys.org.uk/dnsmasq/test-releases/dnsmasq-2.53test7.tar.gz

and expand it

tar xzf dnsmasq-2.53test7.tar.gz


make sure you have the tools needed to build

sudo apt-get install build-essential
sudo apt-get build-dep dnsmasq

then cd in to dnsmasq-2.53 and run

fakeroot debian/rules binary

That should give you two .deb files one directory up. Install those with

cd ..
sudo dpkg -i dnsmasq-base_2.53-1_i386.deb dnsmasq_2.53-1_all.deb	


> 
> Regarding your suggestion to activate Relay option in all ports and just 
> configure a dynamic pool for 'non per port specific IPs'. I think this 
> config would apply the 'not-port-related' pool even to those ports with an 
> specific IP. Wouldn`t it? 
> I did a first try and seems so, I did (iptables is activated), please let 
> me know if fits:
> 
> dhcp-range=net:switch1,10.10.35.2,10.10.35.5,255.255.255.0 <-----port 
> specific range
> dhcp-circuitid=puerto3,b9:06:00:00:01:01:01:03
> dhcp-remoteid=switch1,00:06:00:80:63:60:e1:64
> dhcp-range=10.10.35.40,10.10.35.42,255.255.255.0 <----non specific pool
> 
> All ports get an ip from the non specific pool

The magic you need is that you can invert tags, so make the last line

dhcp-range=net:#switch1,net:#puerto3,10.10.35.40,10.10.35.42,255.255.255.0

Then it can only be used when none of the port specific tags are in use.

As you expand the system, you'll have to add any other tags in there, 
but there's no limit on the number allowed.


Cheers,

Simon.




More information about the Dnsmasq-discuss mailing list