Can I upgrade code using ZTP/dhcp code 43?

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
  • (Edited)

Can I upgrade code using dhcp code 43/ ztp? I have attempted this several times, I can get the switch to pull a config, or xsf, but it only pulls one file.

I have found a TAC paper :

https://gtacknowledge.extremenetworks.com/articles/How_To/How-to-specify-multiple-file-names-separat...

but this reads like Chineseium stereo instructions, it states that it will take several files including xos files, but my switches never ask for that file from the tftp server.( not using netsight) ( in fact the switches never ask for more than one file)  

so the question is (yes or no / please no "here is a link to something you didn't ask")

If I get the option correctly formatted, will the switch download and install firmware from a tftp server?

If yes, does someone have an example of what files and server/ and what the option looks like.


Thanks for reading

DR


Photo of David Rahn

David Rahn

  • 824 Points 500 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Dave Hammers

Dave Hammers, Dir SW Engineering

  • 3,502 Points 3k badge 2x thumb
I've had mixed results with option43 using the same sub option for multiple files. Some DHCP servers will only provide the last sub option in the message to the switch.

The work around is to download a .xsf (cli script) file which has the CLI commands in it to do what you want.
E.g. somefile.xsf
  • download image 10.10.10.1 ...xos
  • tftp 10.10.10.1 -g ...cfg
  • etc.
Photo of Brandon Clay

Brandon Clay, Escalation Support Engineer

  • 13,086 Points 10k badge 2x thumb
As an addition to Dave's comment, we actually have a Python script (linked below) that will run on an EXOS switch (EXOS > 15.6) to configure DHCP option 43 in the EXOS DHCP server.

https://github.com/extremenetworks/ExtremeScripting/tree/master/EXOS/Python/dhcp43

While I would not suggest using EXOS as a DHCP server in a production network, I've used this for staging switches with configs and EXOS images a few times and it works well.

EXOS also does not seem to have any issues with sending the same sub-option multiple times, so it may be a good option for a lab/staging setup.
Photo of David Rahn

David Rahn

  • 824 Points 500 badge 2x thumb

I did try this script, and infact that is what I am using for the server. but I was not able to get the switch to pull multiple files. 

does it actually add the TLV format for every file? ( I assume it does just didn't whip out the hex converter)

Photo of Brandon Clay

Brandon Clay, Escalation Support Engineer

  • 13,086 Points 10k badge 2x thumb
It does create the TLV format for every file. For example, if you give it an IP and two files it will generate option 43 with sub-options 100 and two instances of 101 (all in TLV format).

Assuming you were testing this with the switches on 15.3, I would expect it to only pull one file, as the original auto-provision (that must be manually enabled) only provided for downloading a config to the switch (either a .cfg or a .xsf).
Photo of David Rahn

David Rahn

  • 824 Points 500 badge 2x thumb

OK, now we are getting somewhere, sounds like you know something about this.

does 15.3 support that just being an XOS image? all I want is for the switch to get the option and download a new 22 load, then reboot.

if I have to hit is and type enable auto-p then reboot it would be great.


Photo of Brandon Clay

Brandon Clay, Escalation Support Engineer

  • 13,086 Points 10k badge 2x thumb
Unfortunately, 15.3 (actually, EXOS up until 15.7) will only take a config (either .cfg or .xsf).

You may be able to work around this by exploiting the .xsf file option, though. When given a .xsf file, the switch will execute the .xsf, save config, and then reboot. You might be able to use the .xsf to tell the switch to download the EXOS image (by using the 'download image' command inside the script). So basically, your .xsf file that you point to would be:
download image <ip> <filename>
<any other config you need>

I haven't tested this personally, though, so it may not work the way I'm anticipating. Based on what I can find on 15.3 auto-provision though, it seems like it should work.
Photo of David Rahn

David Rahn

  • 824 Points 500 badge 2x thumb

Thank you for your response,

if I download an xsf, does it execute the commands immediately?

would I need to set up DHCP at that point? or is the ZTP dhcp still in effect?


Photo of Dave Hammers

Dave Hammers, Dir SW Engineering

  • 3,502 Points 3k badge 2x thumb
If an xsf is downloaded as a result of DHCP option43, ztp will execute the .xsf script immediately.
You still need to configure DHCP option43 with the .xsf filename

Downloading a script outside of the ztp process does not execute the script.
Photo of David Rahn

David Rahn

  • 824 Points 500 badge 2x thumb

I am experimenting with this, and I see that.

thank you.

unfortunately it looks like 15.3 has auto provisioning turned off out of the box... :-/

so now I have to log in and enable that and reboot


Photo of Dave Hammers

Dave Hammers, Dir SW Engineering

  • 3,502 Points 3k badge 2x thumb
Sorry, I was assuming 15.7 or later where EXOS enables DHCP and starts ZTP.
Prior to that, the feature was called Auto Provisioning and requires a command to start it.
Photo of David Rahn

David Rahn

  • 824 Points 500 badge 2x thumb

oh, no it is ok, I am attempting to upgrade 150 switches new out of box, but it looks like they all shipped at 15.3...

I was just attempting to make it simpler for untrained techs to take care of for me

to get the first load on to the switch.