ip dhcp pool binding?

Unanswered Question
Jun 14th, 2009
User Badges:

I have a SIP doorphone device that I'm trying to set up.  I want it to be on the "phone" dhcp pool and have a pre-determined ip address given this device when it requests an address.


Though CCA>routing>dhcp server>>dhcp binding tab I'll enter the pool name "phone", the ip I want assigned in the "phone" (in dhcp assign range) , the mask, the devices mac and a name.  Apply, OK but it doesn't take.  If I exit and come back there's nothing, show run = no change.   If I change the previous settup by adding a different pool name "doorphone" for example it works fine and show run will display the new entry for the new dhcp pool.


If I reboot the device it still gets assigned via the "data" dhcp server.  I haven't found anything through CLI that will do the trick either.  Am I taking the wrong approach.  With this set up I aslo tried assigning it an IP in the "pool" excluded range > no joy.  I also tried changing the smartport role to to just vlan 100 but that didn't seem to work setting it to trunk mode and native vlan 100.


Bottom line is I want this callbox to connect to a port and get assigned a pre-determined ip address in the "phone" dhcp pool in vlan 100.  Since I'm now only at the end of week 2 of the IOS experience I'm still reading alot & assuming my way through this.  Any thoughts.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Marcos Hernandez Sun, 06/14/2009 - 11:23
User Badges:
  • Blue, 1500 points or more

VLAN 100 is a tagged VLAN by default. That means that devices connecting to that VLAN will have to implement dot1q marking on their NIC. A Cisco IP phone typically learns about this VLAN via CDP, but other devices (such as your SIP doorphone) will come up on the data VLAN (untagged). What is the problem with leaving it on the data VLAN?


Marcos

viningele Sun, 06/14/2009 - 15:25
User Badges:

Ya know I actually think I understood what you just said so maybe there's hope.  Unless a device is tagged to the contrary it will be assumed VLAN 1 and my device isn't doing any 802.1q trunking, so no tag.


As I mentioned, I'm doing alot of readiing but I'm also doing alot of assuming and I just assumed voip devices that are part of CME would want to be on the same VLAN.  If they don't that's cool but I'd still want to bind the doorphone device to a specific address but nothing I've tried seems to allow this in the "data" dhcp pool either.  I have to create another pool using an address covered by the "data" dhcp pool for it to register but when I reboot the device I get the same old address assigned, not the one I want.


I would almost think that the bindings would be outside of the pools like the exclusions.  I found the "address hardware-address" command but that doesn't appear in the HTTP CLI and doesn't work in telnet CLI.


////////////////////////////////////////////////////////////////////


On another note I recently updated the software and now on the CCA dashboard my flash usage is at 97.5% and I don't recall what it was before but this can't be right can it?  Does it write a back up image of the previous version or something? Should I be concerned and delete anything from the flash?

Skyler Spence Mon, 06/15/2009 - 08:02
User Badges:
  • Bronze, 100 points or more

Give the following a try:


you have your normal data dhcp pool


ip dhcp pool data

network 192.168.10.0 255.255.255.0

....

...

...



now make a new dhcp pool within this network with the "client-identifier" field configured


ip dhcp pool STATIC

host 192.168.10.12 255.255.255.0
client-identifier 0100.0a95.f12c.91 !MAC Address
client-name laptop


Try this out and let me know if it works.

viningele Mon, 06/15/2009 - 12:10
User Badges:

Here's what I had:


!
ip dhcp pool data
   import all
   network 192.168.10.0 255.255.255.0
   default-router 192.168.1.65
!
ip dhcp pool metecom1
   import all
   host 192.168.10.41 255.255.255.0
   hardware-address 0060.9f92.e3f1
   default-router 192.168.1.65
   client-name metecom1
!


If I change to this:


!
ip dhcp pool metecom1
   import all
   host 192.168.10.41 255.255.255.0
   client-identifier 0060.9f92.e3f1
   default-router 192.168.1.65
   client-name metecom1
!


Which automatically dropt the "hardware-address" line when adding the "client-id" line.  Nothing effectively changes.  Unless the ascii name for the pool being named "STATIC" actually has programming meaning/purpose beyond just a name then I don't see how the command block would work if I change the names to STATIC as in your example.


