SV: ISC.ORG DHCP Server Option 82 - Use Circuit ID to assign fixed IP address

Anders Rosendal anders at rosendal.nu
Wed Apr 30 03:44:51 UTC 2008


Hi Ryan

I have a almost similar need in my network. I have users on cisco-switches, which if they connect a "voip" device should get an IP from our voip-address-range and If the connect anything else they shout get the the public IP assigned to them. The network equipment is also configured so that the can set the public IP static on there nic.

 

The example below shows configuration for one port in the network "as07-Fa0/1". I of cause has to configure one "class" statement, and one "pool" statement for each customer in the network. 

If a customer are allowed to mote then one IP, you only has to add another "range x.x.x.x" in the pool statement. 

 

class "VOIP_TA2S" {

        match if(substring(option vendor-class-identifier, 0, 4) = "voip"); }

 

class "as07-Fa0/1" {

        match if(not (substring(option vendor-class-identifier, 0, 4) =

"voip") and substring (option agent.remote-id, 2, 4) = "as07" and suffix (option agent.circuit-id, 1) = 3); }

 

shared-network "my-network" {

        subnet 172.31.253.0 netmask 255.255.255.0 {

                option routers                  172.31.253.1;

                option subnet-mask              255.255.255.0;

                option broadcast-address        172.31.253.255;

                option tftp-server-name "172.31.253.10";

                option bootfile-name "configfile.dat";

                pool {

                        range 172.31.253.128 172.31.253.254;

                        allow members of "VOIP_TA2S";

                }

        }

        subnet 1.2.3.0 netmask 255.255.255.0 {

                option routers                  1.2.3.1;

                option subnet-mask              255.255.255.0;

                option broadcast-address        1.2.3.255;

                pool {

                        range 1.2.3.20;

                        allow members of "as07-Fa0/1";

                }

        }

}

 

Regards Anders Rosendal

 

Ps. The "agent.circuit-id, 1) = 3);" matches the port in the switch. Cisco has in there infinite wisdom made portindex 3 represent physical port 1, index 4 port 2 and so on. Ds.

 

Från: dhcp-users-bounce at isc.org [mailto:dhcp-users-bounce at isc.org] För Ryan Zierden
Skickat: den 30 april 2008 01:39
Till: dhcp-users at isc.org
Ämne: ISC.ORG DHCP Server Option 82 - Use Circuit ID to assign fixed IP address

 

ISC.ORG Community:

 

I have all the DHCP option data coming from my DSLAM up through up to my DHCP server as seen below.

 

Example of dhcpd.log show dhcp option 82 data:


Apr 25 13:57:08 inetdhcp dhcpd: DHCPDISCOVER from 00:90:d0:25:46:a4 via 172.21.61.1 
Apr 25 13:57:08 inetdhcp dhcpd: DHCPOFFER on 172.21.61.10 to 00:90:d0:25:46:a4 via 172.21.61.1 
Apr 25 13:57:08 inetdhcp dhcpd: Lease for 172.21.61.10 is connected to ADSL Port 1, on VPI/VCI 0/35, VLAN 310 on Switch 172.16.105.2 
Apr 25 13:57:08 inetdhcp dhcpd: DHCPREQUEST for 172.21.61.10 (192.168.250.200) from 00:90:d0:25:46:a4 via 172.21.61.1 
Apr 25 13:57:08 inetdhcp dhcpd: DHCPACK on 172.21.61.10 to 00:90:d0:25:46:a4 via 172.21.61.1

 

Got this simply by turning on "dhcpr enable" in theDSLAM and then on the VLAN interfaces on the Cisco 7609-S configuring "ip dhcp relay information trusted" and adding the following config to the global section of my dhcpd.conf file:

 

if exists agent.circuit-id 
{ 
log (info, concat("Lease for ", binary-to-ascii (10, 8, ".", leased-address), " is connected to ADSL Port ", 
binary-to-ascii (10, 8, "", substring(option agent.circuit-id, 0, 1)), ", on VPI/VCI ", 
binary-to-ascii (10, 16, "/", substring(option agent.circuit-id, 1, 4)), ", VLAN ", 
binary-to-ascii (10, 32, "", substring(option agent.circuit-id, 5, 4)), " on Switch ", 
binary-to-ascii (10, 8, ".", substring(option agent.circuit-id, 9, 4)))); 
}

 

My Question is:

How do configure ISC.ORG dhcpd.conf file to assign fixed-address based on the circuit ID information as opposed to the MAC-ID.

 

We have been doing the following which works but is cumbersum as CPE MAC ID change frequently:

# TEST PORT 1 
host rgn-172-21-61-10 { 
hardware ethernet 00:90:d0:25:46:a4; 
fixed-address 172.21.61.10; 
} 

And want I want to do is something like this (note this is not the correct syntax to configure this properly this but gives you the logic of what I am after:


To something like 
# TEST PORT 1 
host rgn-172-21-61-10 { 
agent.circuitID ADSL Port 1, on VPI/VCI 0/35, VLAN 310 on Switch 172.16.105.2; 
fixed-address 172.21.61.10; 
}

 

 

Does anyone have ISC.ORG DHCP configured properly where it is working to assign fixed IP address based on circuit id information from option 82? If so, I would be very interested in hearing from your as to how you properly configure this scenario. Most of my research so far indicates I have to have ISC.ORG 3.x (which I do) and use client class and subclass but I cannot find working examples of this nor do I know if it is the correct direction to pursue or not. 

 

I thank you in advance for any assistance you may be able to offer me.

 

Thank you,

 

Ryan Zierden

IT Manager

diversiCOM - MTC

 


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/>  at 
mars.rosendal.nu, and is believed to be clean. 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner on mars.rosendal.nu,
and is believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20080430/850fec3a/attachment.html>


More information about the dhcp-users mailing list