注意事项:config_db.json文件导出后需要重命名为hotsname_config_db.json,hotsname根据设备的实际名称确定。
本文使用xshell举例
1.采集备份设备信息
通过终端软件设置日志文件目录采集备份设备版本补丁信息,配置文件,设备状态信息:BGP、路由、ARP,确认无误后,保存配置。
2.导出设备Config_db文件
1、导出Config_db文件前,write memory保存配置,更新Config_db内容。
2、进入debugshell视图,通过sudo su提升至root权限,cd /etc/sonic进入配置文件夹,通过ls -l预览文件内容,如下:
3、通过sz config_db.json导出config_db.json文件到本地。
3.导入设备Config_db文件
1、修改导出后文件命名为设备系统名称,防止新导入设备后与设备已有config_db.json文件命名冲突。
2、将导出的config_db.json(已经修改设备系统名称后的config_db.json文件)文件导入其他的新设备对应的文件夹目录,在/etc/sonic文件夹目录下通过拖拽的方式即可。
3、在/etc/sonic文件夹目录下通过mv命令重命名导入的config_db.json文件覆盖原始文件。
4、覆盖原始config_db文件后,ls -l能看到只有一个config_db文件,此时在该视图通过sudo reboot重启设备,可通过新导入的config_db配置文件带配置重启。
5、设备启动完成后,show running-configuration查看设备配置信息与老设备配置进行compare比较一致性,并通过write memory 保存配置,收集设备业务及状态信息,涉及命令如下:
terminal length 0
show version
show platform firmware status
show patch list
show system cpu
show system health detail
show interface transceiver dom summary
show interface status
show interface counters
show interface link-state-change
show PortChannel summary
show ip interfaces
show ipv6 interfaces
show mac address-table
show mac address-table count
show ip arp
show ip arp summary
show mclag brief
show mad status
show monitor-link
show bgp summary
show ip route
show ipv6 route
show ip route summary
show ipv6 route summary
show interface Vlan 300
show interface Vlan 301
show interface Vlan 302
show interface Vlan 303
show interface Vlan 309
show interface Vlan 4089
show running-configuration
show logging count
show logging filter level ERR