Is is possible to, during the execution of the ZTP script that is downloaded as a function of the DHCP options, to retrieve the IP address of the server from when the ZTP script came from? For example, if the DHCP options indicate that the bootfile option is: “http://192.168.10.1:8080/downloads/ztp-eos.sh”, I would like the ztp-eos.sh script to dynamically obtain the fact that it came from “192.168.10.1:8080”.
I tried dumping the environment variables from within ztp-eos.sh, but did not find anything useful. I am wondering if there are any logfiles, or other “show” commands that I could use to obtain this information.
The net-net is I do not want to hardcode IP addresses in my ztp-eos.sh script if at all possible.
You can use the Linux approach and grep the /var/log/messages file. When it attempts to pull the file specified by option 67, it lists this in the messages file.
Jun 20 16:12:06 localhost ZeroTouch: %ZTP-5-CONFIG_DOWNLOAD: Attempting to download the startup-config from http://10.255.255.250:8000/ztp.py
Hope that helps.
Thank you, this was what I needed!
Post your Answer
You must be logged in to post an answer.