To me, it would make sense to either put the static bindings in the pool block which defines the dhcp pool or outside the pools all together like the exclusions.  When a request comes in the dhcp server needs to take the next array index with in the pool assigement rande and then compare that to the exclusions to verify that index postion will work.


If you had a STATIC pool or STATIC lines outside the pool when a request comes in it would first check the static table for mac or id matches if none then run through the pool to get the next avaialable index postion, then check that against the exclusions and loop through advancing the index position if need be to check again and agian.


I would also tend to think that when a request comes in "IF" a pool listed first can satisfy the request the other pools "ELSE" are ignored.  Basic IF/ELSE logic.  Of course depending on how the hyerarchy works it could work as a bunch of "IF" with out any "ELSE" and the last IF that matches a the condition overwites and previous assigments by other IF matches.   Since the code above doesn't work I wouldn't thinks it's a bunch of "IF's".

viningele Mon, 06/15/2009 - 17:49
User Badges:

I discovered a couple mistakes on my part.  First was the client-id, I used the mac and not 01"mac".  I tried the "debug ip dhcp server packet" but couldn't figure out the rest.  I also had that device bound already, go figure.  It never showed up in CCA . cinfig>routing>dhcp server>>dhcp binding tab but I happened by troubleshooting> Net diagnostic> DHCP binding and there I found it was already set to the address it had been getting.  Removed this and then made the correct CLI entries and it work as it should.


In reading the link you referenced I like the idea of creating a "static mapping text file" and then using the "origin file" command in the dhcp pool.  My question now is can I keep that file on the flash?  Then point the url to localhost or 127.0.0.1/filename.txt.  Next question is how would I get the file on the flash?


I entered through CLI (tftp entry was already there):


!
ip ftp source-interface FastEthernet0/0
ip ftp username vining
ip ftp password xxxxxx
ip tftp source-interface Loopback0
!

But I can't connect using FileZilla, should  I be able to or do I need an TFTP client?  Does cisco have a TFTP client app available?


From FileZilla: Connection attempt failed with "ECONNREFUSED - Connection refused by server".


I also asked a few posts ago about my flash usage.  Currently it's at 97.5 % after the software upgrade, this doesn't seem right.  Are there files I should remove?

Marcos Hernandez Mon, 06/15/2009 - 20:14
User Badges:
  • Blue, 1500 points or more

The IOS TFTP Server does not allow PUT operation (uploading). Only GET is supported (downloading).


Marcos

viningele Tue, 06/16/2009 - 05:56
User Badges:

That's kind of a bummer!  Seems like the ideal place for a static dhcp map file if there was get/put ftp support.


Fortunately in the config I would likely need this type of mapping for a large pool of staticly assigned dhcp addresses I would be using an AMX processor which allows to read and write to flash.


created this txt file and placed it in the root folder of the AMX processor.


(dhcp_static_map.txt)


*time* Jun 16 2009 08:22 AM *version* 2 !IP address    Type    Hardware address     Lease expiration 192.168.10.41 /24   1      0060.9f92.e3f1    Infinite 192.168.10.42 /24   1      0060.9f90.d333    Infinite *end*

Deleted my previous manual binding pool entry for the "ip dhcp pool metecom1"


Created another pool below:


!
ip dhcp pool STATIC_POOL
   import all
   origin file http://192.168.10.42/dhcp_static_map.txt
   default-router 192.168.1.65
!

(as soon as you enter the origin file entry it loads)


and it works! (last two entries)


VAVUC520#show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name
10.1.1.10           0100.2545.944c.27       Jun 17 2009 08:05 AM    Automatic
10.1.1.11           0100.2545.93e5.4f       Jun 17 2009 08:09 AM    Automatic
10.1.1.12           0100.24c4.4322.e2       Jun 17 2009 08:05 AM    Automatic
192.168.10.10       0100.17f2.0fc4.c8       Jul 16 2009 07:05 AM    Automatic
192.168.10.12       0100.0b5d.cc9b.0f       Jul 16 2009 08:33 AM    Automatic
192.168.10.13       0063.6973.636f.2d30.    Jul 16 2009 08:16 AM    Automatic
                    3032.332e.3334.6238.
                    2e37.3263.302d.566c.
                    31
192.168.10.41/24    0060.9f92.e3f1          Infinite                Static
192.168.10.42/24    0060.9f90.d333          Infinite                Static
VAVUC520#


