Linux command: ssh/scp/ping/traceroute/apt-get/telnet


If management VRF is enabled, and you want to find the next-hop route in management VRF when running the commands traceroute/SCP/ping/apt get/SSH at Linux prompt, that is, using Eth0/1 management interface as the route interface, you have to add ip vrf exec mgmt-vrf before the commands.

The example format of these commands is shown below:

sudo ip vrf exec <mgmt-vrf|vrf-name> traceroute 10.10.51.11

sudo ip vrf exec <mgmt-vrf|vrf-name> scp admin@10.10.51.18:/home/Pica8.pm

sudo ip vrf exec <mgmt-vrf|vrf-name> ping 10.10.51.1

sudo ip vrf exec <mgmt-vrf|vrf-name> apt-get update

sudo ip vrf exec <mgmt-vrf|vrf-name> ssh <ip-address>

sudo ip vrf exec <mgmt-vrf|vrf-name> telnet {<ip-address>|<host-name>} [<port-number>]

ip vrf exec <mgmt-vrf|vrf-name> is added to specify which VRF to run the command in. If not specified, find the next hop routing information from the default VRF.

For example,

  • The following command traceroutes the gateways for the host with the IP address 10.10.50.33 in default VRF.
admin@PICOS:~$ sudo traceroute 10.10.51.33
traceroute to 10.10.51.33 (10.10.51.33), 30 hops max, 60 byte packets
 1  10.10.51.57 (10.10.51.57)  3060.699 ms !H  3060.613 ms !H  3060.588 ms !H
  • The following command checks whether the host at 10.10.51.1 is reachable in default VRF. 
admin@PICOS:~$ sudo ping 10.10.51.1
PING 10.10.51.1 (10.10.51.1) 56(84) bytes of data.
64 bytes from 10.10.51.1: icmp_seq=1 ttl=64 time=1.94 ms
64 bytes from 10.10.51.1: icmp_seq=2 ttl=64 time=2.03 ms
64 bytes from 10.10.51.1: icmp_seq=3 ttl=64 time=2.00 ms
64 bytes from 10.10.51.1: icmp_seq=4 ttl=64 time=146 ms
64 bytes from 10.10.51.1: icmp_seq=5 ttl=64 time=2.01 ms
  
 
--- 10.10.51.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4003ms
rtt min/avg/max/mdev = 1.943/30.832/146.173/57.670 ms
  • The following command checks whether the host at 10.10.51.205 is reachable in management VRF. 
admin@PICOS:~$ sudo ip vrf exec mgmt-vrf ping 10.10.51.205
PING 10.10.51.205 (10.10.51.205) 56(84) bytes of data.
64 bytes from 10.10.51.205: icmp_seq=1 ttl=255 time=0.746 ms
64 bytes from 10.10.51.205: icmp_seq=2 ttl=255 time=1.17 ms
64 bytes from 10.10.51.205: icmp_seq=3 ttl=255 time=1.72 ms
64 bytes from 10.10.51.205: icmp_seq=4 ttl=255 time=1.36 ms
^C
--- 10.10.51.205 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3044ms
rtt min/avg/max/mdev = 0.746/1.249/1.722/0.352 ms
  • The following command connects to 10.10.51.205 in management VRF using the default Telnet port (23).

admin@PICOS:~$ sudo ip vrf exec mgmt-vrf telnet 10.10.51.205
Trying 10.10.51.205...
Connected to 10.10.51.205.
Escape character is '^]'.


User Access Verification

Username: 

Copyright © 2024 Pica8 Inc. All Rights Reserved.