The following article describes the functionality of routing context mode and how to use the functionality to export the logs and files from the device to the Desktop machine or to the backup/storage server.
In most of the networking infrastructure, the networking devices are being administered or accessed in non-default vrf (Management VRF). The non-default will have access to the Network orchestration tools, Backup servers, Desktop machines depending upon the network infrastructure policy.
Network Administrators / Orchestrators will use the Management vrf plane to communicate with the Networking devices.
The routing-context mode in EOS CLI makes it easier for network operators/administrator to push the logs to backup servers.
III. Steps to Identify the Management VRF and backup the logs
A. Identify the VRF:
The EOS CLI by default enters into the default vrf of the switch. The default vrf may not have the reachability to the intended backup server. The first step in the process is to identify if the default vrf has reachability to the backup server.
In the following example, let us use TFTP as a mechanism to upload logs into the backup server. The same methodology is applicable for SCP, FTP or other supported file transfer mechanism.
TFTP server IP: 172.28.160.40
Content to backup: startup-config in the flash
switch#ping 172.28.160.40 connect: Network is unreachable
switch#show ip route vrf default VRF: default //truncated Gateway of last resort is not reachable C 18.104.22.168/30 is directly connected, Vlan4094
File Transfer check:
Initiate file transfer and check if the file transfer progressing.
In our example, as there is no reachability to a backup server in the default vrf, the backup failed.
switch#copy flash:startup-config tftp://172.28.160.40/backup % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 2777 0 0 0 0 0 0 --:--:-- 0:05:00 --:--:-- 0 curl: (7) getpeername() failed with errno 107: Transport endpoint is not connected % Error copying system:/running-config to tftp://172.28.160.40/backup ()
At this stage, we have identified that the switch doesn’t have reachability to the TFTP backup servers in the default vrf. Check if the switch was provisioned with a non-default vrf.
switch#show vrf Vrf RD Protocols State Interfaces ---------- --------- --------------- ---------------- ----------- MGMT 1:1 ipv4 no routing Management1
If there are multiple VRF’s, Please use Ping check or check in the network design document to know which VRF has reachability to the backup servers.
In our example, the switch has reachability to the TFTP backup server in the management vrf.
switch#show ip route vrf MGMT //truncated Gateway of last resort: S 0.0.0.0/0 [1/0] via 172.28.160.1, Management1 C 172.28.160.0/22 is directly connected, Management1
By the completion of the above task, we have identified which vrf has connectivity to the TFTP backup server.
B. Switch Routing Context and backup logs
Switch to the respective routing context with the help of the following EOS CLI command
switch#routing-context vrf MGMT
Use the following command to copy the startup-config to the backup server
switch(vrf:MGMT)#copy flash:startup-config tftp://172.28.160.40/backup % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2777 0 0 100 2777 0 881k --:--:-- --:--:-- --:--:-- 881k Copy completed successfully.
In the above steps, we have demonstrated how to use routing-context to switch between the VRF’s and upload the logs to the backup server. Please feel free to use the above methodology at your ease with respect to your networking environment.
Feel free to contact firstname.lastname@example.org for further concerns.