[Enterprise SONiC] Config load Follow
This command reads the specified JSON file and writes it to the config database for addition and replacement as running settings.
Tested model & firmware version:
- Switch model name:
AS7326-56X
- Edgecore SONiC version:
202006.4
202012.2
202111.3
Restriction:
- Running "config load" without specifying a file path will write the startup-config file (/etc/sonic/config_db.json) to the database
Config load specified file
This config example is based on 202111.3.(It might be different then other release)
Step1. Check the running settings of the VLAN interface.
admin@sonic:~$ sudo show runningconfiguration all
{
omitted...
"VLAN": {
"Vlan10": {
"vlanid": "10"
}
},
"VLAN_INTERFACE": {
"Vlan10": {},
"Vlan10|192.168.10.10/24": {}
},
"VLAN_MEMBER": {
"Vlan10|Ethernet0": {
"tagging_mode": "tagged"
},
"Vlan10|Ethernet3": {
"tagging_mode": "untagged"
}
}
}
Step2. Create a JSON file(vlan_interface.json) to modify following:
- VLAN IP interface: 192.168.10.10/24 to 192.168.20.10/24
- Ethernet0 set to untagged member
- Remove Ethernet3 from Vlan10 member
- Add Ethernet48 to Vlan10 member as tagged.
admin@sonic:~$ vi vlan_interface.json
admin@sonic:~$ vi vlan_interface.json
{
"VLAN": {
"Vlan10": {
"vlanid": "10"
}
},
"VLAN_INTERFACE": {
"Vlan10|192.168.10.10/24": null,
"Vlan10|192.168.20.10/24": {}
},
"VLAN_MEMBER": {
"Vlan10|Ethernet0": {
"tagging_mode": "untagged"
},
"Vlan10|Ethernet3": null,
"Vlan10|Ethernet48": {
"tagging_mode": "tagged"
}
}
}
Step3. Run "config load" to apply information to the running configuration.
Step 4. Check the running configuration
202006 branch:
admin@sonic:~$ show runningconfiguration all
{
omitted...
"VLAN": {
"Vlan10": {
"vlanid": "10"
}
},
"VLAN_INTERFACE": {
"Vlan10": {},
"Vlan10|192.168.20.10/24": {}
},
"VLAN_MEMBER": {
"Vlan10|Ethernet0": {
"tagging_mode": "untagged"
},
"Vlan10|Ethernet48": {
"tagging_mode": "tagged"
}
}
}
Step5. Check startup configuration, it won't be modified.
admin@sonic:~$ sudo cat /etc/sonic/config_db.json
{
omitted...
"VLAN": {
"Vlan10": {
"vlanid": "10"
}
},
"VLAN_INTERFACE": {
"Vlan10": {},
"Vlan10|192.168.10.10/24": {}
},
"VLAN_MEMBER": {
"Vlan10|Ethernet0": {
"tagging_mode": "tagged"
},
"Vlan10|Ethernet3": {
"tagging_mode": "untagged"
}
}
}
Step6. Save the running configuration to startup configuration and checking.
admin@sonic:~$ sudo config save -y
admin@sonic:~$ sudo cat /etc/sonic/config_db.json
{
omitted...
"VLAN": {
"Vlan10": {
"vlanid": "10"
}
},
"VLAN_INTERFACE": {
"Vlan10": {},
"Vlan10|192.168.20.10/24": {}
},
"VLAN_MEMBER": {
"Vlan10|Ethernet0": {
"tagging_mode": "untagged"
},
"Vlan10|Ethernet48": {
"tagging_mode": "tagged"
}
}
}
Comments
0 comments
Please sign in to leave a comment.