[Enterprise SONiC] Reset default configuration Follow
Since 202012.3 and Above
202006, 202012.2 and Previous release
- Generate the default configure through the Platform and the HwSKU information
- Use the script "restore_202006.sh" to reset default
- Use ZTP to generate the default configure automatically
Restore Edgecore factory default configuration since 202012.3 and above
Since 202012.3, Edgecore enhance Edgecore Default configuration file that's different than Community(Open Source) SONiC's T1/T2 configuration.
There are a few difference in the default configuration file: (the difference does not impact SONiC functions.
- Removed Parts:
- DEVICE_METADATA["localhost"]["bgp_asn"]
- LOOPBACK_INTERFACE
- BGP_NEIGHBOR
- DEVICE_NEIGHBOR
- INTERFACE - Ports are not assigned any IP by default.
- New added Parts:
- REST_SERVER["default"]["client_auth"] = "user" - With this setting, users need to provide username/password to access the REST Server.
- docker_routing_config_mode = "split" - With this setting, FRR uses split mode.
- frr_mgmt_framework_config = "true" - With this setting, OSPF/ISIS features are enabled.
Step 1. Remove /etc/sonic/config_db.json.
Remove:
admin@sonic:~$ sudo rm /etc/sonic/config_db.json
Step 2. Generate Edgecore factory default configuration by this command
admin@sonic:~$ sudo config-setup factory
Edgecore Default configuration file is restored on /etc/sonic/config_db.json now.
Step 3. Reboot device
admin@sonic:~$ sudo reboot
Generate the default configure through the Platform and the HwSKU information
Step 1: Check the $Platform and $HwSKU information
Step 2: Set the $Platform and $HwSKU information to environment variable.
Step 3: Generate the default setting same as initial installed.
Step 4: Replace the "default.json" to the correct position.
Step 5. Config reload or power cycle the switch
Use the script "restore_202006.sh" to reset default
Upload and Execute the script restore_202006.sh on the SONiC
The script generates default configuration config_db.json automatically. Reboot the switch or reload configuration to take effect.(The script is applicable to 202006 branch and 202012 branch)
Step 1: Set the management IP
Step 2: Upload the Script to the SONiC
Step 3: Change permission of script.
Step 4: Running the script.
Step 5. config reload or power cycle the switch
Use ZTP to generate the default configure automatically
When you disable ZTP function and there is no config_db.json on /etc/sonic, the ZTP function will generate a default config_db.json file automatically.
Step 1: Remove or rename the /etc/sonic/config_db.json file.
Step 2: Check the current ZTP.
admin@sonic:~$ show ztp
ZTP Admin Mode : False
ZTP Service : Inactive
ZTP Status : Not Started
ZTP Service is not running
Step 3: enable ZTP function and then reboot.
Step 4: Check the current SONiC's config folder.
admin@sonic:~$ sudo ls /etc/sonic/ | grep config_db.json
config_db.json.modified
Step 5: Disable ZTP function, and then check the SONiC's config folder.
admin@sonic:~$ sudo config ztp disable
Active ZTP session will be stopped and disabled, continue? [y/N]: y
admin@sonic:~$ sudo ls /etc/sonic/ | grep config_db.json
config_db.json
config_db.json.modified
admin@sonic:~$
Related article
Comments
0 comments
Please sign in to leave a comment.