cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1339
Views
5
Helpful
16
Replies

static mapping, DHCP on a Cisco 2900

roncro
Level 3
Level 3

Hello,

 

I am planning to do static mapping, DHCP, on a Cisco 2900.  So I have a file with static bindings and I saw that that file is 'referred' to with something like:

Router(dhcp-config)# origin file tftp://10.1.0.1/static-bindings     for example.

 

I have two questions;

[1] does the url/protocol need to be tftp? or can it be 'anything' ?  (might be easier to get it from a webserver?)

[2] it is tftp, but does the file actually get transferred to the router, once?  Or does it check if the file was updated if it can connect to where that url lives?

 

thanks,

 

Ron

 

16 Replies 16

omz
VIP Alumni
VIP Alumni

Hi 

as far as i know .. its tftp 

static binding file is read when a router reloads or the service restarts

when you edit the file you have to restart dhcp service - no dhcp service

 

Hi omz,

 

Ok I understand that it gets read when the router reloads or the service (re)starts

 

BUT  does the router keep the file local?  or does it always need to go get it with tftp on a reload and/or restart? . What if, the server is not available, in that case there would be a chicken and egg  issue.  ftp server needs an IP, router/dhcp server need that server to get the bindings.

it will look for the file every time router reloads or dhcp service restarts

if tftp server availability is unreliable .. one option is to copy the file to flash and then use flash in the origin command

 

alright,  that is what I'd prefer, even if I have to do that manually.

 

How does one get the file with static bindings to the flash on the router, and where?  I think that situation is more reliable/preferable then trying get it from the tftp server.

(Is that something that can be "automated"?  I mean if the router cannot connect to the tftp server it uses the local file, if it can connect, it takes the "tftp one" and copies it, if it is newer?

 

thanks,

 

Ron

 

you can tftp/tftp/scp the file to the router .. just like copy an image for upgrade 

https://www.cisco.com/c/en/us/support/docs/routers/2500-series-routers/15092-copyimage.html

don't think you can tell the router to choose local if tftp no available .. might be possible with some eem script

 

ok, I would prefer that file to be on the router itself.  What would be the location it needs to be, if I use scp (or tftp on the router) ?

 

Ron

 

when I try to have dhcp use a static bindings file, I get this:

Charon(config)#ip dhcp pool EVERYTHING-POOL
Charon(dhcp-config)#origin file tftp://192.168.x.y/dhcp/static-binding.txt
% This command may not be used with host, network, or relay pools.

oops..  looks like one should not use something like:

 

network 192.168.1.0 255.255.252.0

 

I assume because in this pool, the "address space" is defined in the static bindings file. So I assume that the dhcp server on the router doesn't hand out any other addresses than the ones in this static binding pool, if it's the only pool ?

 

Ron

Martin L
VIP
VIP

just curious to see content (small sample) of static-bindings text file

I am just using the same format as in the example in the Cisco docs/pdfs

https://www.cisco.com/en/US/docs/ios/12_4t/ip_addr/configuration/guide/htdhcpsv.html#wp1046301

This is literally from that pdf, like:

 

*time* Apr 18 2020 13.24 PM
*version* 1

!IP address Type Hardware address Lease expiration
10.0.0.4 /24 1 0090.bff6.081e Infinite
10.0.0.5 /28 id 00b7.0813.88f1.66 Infinite
10.0.0.2 /21 1 0090.bff6.081d Infinite

 

 

 

You can see the below link

 

https://www.cisco.com/en/US/docs/ios/12_4t/ip_addr/configuration/guide/htdhcpsv.html#wp1114315

 

For complete details

Please do not hesitate to click the STAR button if you are satisfied with my answer.

It is not recommended to use the file from the local Router as it is not reliable idea, but you can copy the file from the server to the local device. 

Please do not hesitate to click the STAR button if you are satisfied with my answer.

well,  all the hosts boot with dhcp, and I noticed the router checks for the static binding file pretty frequent.

 

That host might not always be up, it's up often but not always. So I'd rather have the static bindings file local.

Is there a specific location where it needs to be?

 

thanks,

 

Ron

flash: should be ok 

I would avoid putting in a directory 

if you type - dir or show flash: 

it should show the contents in that location 

 

Review Cisco Networking products for a $25 gift card