Now I can have one easy to edit master list of static assigned dhcp addresses but I guess I'll need to force the reload through CLI or reboot/restrart the UC520 for it to take affect when I make changes.



I believe I read that the bound addresses have to be in the dhcp excluded range so that the dhcp server doesn't hand them out and create a conflict, is this correct?  Or is the system smart enough to automatically know not assign a bound address to another device?



Any takes on the earlier flash questions?

Marcos Hernandez Tue, 06/16/2009 - 09:46
User Badges:
  • Blue, 1500 points or more

Your origin file command could also point to the UC500 flash:


"origin file flash:test.txt"


But I think it is easier to keep it on your server, since it might be easier to manipulate.


If you want to optimize the flash space, you could get rid of phone loads that you are not using. Short of that, there's nothing more we can do. We are working to implement a way to better do file handling. Stay tuned.


Thanks,


Marcos

viningele Wed, 06/17/2009 - 14:52
User Badges:

Reading the origin file from flash didn't seem to work.  I had no problem creating a new directory and then loading the file into that directory but after trying numerous attempts at reading from flash I gave up.  I even put a copy in the root flash directory and tried then flash & slot0 in every variation I could think of but no joy.


I then lost my ability to log into telnet which kept me busy trying to figure that out for a while.  Somehow these lines changed:


line vty 0 4
login local


line vty 5 100
login local


to


line vty 0 4
login
transport input telnet ssh
transport output telnet ssh
line vty 5 100
login
transport input telnet ssh
transport output telnet ssh
!


which made me loose telnet and CCA's ability to use telnet for the flash usage, system status & voicemail status displays in the dashboard gui.  Fortunately I've been using NotePad++ which is a freeware editor for many languages which allows you to open two or more files at once and run a compare plugin which lines up the files and highlights any differences.  Every time I do a "show run" I copy at paste it into a new file in the Notepad++ editor with that day's date and a version number.


If you have a tips & tricks section that might be a good thing to post cuz it's a great way to compare a known working config to a modified variation of that config with issues and see the differences between them.  Not the first time it saved my ...!


I still want to get the origin file to read from the flash so I'll give that another attemp soon and if it works I'll let you know.

viningele Wed, 06/17/2009 - 18:32
User Badges:

Thanks! That did the trick.



VAVUC520#config t
Enter configuration commands, one per line.  End with CNTL/Z.
VAVUC520(config)#tftp-server flash:/VAV/dhcp_static_map.txt alias staticmap
VAVUC520(config)#ip dhcp pool static
VAVUC520(dhcp-config)#origin file tftp://192.168.10.1/staticmap
Loading staticmap from 10.1.10.2 (via Loopback0): !
[OK - 221 bytes]

VAVUC520(dhcp-config)#

viningele Thu, 06/18/2009 - 04:38
User Badges:

The condensed version of this thread including the procedure to create a new directory on the flash and copying to that directory from a URL:


//////////  CREATING STATIC DHCP FILE AND MAPPING ///////////////////////


//////////  CREATE A DIRECTORY ON THE UC520 FLASH ///////////////////////

VAVUC520#mkdir flash:VAV
Create directory filename [VAV]?  (just hit enter again)
Created dir flash:VAV
VAVUC520#


//////////  COPY TO FILE INTO NEW FLASH DIRECTORY //////////////////////

AVUC520#copy http://username:[email protected]/dhcp_static_map.txt flash://VAV/dhcp_static_map.txt
Destination filename [/VAV/dhcp_static_map.txt]?   (just hit enter again)
Loading http://*****:[email protected]/dhcp_static_map.txt
221 bytes copied in 0.708 secs (312 bytes/sec)
VAVUC520#

(remove "username:password@" from above URL in no user/password set)

(the copy to file name shouldn't need to be the same as the copy from file name.  Should work similar as "save as".  If the filename already exists it should overwite and if it doesn't exist it will create it on your flash.)


//////////  MAP TFTP SERVER TO ALIAS URL ON FLASH   ////////////////////

