Friday, October 24, 2014

Router IOS Upgrade via tftpdnld and format flash Command

There were some IT stuff that my company's warehouse got rid of not so long ago. I was lucky to have picked up a couple of Cisco 64 MB Compact Flash (CF) cards. So I tested them out and inserted them in one of my lab router to update its Internetwork Operating Software (IOS).

I've used the handy tftpdnld command in ROM Monitor (ROMmon) mode. I was able to get to ROMmon by booting up the router without its CF card. I also connected an RJ45 cable to port F0/0 (sometimes other ports doesn't work) on the 1841, set my laptop to 10.1.1.1/24 and ran a TFTP client. The commands in ROMmon mode are case sensitive.

rommon 1 > tftpdnld

Missing or illegal ip address for variable IP_ADDRESS
Illegal IP address.

usage: tftpdnld [-hr]
  Use this command for disaster recovery only to recover an image via TFTP.
  Monitor variables are used to set up parameters for the transfer.
  (Syntax: "VARIABLE_NAME=value" and use "set" to show current variables.)
  "ctrl-c" or "break" stops the transfer before flash erase begins.

  The following variables are REQUIRED to be set for tftpdnld:
            IP_ADDRESS: The IP address for this unit
        IP_SUBNET_MASK: The subnet mask for this unit
       DEFAULT_GATEWAY: The default gateway for this unit
           TFTP_SERVER: The IP address of the server to fetch from
             TFTP_FILE: The filename to fetch

  The following variables are OPTIONAL:
          TFTP_VERBOSE: Print setting. 0=quiet, 1=progress(default), 2=verbose
      TFTP_RETRY_COUNT: Retry count for ARP and TFTP (default=18)
          TFTP_TIMEOUT: Overall timeout of operation in seconds (default=7200)
         TFTP_CHECKSUM: Perform checksum test on image, 0=no, 1=yes (default=1)
               FE_PORT: 0= (default), 1
         FE_SPEED_MODE: 0=10/hdx, 1=10/fdx, 2=100/hdx, 3=100/fdx,
                        4=Auto (default)

  Command line options:
   -h: this help screen
   -r: do not write flash, load to DRAM only and launch image

rommon 1 > IP_ADDRESS=10.1.1.2    // I USED THE 10.x.x.x NETWORK TO AVOID CONFLICT WITH MY WIFI 192.168.1.0/24 SUBNET
rommon 2 > IP_SUBNET_MASK=255.255.255.0
rommon 3 > DEFAULT_GATEWAY=10.1.1.1
rommon 4 > TFTP_SERVER=10.1.1.1
rommon 5 > TFTP_FILE=c1841-adventerprisek9-mz.124-24.T2.bin
rommon 6 > tftpdnld    // NOT CASE SENSITIVE

          IP_ADDRESS: 10.1.1.2
      IP_SUBNET_MASK: 255.255.255.0
     DEFAULT_GATEWAY: 10.1.1.1
         TFTP_SERVER: 10.1.1.1
           TFTP_FILE: c1841-adventerprisek9-mz.124-24.T2.bin
        TFTP_MACADDR: 00:0a:b8:f8:83:92
        TFTP_VERBOSE: Progress
    TFTP_RETRY_COUNT: 18
        TFTP_TIMEOUT: 7200
       TFTP_CHECKSUM: Yes
             FE_PORT: 0
       FE_SPEED_MODE: Auto Detect

Invoke this command for disaster recovery only.
WARNING: all existing data in all partitions on flash will be lost!
Do you wish to continue? y/n:  [n]:  y
.
Receiving c1841-adventerprisek9-mz.124-24.T2.bin from 10.1.1.1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

<OUTPUT TRUNCATED>

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.................. [TIMED OUT]
TFTP: Operation terminated.


For some reason the TFTP timed out in the end. So I boot up my 1841 with a working IOS and saw the CF that I picked up wasn't formatted properly. I used the format flash: command to format the CF card and in order to be compatible with the router.


R1#show flash
Unformatted Partition, please format it.

R1#
Unknown file system detected.
Use format command to format the card as DOS File System.

R1#format ?
  flash:  Filesystem to be formatted

R1#format flash: ?
  <cr>

R1#format flash:
Format operation may take a while. Continue? [confirm]
Format operation will destroy all data in "flash:".  Continue? [confirm]
Enter volume ID (up to 64 chars)[default flash:]:

Primary Partition created...Size 61 MB

Drive communication & 1st Sector Write OK...
Writing Monlib sectors....
Monlib write complete

Format: All system sectors written. OK...

Format: Total sectors in formatted partition: 125408
Format: Total bytes in formatted partition: 64208896
Format: Operation completed successfully.

Format of flash: complete    // JUST TOOK A FEW SECONDS TO RE-FORMAT


Since I'm in privileged EXEC mode on the router, I can perform the IOS upgrade via the copy tftp flash command.

R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface fastethernet0/0
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#no shutdown
*Oct 25 06:23:03.643: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Oct 25 06:23:04.643: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#end
R1#
*Oct 25 06:23:29.107: %SYS-5-CONFIG_I: Configured from console by console
R1#copy tftp://10.1.1.1/c1841-adventerprisek9-mz.124-24.T2.bin flash:
Destination filename [c1841-adventerprisek9-mz.124-24.T2.bin]?
Accessing tftp://10.1.1.1/c1841-adventerprisek9-mz.124-24.T2.bin...
Loading c1841-adventerprisek9-mz.124-24.T2.bin from 10.1.1.1 (via FastEthernet0/0): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 40529832 bytes]

