
Cisco’s ASR1000 series of routers come in many form factors that all provide a number of different features, and options in terms of scalability. One thing common to all of the devices in this product line is that their IOS XE software that performs all of the standard routing operations for the platform is running on top of a Linux kernel. This post describes how to enter a linux shell on your router and run some basic linux commands to really get an idea of what your router has going on under the hood so to speak.
Do so at your own risk, as Cisco’s advises to only use this under their supervision of Cisco Support. This post is limited to viewing different things to get an idea of what is underlying on the system. It’s best to err on the side of caution and NOT do this on a production router, and be expecially careful to not edit/delete anything that’s vital as a mistake at this level of the router can cause major issues with any or all functions of the device.
With that being said, let’s dig in. For this demonstration I opened a shell into the RP, or the route processor of the router. The ASR1000 series routers consists of a chassis/slots/cards, which make up the physical ports on the router, the embedded service processor, the SIP(SPA Interface Processor), and the RP(Route Processor)
To open up a shell into the system you use the following command, the ? mark gives you the options to open a shell into the SIP, ESP, or RP
Router1#request platform software system shell ? 0 SPA-Inter-Processor slot 0 F0 Embedded-Service-Processor slot 0 FP Embedded-Service-Processor R0 Route-Processor slot 0 RP Route-Processor <cr>
For our purposes I opened a shell into the RP that was in the Active state, in case your router has more than one RP installed.
Router1#request platform software system shell rp active
Upon entering this command you are immediately met with a confirmation to continue along with the warning below:
Activity within this shell can jeopardize the functioning of the system. Are you sure you want to continue? [y/n] y es2014/05/11 21:33:31 : Shell access was granted to user <anon>; Trace file: , /harddisk/tracelogs/system_shell_R0.log.20140511213331 ********************************************************************** Activity within this shell can jeopardize the functioning of the system. Use this functionality only under supervision of Cisco Support.
Session will be logged to: harddisk:tracelogs/system_shell_R0.log.20140511213331 **********************************************************************
You are now dropped into the shell for the RP, and into the prompt below:
[Router1_RP_0:/]$
Now it’s time to run some commands to familiarize yourself with whats running underneath your router.
The first thing we’ll run will be the linux command ‘uname’ to find out what we’re running on:
[Router1_RP_0:/]$ uname -a Linux Router1_RP_0 2.6.27.45 #1 Fri Mar 25 01:08:36 PDT 2011 ppc ppc ppc GNU/Linux
Next are a couple of commands to show us where we are in the system, and what commands we have available to us from the shell of the RP:
[Router1_RP_0:/]$ pwd / [Router1_RP_0:/]$ ls -l total 72 drwxr-xr-x 2 root root 0 Jan 16 13:53 auto drwxr-xr-x 2 904735 25 0 Jan 16 13:53 bin drwxr-xr-x 8 root root 4096 May 11 21:31 bootflash -rwxr-xr-x 1 904735 25 53772 Dec 31 1969 common lrwxrwxrwx 1 root root 10 Jan 16 13:53 config -> /bootflash drwxrwxrwt 6 root root 15560 Jan 16 13:55 dev lrwxrwxrwx 1 root root 10 Jan 16 13:53 disk0 -> /vol/disk0 drwxr-xr-x 15 904735 25 0 Jan 16 13:54 etc lrwxrwxrwx 1 root root 13 Jan 16 13:53 harddisk -> /misc/scratch lrwxrwxrwx 1 root root 33 Jan 16 13:53 issu -> /tmp/sw/rp/0/0/rp_base/mount/issu drwxr-xr-x 3 904735 25 0 Jan 16 13:53 lib -rwxr-xr-x 1 904735 25 5000 Dec 31 1969 lkern_init drwxr-xr-x 2 root root 0 Jan 16 13:53 misc drwxr-xr-x 3 root root 0 Jan 16 13:53 mnt drwxr-xr-x 3 root root 0 Dec 31 1969 obfl dr-xr-xr-x 146 root root 0 Dec 31 1969 proc -rwxr-xr-x 1 904735 25 1090 Dec 31 1969 rommon_to_env drwx------ 2 root root 0 Dec 31 1969 root drwxr-xr-x 2 904735 25 0 Jan 16 13:53 sbin drwxr-xr-x 11 root root 0 Dec 31 1969 sys drwxr-xr-x 2 root root 0 Jan 16 13:54 tftp drwxrwxrwt 17 root root 560 May 11 21:33 tmp lrwxrwxrwx 1 root root 10 Jan 16 13:53 usb0 -> /misc/usb0 lrwxrwxrwx 1 root root 10 Jan 16 13:53 usb1 -> /misc/usb1 drwxr-xr-x 7 904735 25 0 Jan 16 13:53 usr drwxr-xr-x 10 root root 0 Jan 16 13:54 var drwxr-xr-x 7 root root 0 Jan 16 13:54 vol
[Router1_RP_0:/]$ ls /bin arch chown dd echo gdbserver ipcalc lsmod mktemp od readlink sha1sum stty test tsort usleep basename chroot df egrep get_me_bash kill mcp_pkg_wrap mount ping rm sleep sync touch tty vi bash comm dirname env grep ln md5sum mv ping6 rmdir sort tail tr umount wc cat cp dmesg expr head login mkdir netstat printenv sed split tar tracepath uname who chgrp cut doexec false hostname logname mkfifo nice ps seq start-stop-daemon tcsh traceroute uniq whoami chmod date du fgrep id ls mknod nohup pwd sh stat tee true uptime yes
[Router1_RP_0:/]$ ls /sbin agetty chvrf e2image fsck.msdos hdparm initlog iptables lspci mkfs.msdos pidof rmmod shutdown telinit arp consoletype e2label fsck.vfat hwclock insmod iptables-restore mkdosfs mkfs.vfat pivot_root route start_udev tune2fs badblocks ctrlaltdel fdisk fuser ifconfig ip iptables-save mke2fs mkswap portmap runlevel sulogin udevcontrol blkid depmod fsck genhostid ifdown ip6tables killall5 mkfs modinfo poweroff service swapon udevd blockdev dosfsck fsck.ext2 getkey ifup ip6tables-restore klogd mkfs.ext2 modprobe reboot setsysfont sysctl udevsettle cfdisk dumpe2fs fsck.ext3 halt init ip6tables-save lsof mkfs.ext3 nameif resize2fs sfdisk syslogd udevtrigger
Next, we’ll run the ‘set’ command to view some of the environment variables that are configured.
[Router1_RP_0:/]$ set BASH=/bin/bash BASH_ARGC=() BASH_ARGV=() BASH_LINENO=() BASH_SOURCE=() BASH_VERSINFO=([0]="3" [1]="2" [2]="51" [3]="1" [4]="release" [5]="powerpc-unknown-linux-gnu") BASH_VERSION='3.2.51(1)-release' BINOS_ACCESS_RUN_MODE=0 BINOS_BASE_DIR=/tmp/rp BINOS_BAY_LOCAL=0 BINOS_BIN_DIR=/usr/binos/bin/rp BINOS_BTRACE_FILE_PATH=/tmp/rp/trace BINOS_BTRACE_LEVEL=err BINOS_CHASFS_ROOT=/tmp/rp/chasfs BINOS_CHASSIS_XML=/usr/binos/conf/chassis.xml BINOS_CMRP_IMAGE_ROOT=/tftp BINOS_CMRP_TFTP_PORT=69 BINOS_CONF_DIR=/usr/binos/conf BINOS_DUAL_IOS_CAPABLE=1 BINOS_DUAL_IOS_REQUESTED=0 BINOS_FRU_BASE_PKG=rp_base BINOS_FRU_LOCAL=BINOS_FRU_RP BINOS_LIPC_PATH=/tmp/rp/lipc BINOS_NVRAM_DIR=/config BINOS_RAMFS_DIR=/tmp BINOS_SLOT_LOCAL=0 BINOS_TDLDB_PATH=/tmp/rp/tdldb BINOS_USER_NAME= BINOS_USER_TMPDIR=/tmp/tmppub BINOS_USER_TTY='vty 0' BINOS_USER_UI_CLIENT=ios BRELAY_SH_BTRACE_LEVEL=NOTICE COLUMNS=168 CPP_BIN_DIR=/usr/cpp/bin/rp CPP_CONF_DIR=/usr/cpp/conf CPP_STARTUP_FILE=/tmp/rp/cpp_startup_complete CPP_STARTUP_WAIT=120 DIRSTACK=() EUID=0 GROUPS=() HISTFILE=/root/.bash_history HISTFILESIZE=500 HISTSIZE=500 HOSTNAME=Router1_RP_0 HOSTTYPE=powerpc IFS=
Below is the output of the ‘ps -elf’ command to view all of the system processes:
[Router1_RP_0:/]$ ps -elf F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD 4 S root 1 0 0 80 0 - 539 select Jan16 ? 00:00:18 init [3] 5 S root 2 0 0 75 -5 - 0 kthrea Jan16 ? 00:00:00 [kthreadd] 1 S root 3 2 0 75 -5 - 0 ksofti Jan16 ? 00:00:32 [ksoftirqd/0] 5 S root 4 2 0 -40 - - 0 watchd Jan16 ? 00:00:00 [watchdog/0] 5 S root 5 2 0 75 -5 - 0 worker Jan16 ? 00:00:04 [events/0] 1 S root 6 2 0 75 -5 - 0 worker Jan16 ? 00:00:00 [khelper] 1 S root 9 2 0 75 -5 - 0 worker Jan16 ? 00:00:00 [netns] 1 S root 61 2 0 75 -5 - 0 worker Jan16 ? 00:00:00 [kblockd/0] 1 S root 69 2 0 75 -5 - 0 worker Jan16 ? 00:00:00 [ata/0] 1 S root 70 2 0 75 -5 - 0 worker Jan16 ? 00:00:00 [ata_aux] 1 S root 76 2 0 75 -5 - 0 hub_th Jan16 ? 00:00:00 [khubd] 1 S root 79 2 0 75 -5 - 0 serio_ Jan16 ? 00:00:00 [kseriod] 1 S root 124 2 0 80 0 - 0 pdflus Jan16 ? 00:00:01 [pdflush] 1 S root 125 2 0 80 0 - 0 pdflus Jan16 ? 00:00:01 [pdflush] 1 S root 126 2 0 75 -5 - 0 kswapd Jan16 ? 00:00:00 [kswapd0] 1 S root 178 2 0 75 -5 - 0 worker Jan16 ? 00:00:00 [aio/0] 0 S root 1010 14198 0 80 0 - 799 hrtime 15:04 ? 00:00:00 sleep 1d 1 S root 1011 2 0 75 -5 - 0 mtd_bl Jan16 ? 00:00:00 [mtdblockd] 1 S root 1077 2 0 75 -5 - 0 scsi_e Jan16 ? 00:00:00 [scsi_eh_0] 1 S root 1078 2 0 75 -5 - 0 usb_st Jan16 ? 00:00:28 [usb-storage] 1 S root 1095 2 0 75 -5 - 0 worker Jan16 ? 00:00:09 [mcp-rtc-wq] 5 S root 2179 2 0 75 -5 - 0 worker Jan16 ? 00:00:00 [rpciod/0] 1 S root 2184 2 0 75 -5 - 0 worker Jan16 ? 00:00:00 [nfsiod] 1 S root 2224 2 0 60 -20 - 0 loop_t Jan16 ? 00:00:01 [loop0] 5 S bin 2322 1 0 80 0 - 561 sys_po Jan16 ? 00:00:00 portmap 1 S root 2376 2 0 60 -20 - 0 loop_t Jan16 ? 00:00:00 [loop1] 1 S root 2413 2 0 60 -20 - 0 loop_t Jan16 ? 00:00:00 [loop2] 1 S root 2450 2 0 60 -20 - 0 loop_t Jan16 ? 00:00:00 [loop3] 1 S root 2487 2 0 60 -20 - 0 loop_t Jan16 ? 00:00:00 [loop4] 1 S root 2596 2 0 60 -20 - 0 loop_t Jan16 ? 00:00:00 [loop5] 1 S root 2633 2 0 60 -20 - 0 loop_t Jan16 ? 00:00:00 [loop6] 1 S root 2706 2 0 60 -20 - 0 loop_t Jan16 ? 00:00:00 [loop7] 0 S root 3318 26082 0 80 0 - 799 hrtime 21:31 ? 00:00:00 sleep 300 4 S root 3833 31486 0 80 0 - 988 wait 21:33 ? 00:00:00 /bin/bash /usr/binos/conf/in.telnetd.sh -L /usr/binos/conf/brelay.sh 4 S root 3919 3833 0 80 0 - 2251 select 21:33 ? 00:00:00 in.telnetd: 192.168.1.2 0 S root 3920 3919 0 80 0 - 988 wait 21:33 ttyp0 00:00:00 /bin/bash /usr/binos/conf/brelay.sh -h 192.168.1.2 -p 4 S binos 4006 3920 0 80 0 - 929 wait 21:33 ttyp0 00:00:00 /bin/sh /usr/binos/conf/bexec.sh -c /usr/binos/conf/mcp_record_shell.sh -e BINOS_USER_NAME=? 0 S binos 4009 4006 0 80 0 - 922 wait 21:33 ttyp0 00:00:00 /bin/sh /usr/binos/conf/mcp_chvrf.sh eobc /usr/binos/conf/bexecute.sh -c /usr/binos/conf/mcp_ 4 S root 4010 4009 0 80 0 - 1005 wait 21:33 ttyp0 00:00:00 /bin/sh /usr/binos/conf/mcp_record_shell.sh 4 S root 4061 4010 0 80 0 - 517 read_c 21:33 ttyp0 00:00:00 /usr/bin/script -q /harddisk/tracelogs/system_shell_R0.log.20140511213331 1 R root 4062 4061 0 80 0 - 518 - 21:33 ttyp0 00:00:00 /usr/bin/script -q /harddisk/tracelogs/system_shell_R0.log.20140511213331 0 S root 4063 4062 0 80 0 - 808 wait 21:33 ttyp1 00:00:00 bash -i 0 S root 4491 31494 0 80 0 - 799 hrtime 21:33 ? 00:00:00 sleep 60 0 S root 4677 31735 0 80 0 - 799 hrtime 21:34 ? 00:00:00 sleep 100 0 S root 5164 27864 0 80 0 - 799 hrtime 21:34 ? 00:00:00 sleep 45 4 R root 5165 4063 0 80 0 - 727 - 21:34 ttyp1 00:00:00 ps -elf 5 S root 12757 1 0 76 -4 - 534 select Jan16 ? 00:00:00 /sbin/udevd -d 1 S root 13890 2 0 90 10 - 0 jffs2_ Jan16 ? 00:00:00 [jffs2_gcd_mtd1] 0 S root 14198 1 0 80 0 - 790 wait Jan16 ? 00:00:00 /bin/bash /etc/auxport.sh 4 S root 14219 1 0 80 0 - 1109 pipe_w Jan16 ? 00:09:54 /bin/bash /usr/binos/conf/reflector.sh 4 S root 14225 1 0 80 0 - 1112 pipe_w Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/droputil.sh 5 S root 14320 1 0 80 0 - 6649 rt_sig Jan16 ? 00:00:00 automount 5 S root 14352 1 0 80 0 - 871 select Jan16 ? 00:00:00 xinetd -stayalive -pidfile /var/run/xinetd.pid -f /etc/xinetd.conf 5 S root 14354 1 0 80 0 - 871 select Jan16 ? 00:00:00 xinetd -stayalive -pidfile /var/run/xinetd_telnetd.pid -f /etc/xinetd_telnetd.conf 1 S root 14373 2 0 75 -5 - 0 svc_re Jan16 ? 00:00:00 [lockd] 1 S root 14375 2 0 75 -5 - 0 svc_re Jan16 ? 00:00:00 [nfsd] 1 S root 14376 2 0 75 -5 - 0 svc_re Jan16 ? 00:00:00 [nfsd] 1 S root 14377 2 0 75 -5 - 0 svc_re Jan16 ? 00:00:00 [nfsd] 1 S root 14378 2 0 75 -5 - 0 svc_re Jan16 ? 00:00:00 [nfsd] 1 S root 14379 2 0 75 -5 - 0 svc_re Jan16 ? 00:00:00 [nfsd] 1 S root 14380 2 0 75 -5 - 0 svc_re Jan16 ? 00:00:00 [nfsd] 1 S root 14381 2 0 75 -5 - 0 svc_re Jan16 ? 00:00:00 [nfsd] 1 S root 14382 2 0 75 -5 - 0 svc_re Jan16 ? 00:00:00 [nfsd] 1 S root 14385 1 0 80 0 - 577 select Jan16 ? 00:00:00 rpc.mountd 1 R root 14471 2 0 75 -5 - 0 - Jan16 ? 00:00:45 [lsmpi-refill] 1 S root 14472 2 0 75 -5 - 0 lsmpi_ Jan16 ? 00:07:34 [lsmpi-xmit] 1 R root 14473 2 0 75 -5 - 0 - Jan16 ? 00:08:41 [lsmpi-rx] 0 S root 15437 1 0 80 0 - 2080 pipe_w Jan16 ? 00:00:14 /usr/bin/rotee -f reflector_14219 -p /tmp/rp/trace/fifo/reflector_sh%rp_0_0_14219_fifo 0 S root 15444 1 0 80 0 - 2080 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f droputil_14225 -p /tmp/rp/trace/fifo/droputil_sh%rp_0_0_14225_fifo 0 S root 15491 14225 0 80 0 - 517 select Jan16 ? 00:00:00 inotifywait -r -m --format %w,%-e,%f -e close_write -e move -e create -e delete /tmp/rp/chasf 0 S root 15500 14219 0 80 0 - 517 select Jan16 ? 00:00:00 inotifywait -r -m --format %w,%-e,%f -e close_write -e move -e create -e delete /tmp/rp/chasf 5 S root 21324 1 0 80 0 - 474 syslog Jan16 ? 00:00:00 /sbin/klogd -2 4 S root 21335 1 0 80 0 - 1089 pipe_w Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/pvp.sh 0 S root 21382 1 0 80 0 - 2080 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f pvp -p /tmp/rp/trace/fifo/pvp_sh%rp_0_0_21335_fifo 0 S root 21500 21335 0 80 0 - 517 select Jan16 ? 00:00:00 inotifywait -m --format %w,%-e,%f -e DELETE -e CREATE /tmp/rp/pvp/control /tmp/rp/pvp/process 4 S root 21568 21335 0 74 -6 - 1074 wait Jan16 ? 00:00:00 /bin/bash /tmp/sw/rp/0/0/rp_base/mount/usr/binos/conf/pman.sh 0 S root 21652 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/btrace_rotate_sh_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0 4 S root 21717 21335 0 74 -6 - 1070 wait Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/pman.sh 0 S root 21872 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/cmand_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0_21717_fifo 4 S root 21976 21335 0 74 -6 - 1070 wait Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/pman.sh 0 S root 22164 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/emd_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0_21976_fifo 4 S root 22323 21335 0 74 -6 - 1071 wait Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/pman.sh 4 R root 22403 21568 0 80 0 - 1238 - Jan16 ? 03:21:28 /bin/bash /tmp/sw/mount/asr1000rp1-rpbase.03.03.00.S.151-2.S.pkg/usr/binos/conf/btrace_rotate 0 S root 22564 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/fman_rp_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0_22323_fi 0 S root 22672 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f btrace_rotate_sh -p /tmp/rp/trace/fifo/btrace_rotate_sh%rp_0_0_22403_fifo 4 S root 22748 21717 0 80 0 - 6798 select Jan16 ? 18:04:24 /tmp/sw/mount/asr1000rp1-rpcontrol.03.03.00.S.151-2.S.pkg/usr/binos/bin/cmand 4 S root 22857 21335 0 74 -6 - 1070 wait Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/pman.sh 4 S root 23109 21976 0 80 0 - 4873 select Jan16 ? 01:05:50 /tmp/sw/mount/asr1000rp1-rpcontrol.03.03.00.S.151-2.S.pkg/usr/binos/bin/emd 0 S root 23149 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/hman_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0_22857_fifo 4 S root 23307 21335 0 74 -6 - 1070 wait Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/pman.sh 4 S root 23565 22323 0 80 0 - 27502 select Jan16 ? 01:39:18 /tmp/sw/mount/asr1000rp1-rpcontrol.03.03.00.S.151-2.S.pkg/usr/binos/bin/fman_rp -N 0 S root 23598 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/imand_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0_23307_fifo 4 S root 24127 21335 0 74 -6 - 1071 wait Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/pman.sh 4 S root 24282 22857 0 80 0 - 4034 select Jan16 ? 03:25:02 /tmp/sw/mount/asr1000rp1-rpcontrol.03.03.00.S.151-2.S.pkg/usr/binos/bin/hman -c 0 S root 24387 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/linux_iosd_image_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0 4 S root 24682 23307 0 80 0 - 6579 select Jan16 ? 23:10:13 /tmp/sw/mount/asr1000rp1-rpcontrol.03.03.00.S.151-2.S.pkg/usr/binos/bin/imand 4 S root 24811 21335 0 74 -6 - 1075 wait Jan16 ? 00:00:00 /bin/bash /tmp/sw/rp/0/0/rp_base/mount/usr/binos/conf/pman.sh 0 S root 25027 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/periodic_sh_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0_2481 4 S root 25190 21335 0 74 -6 - 1071 wait Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/pman.sh 4 R root 25404 24127 1 80 0 - 489173 - Jan16 ? 1-14:12:36 /tmp/sw/mount/asr1000rp1-rpios-advipservicesk9.03.03.00.S.151-2.S.pkg/usr/binos/bin/linux_i 0 S root 25452 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/plogd_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0_25190_fifo 4 S root 25576 21335 0 74 -6 - 1071 wait Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/pman.sh 0 S root 25837 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/psd_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0_25576_fifo 4 S root 26082 24811 0 80 0 - 1221 wait Jan16 ? 00:02:51 /bin/bash /tmp/sw/mount/asr1000rp1-rpbase.03.03.00.S.151-2.S.pkg/usr/binos/conf/periodic.sh 4 S root 26251 21335 0 74 -6 - 1072 wait Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/pman.sh 0 S root 26348 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f periodic -p /tmp/rp/trace/fifo/periodic_sh%rp_0_0_26082_fifo 0 S root 26502 25190 0 80 0 - 3986 select Jan16 ? 00:01:25 /tmp/sw/mount/asr1000rp1-rpcontrol.03.03.00.S.151-2.S.pkg/usr/binos/bin/plogd 0 S root 26522 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/smand_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0_26251_fifo 4 S root 26693 21335 0 74 -6 - 1075 wait Jan16 ? 00:00:00 /bin/bash /tmp/sw/rp/0/0/rp_base/mount/usr/binos/conf/pman.sh 4 S root 26910 25576 0 80 0 - 4923 select Jan16 ? 00:01:34 /tmp/sw/mount/asr1000rp1-rpaccess.03.03.00.S.151-2.S.pkg/usr/binos/bin/psd -f /tmp/sw/rp/0/0/ 0 S root 26968 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/sort_files_by_inode_sh_pmanlog -p /tmp/rp/trace/fifo/pman_sh% 4 S root 27536 26251 0 80 0 - 25375 select Jan16 ? 01:11:38 /tmp/sw/mount/asr1000rp1-rpcontrol.03.03.00.S.151-2.S.pkg/usr/binos/bin/smand -i /tmp/sw/rp/0 0 S root 27864 26693 0 80 0 - 1051 wait Jan16 ? 00:53:59 /bin/bash /tmp/sw/mount/asr1000rp1-rpbase.03.03.00.S.151-2.S.pkg/usr/binos/conf/sort_files_by 4 S root 31481 1 0 80 0 - 792 wait Jan16 ? 00:00:00 /bin/sh /usr/binos/conf/mcp_chvrf.sh liin /usr/sbin/xinetd -f /tmp/etc/xinetd_brelay_liin.con 4 S root 31482 1 0 80 0 - 792 wait Jan16 ? 00:00:00 /bin/sh /usr/binos/conf/mcp_chvrf.sh eobc /usr/sbin/xinetd -f /tmp/etc/xinetd_brelay_eobc.con 4 S root 31484 1 0 80 0 - 769 skb_re Jan16 ? 00:00:03 /usr/bin/sntp -S 0 S root 31486 31481 0 80 0 - 871 select Jan16 ? 00:00:00 /usr/sbin/xinetd -f /tmp/etc/xinetd_brelay_liin.conf -dontfork 4 S root 31487 1 0 80 0 - 895 pipe_w Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/rollback_timer.sh 0 S root 31488 31482 0 80 0 - 871 select Jan16 ? 00:00:00 /usr/sbin/xinetd -f /tmp/etc/xinetd_brelay_eobc.conf -dontfork 4 S root 31491 1 0 80 0 - 887 wait Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/oom.sh 4 S root 31494 1 0 80 0 - 1256 wait Jan16 ? 00:21:01 /bin/bash /usr/binos/conf/chasync.sh 4 S root 31498 1 0 80 0 - 1003 pipe_w Jan16 ? 00:00:00 /bin/bash /usr/binos/conf/iptbl.sh 0 S root 31676 1 0 80 0 - 2080 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f inst_rollback_timer -p /tmp/rp/trace/fifo/rollback_timer_sh%rp_0_0_31487_fi 0 S root 31693 1 0 80 0 - 2080 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f oom -p /tmp/rp/trace/fifo/oom_sh%rp_0_0_31491_fifo 0 S root 31716 1 0 80 0 - 2080 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f iptbl -p /tmp/rp/trace/fifo/iptbl_sh%rp_0_0_31498_fifo 0 S root 31731 1 0 80 0 - 2080 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f chasync -p /tmp/rp/trace/fifo/chasync_sh%rp_0_0_31494_fifo 1 S root 31735 31491 0 80 0 - 1134 wait Jan16 ? 00:02:40 /bin/bash /usr/binos/conf/oom.sh 0 S root 31736 31487 0 80 0 - 516 select Jan16 ? 00:00:00 inotifywait -m --format %w,%-e,%f -e DELETE -e CREATE /bootflash/.rollback_timer /tmp/rp/roll 0 S root 31755 31498 0 80 0 - 516 select Jan16 ? 00:00:00 inotifywait -r -m --format %w,%-e,%f -e create /tmp/rp/chasfs/etc/iptbl
Since we mentioned at the beginning of the article, that the IOS running on an ASR1000 series router is actually ran on top of the Linux kernel running on the hardware, you can view the IOS running as a process within the Linux environment running on the router by entering the command below to ‘grep’ for the ‘iosd’ process.
[Router1_RP_0:/]$ ps -elf | grep iosd 0 S root 5352 4063 0 80 0 - 492 pipe_w 21:34 ttyp1 00:00:00 grep iosd 0 S root 24387 1 0 80 0 - 2081 pipe_w Jan16 ? 00:00:00 /usr/bin/rotee -f /tmp/rp/trace/linux_iosd_image_pmanlog -p /tmp/rp/trace/fifo/pman_sh%rp_0_0_24127_fifo 4 R root 25404 24127 1 80 0 - 489173 - Jan16 ? 1-14:12:36 /tmp/sw/mount/asr1000rp1-rpios-advipservicesk9.03.03.00.S.151-2.S.pkg/usr/binos/bin/linux_iosd-image -n 32768 -m 1800 -c /config
By running the command ‘mount’, you can see various directories that are mounted by the system:
[Router1_RP_0:/]$ mount rootfs on / type rootfs (rw) tmpfs on /tmp type tmpfs (rw,size=2743944k,nr_inodes=116713) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) none on /dev type tmpfs (rw,size=1829296k,nr_inodes=116713,mode=755) /dev/bootflash1 on /bootflash type ext2 (rw,errors=continue) /dev/loop1 on /tmp/sw/mount/asr1000rp1-rpbase.03.03.00.S.151-2.S.pkg type iso9660 (ro) /dev/loop2 on /tmp/sw/mount/asr1000rp1-rpcontrol.03.03.00.S.151-2.S.pkg type iso9660 (ro) /dev/loop3 on /tmp/sw/mount/asr1000rp1-rpios-advipservicesk9.03.03.00.S.151-2.S.pkg type iso9660 (ro) /dev/loop4 on /tmp/sw/mount/asr1000rp1-rpaccess.03.03.00.S.151-2.S.pkg type iso9660 (ro) /dev/loop5 on /tmp/sw/mount/asr1000rp1-espbase.03.03.00.S.151-2.S.pkg type iso9660 (ro) /dev/loop6 on /tmp/sw/mount/asr1000rp1-sipbase.03.03.00.S.151-2.S.pkg type iso9660 (ro) /dev/loop7 on /tmp/sw/mount/asr1000rp1-sipspa.03.03.00.S.151-2.S.pkg type iso9660 (ro) none on /dev type tmpfs (rw) /proc/bus/usb on /proc/bus/usb type usbfs (rw) /dev/mtdblock1 on /obfl type jffs2 (rw,noatime,nodiratime) /etc/auto.vol on /vol type autofs (rw,fd=5,pgrp=14320,timeout=60,minproto=5,maxproto=5,indirect)
The commands below will give you a listing of the volumes available on the device itself, and also list certain packages that are mounted by the system:
[Router1_RP_0:/]$ ls -al /vol total 0 drwxr-xr-x 7 root root 0 Jan 16 13:54 . drwxr-xr-x 20 904735 25 0 Jan 16 13:54 .. dr-xr-xr-x 2 root root 0 Jan 16 13:54 bootflash4 dr-xr-xr-x 2 root root 0 Jan 16 13:54 disk0 dr-xr-xr-x 2 root root 0 Jan 16 13:54 harddisk dr-xr-xr-x 2 root root 0 Jan 16 13:54 usb0 dr-xr-xr-x 2 root root 0 Jan 16 13:54 usb1
[Router1_RP_0:/]$ ls -al /tmp/sw/mount total 14 drwxr-xr-x 9 root root 180 Jan 16 13:53 . drwxr-xr-x 14 root root 280 Jan 16 13:54 .. dr-xr-xr-x 9 root root 2048 Mar 25 2011 asr1000rp1-espbase.03.03.00.S.151-2.S.pkg dr-xr-xr-x 7 root root 2048 Mar 25 2011 asr1000rp1-rpaccess.03.03.00.S.151-2.S.pkg dr-xr-xr-x 8 root root 2048 Mar 25 2011 asr1000rp1-rpbase.03.03.00.S.151-2.S.pkg dr-xr-xr-x 6 root root 2048 Mar 25 2011 asr1000rp1-rpcontrol.03.03.00.S.151-2.S.pkg dr-xr-xr-x 6 root root 2048 Mar 25 2011 asr1000rp1-rpios-advipservicesk9.03.03.00.S.151-2.S.pkg dr-xr-xr-x 10 root root 2048 Mar 25 2011 asr1000rp1-sipbase.03.03.00.S.151-2.S.pkg dr-xr-xr-x 6 root root 2048 Mar 25 2011 asr1000rp1-sipspa.03.03.00.S.151-2.S.pkg
The command below can be ran to take a look at the cpu information of the router:
[Router1_RP_0:/]$ cat /proc/cpuinfo processor : 0 cpu : e500v2 clock : 1400.000000MHz revision : 2.2 (pvr 8021 0022) bogomips : 99.84 timebase : 50000000 platform : MPC85xx ADS model : MPC8540ADS Vendor : Freescale Semiconductor Machine : mpc85xx PVR : 0x80210022 SVR : 0x80390021 PLL setting : 0x7 Memory : 4031 MB
The ‘route’ and ‘arp’ commands ran within the RP shell session will give you information of the private IP addresses that are used internally to communicate with the different physical cards in the router. This is for communication between the ESP, SIP, and RP.
[Router1_RP_0:/]$ route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.2.0.0 * 255.255.0.0 U 0 0 0 eth0 10.0.0.0 * 255.255.0.0 U 0 0 0 eth0
[Router1_RP_0:/]$ arp -a cc0 (10.2.0.100) at 00:00:03:00:00:00 [ether] on eth0 fp-active (10.2.0.3) at 00:00:02:00:00:00 [ether] on eth0 ? (10.0.2.0) at 00:00:02:00:00:00 [ether] on eth0 ? (10.0.3.0) at 00:00:03:00:00:00 [ether] on eth0
Using telnet from the shell session into the RP, we can log into the SIP, which is a separate linecard in the router itself , or a built-in piece of hardware that manages the interfaces themselves.
[Router1_RP_0:/]$ telnet 10.0.3.0 Trying 10.0.3.0... Connected to 10.0.3.0. Escape character is '^]'. Linux 2.6.27.45 (Router1_SIP_0) (ttyp0) 2014/05/11 21:36:53 : <anon> [Router1_SIP_0:~]$
We’ll stick to the RP and the information we can gather from it, so we’ll just exit from the telnet session to the SIP, and drop back into the RP. This was just to show you the functionality of being able to jump from one device to the other within the router.
[Router1_SIP_0:~]$ exit Connection closed by foreign host. [Router1_RP_0:/]$
In case you need to plan any boring meetings or important appointments while you’re shelled into your router, you can always use the ‘calendar’ command.
[Router1_RP_0:/]$ calendar May 2014 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Remember the IP connectivity between the ESP, SIP, and RP? You can run a ‘tcpdump’ and see how chatty they all are with each other:
[Router1_RP_0:/]$ /usr/sbin/tcpdump tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 68 bytes 21:41:40.409468 arp who-has fp0-0 tell rp0-0 21:41:40.409496 arp reply fp0-0 is-at 00:00:02:00:00:00 21:41:40.410259 IP fp0-0.34322 > rp0-0.2000: P 285904656:285905314(658) ack 2091012006 win 713 <nop,nop,timestamp 1369550425 1369654125> 21:41:40.410305 IP rp0-0.2000 > fp0-0.34322: . ack 658 win 5316 <nop,nop,timestamp 1369655125 1369550425> 21:41:40.463446 IP rp0-0.2004 > fp0-0.34757: . ack 2424389883 win 91 <nop,nop,timestamp 1369655179 1369545478> 21:41:40.463506 IP fp0-0.34757 > rp0-0.2004: . ack 1 win 92 <nop,nop,timestamp 1369550478 1369654942> 21:41:40.464445 IP rp0-0.2006 > fp0-0.36162: . ack 2437229998 win 91 <nop,nop,timestamp 1369655180 1369545479> 21:41:40.464492 IP fp0-0.36162 > rp0-0.2006: . ack 1 win 92 <nop,nop,timestamp 1369550479 1369654942> 21:41:40.527302 IP cc0-0.47049 > rp0-0.2000: P 2107703344:2107703673(329) ack 2952028107 win 561 <nop,nop,timestamp 1369497903 1369654242> 21:41:40.527335 IP rp0-0.2000 > cc0-0.47049: . ack 329 win 2685 <nop,nop,timestamp 1369655242 1369497903> 21:41:40.554447 IP rp0-0.2418 > fp0-0.48788: . ack 2504349267 win 1714 <nop,nop,timestamp 1369655270 1369545569> 21:41:40.554503 IP fp0-0.48788 > rp0-0.2418: . ack 1 win 6122 <nop,nop,timestamp 1369550569 1369650305> 21:41:40.589890 IP fp0-0.48788 > rp0-0.2418: . ack 1 win 6122 <nop,nop,timestamp 1369550605 1369650305> 21:41:40.589921 IP rp0-0.2418 > fp0-0.48788: . ack 1 win 1714 <nop,nop,timestamp 1369655305 1369550569> 21:41:41.307953 IP fp0-0.51314 > rp0-0.2416: P 2939036053:2939036705(652) ack 2506809225 win 92 <nop,nop,timestamp 1369551323 1369653886> 21:41:41.308009 IP rp0-0.2416 > fp0-0.51314: . ack 652 win 6122 <nop,nop,timestamp 1369656023 1369551323> 21:41:41.388856 IP rp0-0.4006 > cc0-0.4000: UDP, length: 60 21:41:41.410235 IP fp0-0.34322 > rp0-0.2000: P 658:1316(658) ack 1 win 713 <nop,nop,timestamp 1369551425 1369655125> 21:41:41.410290 IP rp0-0.2000 > fp0-0.34322: . ack 1316 win 5316 <nop,nop,timestamp 1369656125 1369551425> 21:41:41.527322 IP cc0-0.47049 > rp0-0.2000: P 329:658(329) ack 1 win 561 <nop,nop,timestamp 1369498903 1369655242> 21:41:41.527377 IP rp0-0.2000 > cc0-0.47049: . ack 658 win 2685 <nop,nop,timestamp 1369656242 1369498903> 21:41:41.734197 IP cc0-0.4000 > rp0-0.4006: UDP, length: 66 21:41:41.812933 IP fp0-0.41524 > rp0-0.2008: . ack 2304358824 win 92 <nop,nop,timestamp 1369551828 1369651528> 21:41:41.812983 IP rp0-0.2008 > fp0-0.41524: . ack 1 win 175 <nop,nop,timestamp 1369656528 1369550203> 21:41:42.014180 IP cc0-0.59792 > rp0-0.2002: P 3212627474:3212627702(228) ack 3116626034 win 1988 <nop,nop,timestamp 1369499390 1369654730> 21:41:42.044525 IP cc0-0.59792 > rp0-0.2002: P 228:1127(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369654730> 21:41:42.044576 IP rp0-0.2002 > cc0-0.59792: . ack 1127 win 6122 <nop,nop,timestamp 1369656760 1369499390> 21:41:42.044586 IP cc0-0.59792 > rp0-0.2002: P 1127:2026(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369654730> 21:41:42.044599 IP cc0-0.59792 > rp0-0.2002: P 2026:2925(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369654730> 21:41:42.044642 IP cc0-0.59792 > rp0-0.2002: P 2925:3824(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369654730> 21:41:42.044719 IP cc0-0.59792 > rp0-0.2002: P 3824:3876(52) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369656760> 21:41:42.044772 IP cc0-0.59792 > rp0-0.2002: P 3876:4775(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369656760> 21:41:42.044801 IP cc0-0.59792 > rp0-0.2002: P 4775:5674(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369656760> 21:41:42.044830 IP cc0-0.59792 > rp0-0.2002: P 5674:6573(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369656760> 21:41:42.044858 IP cc0-0.59792 > rp0-0.2002: P 6573:7472(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369656760> 21:41:42.044887 IP cc0-0.59792 > rp0-0.2002: P 7472:8371(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369656760> 21:41:42.044918 IP cc0-0.59792 > rp0-0.2002: P 8371:9270(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369656760> 21:41:42.044950 IP cc0-0.59792 > rp0-0.2002: P 9270:10169(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369656760> 21:41:42.044980 IP cc0-0.59792 > rp0-0.2002: P 10169:11068(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369656760> 21:41:42.045008 IP cc0-0.59792 > rp0-0.2002: P 11068:11967(899) ack 1 win 1988 <nop,nop,timestamp 1369499420 1369656760> 21:41:42.045069 IP cc0-0.59792 > rp0-0.2002: P 11967:12866(899) ack 1 win 1988 <nop,nop,timestamp 1369499421 1369656760> 21:41:42.045102 IP cc0-0.59792 > rp0-0.2002: P 12866:12918(52) ack 1 win 1988 <nop,nop,timestamp 1369499421 1369656760> 21:41:42.045148 IP cc0-0.59792 > rp0-0.2002: P 12918:13817(899) ack 1 win 1988 <nop,nop,timestamp 1369499421 1369656760> 21:41:42.045177 IP cc0-0.59792 > rp0-0.2002: P 13817:14716(899) ack 1 win 1988 <nop,nop,timestamp 1369499421 1369656760> 21:41:42.045207 IP cc0-0.59792 > rp0-0.2002: P 14716:15615(899) ack 1 win 1988 <nop,nop,timestamp 1369499421 1369656760> 21:41:42.045233 IP cc0-0.59792 > rp0-0.2002: P 15615:16514(899) ack 1 win 1988 <nop,nop,timestamp 1369499421 1369656760> 21:41:42.045261 IP cc0-0.59792 > rp0-0.2002: P 16514:17413(899) ack 1 win 1988 <nop,nop,timestamp 1369499421 1369656760> 21:41:42.045296 IP cc0-0.59792 > rp0-0.2002: P 17413:18312(899) ack 1 win 1988 <nop,nop,timestamp 1369499421 1369656760> 21:41:42.045316 IP cc0-0.59792 > rp0-0.2002: P 18312:18763(451) ack 1 win 1988 <nop,nop,timestamp 1369499421 1369656760> 21:41:42.046065 IP cc0-0.59792 > rp0-0.2002: P 18763:18881(118) ack 1 win 1988 <nop,nop,timestamp 1369499421 1369656760> 21:41:42.059856 IP rp0-0.2002 > cc0-0.59792: . ack 18881 win 6081 <nop,nop,timestamp 1369656775 1369499420> 21:41:42.059996 IP rp0-0.2002 > cc0-0.59792: P 1:53(52) ack 18881 win 6081 <nop,nop,timestamp 1369656775 1369499420> 21:41:42.060071 IP cc0-0.59792 > rp0-0.2002: . ack 53 win 1988 <nop,nop,timestamp 1369499436 1369656775> 21:41:42.060141 IP rp0-0.2002 > cc0-0.59792: P 53:105(52) ack 18881 win 6081 <nop,nop,timestamp 1369656775 1369499436> 21:41:42.060193 IP cc0-0.59792 > rp0-0.2002: . ack 105 win 1988 <nop,nop,timestamp 1369499436 1369656775> 21:41:42.075067 IP cc0-0.46379 > rp0-0.2007: . ack 3018871003 win 127 <nop,nop,timestamp 1369499451 1369651790> 21:41:42.075114 IP rp0-0.2007 > cc0-0.46379: . ack 1 win 2654 <nop,nop,timestamp 1369656790 1369494451> 21:41:42.075443 IP rp0-0.2007 > cc0-0.46379: . ack 1 win 2654 <nop,nop,timestamp 1369656791 1369494451> 21:41:42.075497 IP cc0-0.46379 > rp0-0.2007: . ack 1 win 127 <nop,nop,timestamp 1369499451 1369656790> 21:41:42.076049 IP cc0-0.46064 > rp0-0.2007: . ack 3038202180 win 127 <nop,nop,timestamp 1369499452 1369651791> 21:41:42.076068 IP rp0-0.2007 > cc0-0.46064: . ack 1 win 2654 <nop,nop,timestamp 1369656791 1369494452> 21:41:42.076443 IP rp0-0.2007 > cc0-0.46064: . ack 1 win 2654 <nop,nop,timestamp 1369656792 1369494452> 21:41:42.076458 IP rp0-0.2007 > cc0-0.41694: . ack 3252000029 win 2654 <nop,nop,timestamp 1369656792 1369494452> 21:41:42.076492 IP cc0-0.46064 > rp0-0.2007: . ack 1 win 127 <nop,nop,timestamp 1369499452 1369656791> 21:41:42.076513 IP cc0-0.41694 > rp0-0.2007: . ack 1 win 127 <nop,nop,timestamp 1369499452 1369651792> 21:41:42.077045 IP cc0-0.41694 > rp0-0.2007: . ack 1 win 127 <nop,nop,timestamp 1369499453 1369651792> 21:41:42.077061 IP rp0-0.2007 > cc0-0.41694: . ack 1 win 2654 <nop,nop,timestamp 1369656792 1369499452> 21:41:42.079980 IP cc0-0.59792 > rp0-0.2002: P 18881:19394(513) ack 105 win 1988 <nop,nop,timestamp 1369499455 1369656775> 21:41:42.080711 IP cc0-0.41694 > rp0-0.2007: P 1:172(171) ack 1 win 127 <nop,nop,timestamp 1369499456 1369656792> 21:41:42.080754 IP rp0-0.2007 > cc0-0.41694: . ack 172 win 2654 <nop,nop,timestamp 1369656796 1369499456> 21:41:42.081946 IP cc0-0.46379 > rp0-0.2007: P 1:172(171) ack 1 win 127 <nop,nop,timestamp 1369499457 1369656790> 21:41:42.081983 IP rp0-0.2007 > cc0-0.46379: . ack 172 win 2654 <nop,nop,timestamp 1369656797 1369499457> 21:41:42.082944 IP cc0-0.46064 > rp0-0.2007: P 1:172(171) ack 1 win 127 <nop,nop,timestamp 1369499458 1369656791> 21:41:42.082990 IP rp0-0.2007 > cc0-0.46064: . ack 172 win 2654 <nop,nop,timestamp 1369656798 1369499458> 21:41:42.085032 IP cc0-0.53672 > rp0-0.2007: . ack 3054838804 win 127 <nop,nop,timestamp 1369499461 1369651801> 21:41:42.085054 IP rp0-0.2007 > cc0-0.53672: . ack 1 win 5316 <nop,nop,timestamp 1369656800 1369494461> 21:41:42.085443 IP rp0-0.2007 > cc0-0.53672: . ack 1 win 5316 <nop,nop,timestamp 1369656801 1369494461> 21:41:42.085474 IP cc0-0.53672 > rp0-0.2007: . ack 1 win 127 <nop,nop,timestamp 1369499461 1369656800> 21:41:42.089451 IP rp0-0.2007 > cc0-0.37355: . ack 3404816227 win 2654 <nop,nop,timestamp 1369656805 1369494466> 21:41:42.089517 IP cc0-0.37355 > rp0-0.2007: . ack 1 win 127 <nop,nop,timestamp 1369499465 1369651805> 21:41:42.090037 IP cc0-0.37355 > rp0-0.2007: . ack 1 win 127 <nop,nop,timestamp 1369499466 1369651805> 21:41:42.090055 IP rp0-0.2007 > cc0-0.37355: . ack 1 win 2654 <nop,nop,timestamp 1369656805 1369499465> 21:41:42.119470 IP rp0-0.2002 > cc0-0.59792: . ack 19394 win 6122 <nop,nop,timestamp 1369656835 1369499455> 21:41:42.410269 IP fp0-0.34322 > rp0-0.2000: P 1316:1974(658) ack 1 win 713 <nop,nop,timestamp 1369552425 1369656125> 21:41:42.410330 IP rp0-0.2000 > fp0-0.34322: . ack 1974 win 5316 <nop,nop,timestamp 1369657125 1369552425> 21:41:42.526467 IP rp0-0.2000 > cc0-0.47049: . ack 658 win 2685 <nop,nop,timestamp 1369657242 1369498903> 21:41:42.526537 IP cc0-0.47049 > rp0-0.2000: . ack 1 win 561 <nop,nop,timestamp 1369499902 1369656242> 21:41:42.527314 IP cc0-0.47049 > rp0-0.2000: P 658:987(329) ack 1 win 561 <nop,nop,timestamp 1369499903 1369656242> 21:41:42.527356 IP rp0-0.2000 > cc0-0.47049: . ack 987 win 2685 <nop,nop,timestamp 1369657242 1369499903> ^C 89 packets captured 89 packets received by filter 0 packets dropped by kernel
And if you’re curious what’s hogging all of your CPU, the ‘top’ command works here as well:
[Router1_RP_0:/]$ top [H [2J [mtop - 21:41:49 up 115 days, 6:38, 0 users, load average: 0.15, 0.09, 0.08 [m [K Tasks: [m [m 130 [mtotal, [m [m 3 [mrunning, [m [m 127 [msleeping, [m [m 0 [mstopped, [m [m 0 [mzombie [m [K Cpu(s): [m [m 1.8% [mus, [m [m 2.7% [msy, [m [m 0.0% [mni, [m [m 95.5% [mid, [m [m 0.0% [mwa, [m [m 0.0% [mhi, [m [m 0.0% [msi, [m [m 0.0% [mst [m [K Mem: [m [m 3874976k [mtotal, [m [m 1689436k [mused, [m [m 2185540k [mfree, [m [m 116612k [mbuffers [m [K Swap: [m [m 0k [mtotal, [m [m 0k [mused, [m [m 0k [mfree, [m [m 1056060k [mcached [m [K [6;1H [7m PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND [m [K [m24682 root 20 0 26316 14m 13m S 9.8 0.4 1390:17 imand [m [m [m10497 root 20 0 2648 1168 888 R 2.0 0.0 0:00.01 top [m [m 1 root 20 0 2156 640 552 S 0.0 0.0 0:18.07 init [m [m 2 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 kthreadd [m [m 3 root 15 -5 0 0 0 S 0.0 0.0 0:32.09 ksoftirqd/0 [m [m 4 root RT -5 0 0 0 S 0.0 0.0 0:00.06 watchdog/0 [m [m 5 root 15 -5 0 0 0 S 0.0 0.0 0:04.48 events/0 [m [m 6 root 15 -5 0 0 0 S 0.0 0.0 0:00.02 khelper [m [m 9 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 netns [m [m 61 root 15 -5 0 0 0 S 0.0 0.0 0:00.06 kblockd/0 [m [m 69 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 ata/0 [m [m 70 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 ata_aux [m [m 76 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 khubd [m [m 79 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod [m [m 124 root 20 0 0 0 0 S 0.0 0.0 0:01.11 pdflush [m [m 125 root 20 0 0 0 0 S 0.0 0.0 0:01.30 pdflush [m [m 126 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 kswapd0 [m [m 178 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0 [m [m 1010 root 20 0 3196 620 528 S 0.0 0.0 0:00.00 sleep [m [m 1011 root 15 -5 0 0 0 S 0.0 0.0 0:00.23 mtdblockd [m [m 1077 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0 [m [m 1078 root 15 -5 0 0 0 S 0.0 0.0 0:28.76 usb-storage [m [m 1095 root 15 -5 0 0 0 S 0.0 0.0 0:09.00 mcp-rtc-wq [m [m 2179 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 rpciod/0 [m [m 2184 root 15 -5 0 0 0 S 0.0 0.0 0:00.00 nfsiod [m [m 2224 root 0 -20 0 0 0 S 0.0 0.0 0:01.30 loop0 [m [m 2322 bin 20 0 2244 688 564 S 0.0 0.0 0:00.00 portmap [m [m 2376 root 0 -20 0 0 0 S 0.0 0.0 0:00.02 loop1 [m [m 2413 root 0 -20 0 0 0 S 0.0 0.0 0:00.11 loop2 [m [m 2450 root 0 -20 0 0 0 S 0.0 0.0 0:00.31 loop3 [m [m 2487 root 0 -20 0 0 0 S 0.0 0.0 0:00.01 loop4 [m [m 2596 root 0 -20 0 0 0 S 0.0 0.0 0:00.06 loop5 [m [m 2633 root 0 -20 0 0 0 S 0.0 0.0 0:00.01 loop6 [m [m 2706 root 0 -20 0 0 0 S 0.0 0.0 0:00.11 loop7 [m [m 3833 root 20 0 3952 2232 1228 S 0.0 0.1 0:00.11 in.telnetd.sh [m [m 3919 root 20 0 9004 2248 1740 S 0.0 0.1 0:00.04 in.telnetd [m [m 3920 root 20 0 3952 2232 1228 S 0.0 0.1 0:00.11 brelay.sh [m [6;1H [K [H [mtop - 21:41:52 up 115 days, 6:38, 0 users, load average: 0.14, 0.09, 0.08 [m [K Tasks: [m [m 130 [mtotal, [m [m 2 [mrunning, [m [m 128 [msleeping, [m [m 0 [mstopped, [m [m 0 [mzombie [m [K Cpu(s): [m [m 6.6% [mus, [m [m 14.5% [msy, [m [m 0.0% [mni, [m [m 78.9% [mid, [m [m 0.0% [mwa, [m [m 0.0% [mhi, [m [m 0.0% [msi, [m [m 0.0% [mst [m [K Mem: [m [m 3874976k [mtotal, [m [m 1689684k [mused, [m [m 2185292k [mfree, [m [m 116612k [mbuffers [m [K Swap: [m [m 0k [mtotal, [m [m 0k [mused, [m [m 0k [mfree, [m [m 1056068k [mcached [m [K [6;1H
Well that wraps up some of the more basic things you can explore within your ASR1000 series router’s Linux shell. There are a host of other in depth functions that can be done from here, all have varying degrees of risk and should only be attempted in a lab environment or under Cisco’s supervision. Hopefully this has provided you with some information of some of the interworkings of your router that go a little deeper than the regular IOS commands, and really delve into what is running underneath it all to make it work.
\t\n' LINES=44 LOGDIR=/tmp/rp LOGFILE=/tmp/rp/pvp_log MACHTYPE=powerpc-unknown-linux-gnu MAILCHECK=60 MQIPC_PREFIX_NAME= NETIO_NETMAP=/usr/binos/bin/rp/NETMAP OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/tmp/sw/rp/0/0/rp_daemons/mount/bin:/tmp/sw/rp/0/0/rp_daemons/mount/usr/bin:/tmp/sw/rp/0/0/rp_daemons/mount/usr/binos/conf:/tmp/sw/rp/0/0/rp_daemons/mount/usr/binos/sbin:/tmp/sw/rp/0/0/rp_daemons/mount/usr/binos/bin:/tmp/sw/rp/0/0/rp_daemons/mount/usr/cpp/bin:/usr/bin:/bin:/sbin:/usr/binos/conf:/usr/binos/bin PIPESTATUS=([0]="127") PPID=4062 PROC_SCOREBOARD_BKTRACE_FILE=/tmp/rp/process/brelay%rp_0_0/brelay%rp_0_0.backtrace PROF_DIR=/harddisk PS1='[\h:\w]$ ' PS2='> ' PS4='+ ' PWD=/ REAL_MGMTE_DEV=eth2 REMOTEHOST=192.168.1.2 ROMMON_BINFOVER=5 ROMMON_BOOT='bootflash:asr1000rp1-advipservicesk9.03.03.00.S.151-2.S.bin,1;' ROMMON_BSI=0 ROMMON_MCP_STARTUP_TRACEFLAGS=00000000:00000000 ROMMON_NT_K=0:0:0:0 ROMMON_PLATFORM_MAX_INTERFACES= ROMMON_PS1='rommon _ _ ' ROMMON_RANDOM_NUM=1820195334 ROMMON_RET_2_RCALTS= ROMMON_RET_2_RTS='04:43:33 CDT Sun Mar 25 2012' ROMMON_VERSION='12.2(33r)XNC' SHELL=/bin/bash SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor SHLVL=5 SW_FRU_BASE=/tmp/sw/rp/0/0/rp_daemons/mount TERM=xterm UID=0 USER=binos _=lsblk
Below is the output of the ‘ps -elf’ command to view all of the system processes:
Since we mentioned at the beginning of the article, that the IOS running on an ASR1000 series router is actually ran on top of the Linux kernel running on the hardware, you can view the IOS running as a process within the Linux environment running on the router by entering the command below to ‘grep’ for the ‘iosd’ process.
By running the command ‘mount’, you can see various directories that are mounted by the system:
The commands below will give you a listing of the volumes available on the device itself, and also list certain packages that are mounted by the system:
The command below can be ran to take a look at the cpu information of the router:
The ‘route’ and ‘arp’ commands ran within the RP shell session will give you information of the private IP addresses that are used internally to communicate with the different physical cards in the router. This is for communication between the ESP, SIP, and RP.
Using telnet from the shell session into the RP, we can log into the SIP, which is a separate linecard in the router itself , or a built-in piece of hardware that manages the interfaces themselves.
We’ll stick to the RP and the information we can gather from it, so we’ll just exit from the telnet session to the SIP, and drop back into the RP. This was just to show you the functionality of being able to jump from one device to the other within the router.
In case you need to plan any boring meetings or important appointments while you’re shelled into your router, you can always use the ‘calendar’ command.
Remember the IP connectivity between the ESP, SIP, and RP? You can run a ‘tcpdump’ and see how chatty they all are with each other:
And if you’re curious what’s hogging all of your CPU, the ‘top’ command works here as well:
Well that wraps up some of the more basic things you can explore within your ASR1000 series router’s Linux shell. There are a host of other in depth functions that can be done from here, all have varying degrees of risk and should only be attempted in a lab environment or under Cisco’s supervision. Hopefully this has provided you with some information of some of the interworkings of your router that go a little deeper than the regular IOS commands, and really delve into what is running underneath it all to make it work.