VAVUC520#config t
Enter configuration commands, one per line.  End with CNTL/Z.
VAVUC520(config)#tftp-server flash:/VAV/dhcp_static_map.txt alias staticmap (you can make this alias name anything you want)
VAVUC520(config)#ip dhcp pool static
VAVUC520(dhcp-config)#origin file tftp://192.168.10.1/staticmap (reference the alias name)
Loading staticmap from 10.1.10.2 (via Loopback0): !
[OK - 221 bytes]
VAVUC520(dhcp-config)#end
VAVUC520#


/////////// standard URL origin entry  /////////////////////////////////

VAVUC520(config)#no ip dhcp pool static
VAVUC520(config)#ip dhcp pool static_pool
VAVUC520(dhcp-config)#import all
VAVUC520(dhcp-config)#default-router 192.168.1.65 (THIS IS A DIFFERENT ROUTER GETEWAY / USUALLY IP OF UC520)
VAVUC520(dhcp-config)#origin file http://192.168.10.42/dhcp_static_map.txt

Marcos Hernandez Thu, 06/18/2009 - 07:00
User Badges:
  • Blue, 1500 points or more

Viningele,


This is a great post. May I ask you to take this information and post it in a document? That way you can accumulate points in your account.


Thanks,


Marcos

viningele Thu, 06/18/2009 - 16:24
User Badges:

What do points in my account do?


What type of doc?  .doc, .pdf?


If I made this doc where do I put it to get these points?



Could you get forum admin to add support of tags in posts like:


quote & code (I can't actually post them cuz they cause errors)

 

These two tags are really usefull in formatting posts to make them more readable and with use of the quote tag respond to multiple persons in one post.


I attached a screen shot example of what I mean.

Attachment: 
Moderator Fri, 06/19/2009 - 07:58
User Badges:

Hi Viningele,


Members can accumulate points for posting content (discussions, documents, videos). For documents, you can create a new document with the community's text editor, or you can attach a file to upload. Members receive points for either method. Look for the Actions widget to create a new document in the community space that is most relevant to the content you are uploading.


Also, if a member marks a thread as a question, and someone replies to it with valuable information, the originator of the thread can mark posts as helpful or answered. Not only will the post show up as answered in the discussion list, but points are awarded to those who provided the useful responses as well.


Members receive rankings based on the number of points they earn. These rankings appear under your avatar in posts and in your profile to let others know how involved in the community you are.


Thanks for your feedback on the quote and code fields. The quote function is already available, by clicking on the speech bubble in the top row of the toolbar.


Could you get forum admin to add support of tags in posts like:


quote & code (I can't actually post them cuz they cause errors)

Could you give me more information about what the code field would require? Would it be possible to use the quote field and erase the text that appears and use it as a code field?


If you have any other questions please let us know.


Thanks,


Cisco Moderation Team

Hi


I got as far as to let my dhcp server load the static bindings file:


tftp-server flash:dhcp-static-boston.txt


ip dhcp pool test
   origin file tftp://192.168.2.42/dhcp-static-boston.txt


Loading dhcp-static-boston.txt from 192.168.2.42 (via Vlan1): !
[OK - 686 bytes]


but for some reason the database remained empty


#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
                    Hardware address/
                    User name


the file content is the following:


#more flash:dhcp-static-boston.txt
*time* Jun 10 2010 01:00 PM
*version* 2
!IP address    Type      Hardware address               Lease expiration
192.168.1.16         1            00-12-50-14-a1-2a         Infinite
192.168.1.5          1            00-13-e6-a1-b0-c0         Infinite
*end*


what went wrong?


thanks,

Hello,


The reason why the static bindings where not accepted was because the parser

wouldn't recognise the - separator. Addresses in the xx.xx.xx.xx.xx.xx or

xxxx.xxxx.xxxx are recognised.



The issue after the static bindings have been read is to get them correctly

assigned.



For that I used another cisco router as dhcp client.


By defaut if you simply configure the interface as a dhcp client the request

will use a long client identifier.


For example:

Bindings from all pools not associated with VRF:

IP address Client-ID/ Lease expiration Type

Hardware address/

User name

10.10.1.13 0063.6973.636f.2d35. Jun 22 2010 03:32 PM

Automatic

3437.352e.6430.6463.

2e61.6239.302d.566c.

31


I had to set the client id on the client side to make it use it's mac

address as client identifier:

ip dhcp client client-id Vlan1

ip address dhcp


And in the static binding file: set type to "id" and add "01." in front of

the hardware address.

Actions

This Discussion