40529832 bytes copied in 183.628 secs (220717 bytes/sec)

R1#reload

System configuration has been modified. Save? [yes/no]: n
Proceed with reload? [confirm]

*Oct 25 06:28:17.659: %SYS-5-RELOAD: Reload requested  by console. Reload Reason: Reload Command.

<OUTPUT TRUNCATED>

R1>enable
R1#dir    // ALTERNATIVE TO show flash
Directory of flash:/

    1  -rw-    40529832  Oct 25 2014 06:26:48 +00:00  c1841-adventerprisek9-mz.124-24.T2.bin

64004096 bytes total (23474176 bytes free)

R1#show version | include IOS
Cisco IOS Software, 1841 Software (C1841-ADVENTERPRISEK9-M), Version 12.4(24)T2, RELEASE SOFTWARE (fc2)

Saturday, October 18, 2014

CCNP ROUTE Lab Equipment

I got a little sidetracked from my CCNP Security journey and I'll be taking up CCDP (hopefully to also add CompTIA Security+) while waiting for the new books to be officially released next year. I only got SITCS left and it's rumored that the Cisco press Official Certification Guide (OCG) would be released sometime in May 2015.

I already got CCNP SWITCH, which in my opinion was the easiest exam among the three, back in 2011 in order to extend my CCNP. I would also need to take ROUTE and ARCH. The CCNP exams will be updated to version 2 and the last day to sit for ROUTE, SWITCH and TSHOOT version 1 will be on January 29, 2015. Cisco hasn't changed yet their exam for CCDP ARCH 642-874 as of this writing.

I'm done reading the ROUTE OCG and was doing some labs. I've used the CCNP ROUTE Lab Manual which is free on the Internet. My lab consists of  a 871w router (not shown in the pic) for my wireless access, 2511 router for my terminal server, a 3560 switch, 3x 1841 ISR for my branch/spoke routers and a 2811 for my hub router or as a frame relay switch.



These are the screenshots on how to use my Terminal Server menu options.





Aside from the "menu" options on my Terminal Server, a Telnet session can be opened by typing the hostname under privileged EXEC mode.


I mentioned on my last post that I'll be using my 871w for my wifi and connect it to the AUI adapter on the 2511 so that I could conveniently access to my lab devices using wireless (with an iPad). The wifi access on my 871w together with the 2511 Terminal Server helps me perform my labs easier. It also saves my home users from screaming there's no Internet access :)


Here's the complete working config on my Terminal Server.

2511-TS#sh run
Building configuration...

Current configuration : 2700 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service udp-small-servers
service tcp-small-servers
!
hostname 2511-TS
!
logging queue-limit 100
enable password cisco
!
username cisco privilege 15 password 0 cisco
ip subnet-zero
ip host sw 2002 1.1.1.1
ip host fr 2001 1.1.1.1
ip host r3 2005 1.1.1.1
ip host r2 2004 1.1.1.1
ip host r1 2003 1.1.1.1
!
!
!
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface Ethernet0
 description TRUNK TO 871W
 ip address 192.168.1.2 255.255.255.0
 no ip route-cache
 no ip mroute-cache
!
interface Serial0
 no ip address
 no ip route-cache
 no ip mroute-cache
 shutdown
 no fair-queue
!
interface Serial1
 no ip address
 no ip route-cache
 no ip mroute-cache
 shutdown
!
no ip http server
ip classless
!
!
!
!
menu TS title ^C
+---------------------------------------------------+
|  John Lagura's CCNP ROUTE Lab Terminal Server     |
|                                                   |
| To exit a device, use CTRL+SHIFT+6 then press x   |
+---------------------------------------------------+
^C
menu TS prompt ^C Make a selection: ^C
menu TS text 1 Connect to Lab rack 2811- Frame Relay Switch
menu TS command 1 resume fr /connect telnet fr
menu TS text 2 Connect to Lab rack 3560 - SW1
menu TS command 2 resume sw /connect telnet sw
menu TS text 3 Connect to Lab rack 1841 - R1
menu TS command 3 resume r1 /connect telnet r1
menu TS text 4 Connect to Lab rack 1841 - R2
menu TS command 4 resume r2 /connect telnet r2
menu TS text 5 Connect to Lab rack 1841 - R3
menu TS command 5 resume r3 /connect telnet r3
menu TS command c3 c3
menu TS command c4 c4
menu TS command c5 c5
menu TS command c1 c1
menu TS command c2 c2
menu TS text s Show all established sessions
menu TS command s show sessions
menu TS options s pause
menu TS text e Exit Menu
menu TS command e menu-exit
menu TS text c# Clear the session by number, example: c1
menu TS text q Quit TS session
menu TS command q quit
menu TS clear-screen
menu TS line-mode
!
banner login ^C
+--------------------------------------------------------------+
| This equipment is privately owned and monitored.             |
| Disconnect immediately if you are not an authorized user.    |
+--------------------------------------------------------------+
^C
alias exec c1 disconnect fr
alias exec c2 disconnect sw
alias exec c3 disconnect r1
alias exec c4 disconnect r2
alias exec c5 disconnect r3
!
line con 0
 logging synchronous
line 1 16
 exec-timeout 0 0
 no flush-at-activation
 no exec
 transport input telnet
line aux 0
 transport input all
line vty 0 4
 password cisco
 login local
 autocommand  menu TS
!
end