Cisco SG series switches pull IOS image but do not pull config template
mkultramega opened this issue · comments
Hi there, thanks for making this; it's pretty amazing!
I just started testing freeztp v1.4.1 running on a Raspberry Pi. I have a Cisco SG350 series switch as my test device.
On boot, the SG350 does not have DHCP autoconfig enabled; fine I logged in to enable it and rebooted. The switch grabs an IP and immediately pulls the IOS image and loads it, then reboots. I can see the switch re-request the IOS image and freeztp suppresses it properly, but the config template is never pulled. From what I can see via Wireshark, the switch only requests and receives the IOS image repeatedly.
I took a look at the documentation from Cisco and it looks like the switch is expecting a file name or path from the DHCP server via option 150 or others.
Here is the relevant section of the documentation:
Auto Configuration Starts
•The device uses the TFTP/SCP server name/address and configuration file name/path (DHCPv4 options: 66,150, and 67, DHCPv6 options: 59 and 60), if any, from the DHCP message received.
•If the information is not sent by the DHCP server, the Backup Server IP Address/Name and the Backup Configuration File Name (from the DHCP Auto Configuration/Image Update) is used.
•The new configuration file is used if its name is different than the name of the configuration file previously used on the device or if the device has never been configured.
•The device is rebooted with the new configuration file, at the end of the Auto Configuration/Image Update Process.
•SYSLOG messages are generated by the copy process.
Are you aware of a way to pass a config file name / path using one of the DHCP options listed here? Am I missing something silly?
Thanks for creating this; it's going to be a huge time saver once I get it working.
I have never used FreeZTP to perform deployment of a Cisco SG switch. From the documentation you posted, it seems you can add a DHCP option 67 into the DHCP lease to tell the switch the file name to download.
You can do that by doing something like:
- Setting a DHCP custom option with
ztp set dhcpd-option boot_file_name code 67 type string
- And adding that option with a setting to your DHCP scope:
ztp set dhcpd SOMESCOPENAME boot_file_name network-confg
This will set the DHCP options needed, but I have no idea what the SG switch will do with them. It might download the initial config file (named 'network-confg'), it might do nothing. FreeZTP is meant to work with Cisco Catalyst switches which pull down configs from ZTP in a predictable, but very unique and specific way. This process may not be fully compatible with how SG switches want to do it.
Try the above steps and let me know what happens. I'm interested to see how it interacts with the SG switch family.
Yea so it looks like the switch is downloading the initial config. No idea what it does with it. You may just have to modify the initial config template into a basic config to be used. I doubt you can do individualized configs for the SG switches.