Posted on June 20, 2016 2:43 pm
 |  Asked by Alessandro Carpi
 |  771 views
0
0
Print Friendly, PDF & Email

Hi All,

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.

Thank you!

0
Posted by Jeremy Georges
Answered on June 20, 2016 4:16 pm

Hello Alessandro,

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.

Example:

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.

 

-Jeremy

 

0
Posted by Alessandro Carpi
Answered on June 20, 2016 6:45 pm

Hi Jeremy,

Thank you, this was what I needed!

 

Post your Answer

You must be logged in to post an answer.