Backup and Restore default configuration (/etc/sonic/config_db.json) Follow
Example:
- How to backup default setting and recovery to default backup setting.
- Method 2 for reset default
- Method 3 for reset default
- Method 4 for reset default
Reference model:
- Switch model name:
- AS7726-32X
- AS7326-56X
- AS7816-64X
- AS5835-54X(T)
- AS4630-54PE
- AS9716-32D
- AS8000(Minipack)
- Wedge100BF-32X
- Edgecore SONiC version:
- Edgecore-SONiC_20201123_130028_ec202006_74
- Edgecore-SONiC_20201229_070315_ec202006_101
- Edgecore-SONiC_20201229_070315_ec202006_bfn_65(Wedge100BF-32X)
Restriction:
-
known issue: Wrong alias names in the default configuration with "AS7326-56"
admin@sonic:~$ show interfaces status
Interface Lanes Speed MTU FEC Alias Vlan Oper Admin Type Asym PFC
----------- --------------- ------- ----- ----- ------- ------ ------ ------- --------------- ----------
Ethernet0 3 25G 9100 none Eth5/3 routed down up N/A N/A
Ethernet1 2 25G 9100 none Eth5/2 routed down up N/A N/A
Ethernet2 4 25G 9100 none Eth5/4 routed down up N/A N/A
Ethernet3 8 25G 9100 none Eth6/4 routed down up N/A N/A
Ethernet4 7 25G 9100 none Eth6/3 routed down up N/A N/A
...
omitted
...
Procedure :
Example 1. How to backup default setting and recovery to default backup setting.
Step1: Backup default configuration "config_db.json" after SONiC installation.
Step 2. If we want to reset the setting to default, replace current config_db.json by backup config.
Step 3. config reload or power cycle the switch
Example 2: Method 2 for reset default
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
Example 3: Method 3 for 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.
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
Example 4: Method 4 for reset default
If ZTP function is disable 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:~$
Comments
0 comments
Please sign in to leave a comment.