04-18-2020 03:04 PM
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
04-18-2020 04:03 PM
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
04-18-2020 04:21 PM
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.
04-18-2020 04:34 PM
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
04-18-2020 04:42 PM
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
04-18-2020 05:00 PM
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
04-18-2020 06:03 PM
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
04-19-2020 09:13 AM
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.
04-19-2020 09:42 AM
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
04-18-2020 06:04 PM
04-19-2020 09:01 AM
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
04-19-2020 09:50 PM
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
04-19-2020 10:24 AM
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.
04-19-2020 01:34 PM
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
04-19-2020 02:01 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide