This tutorial will guide you through flashing a new IOS onto a CiscoWikipedia: Cisco Systems, Inc. is an American multinational corporation headquartered in San Jose, California, United States, that designs, manufactures, and sells networking equipment. The stock was added to... switchWikipedia: A network switch is a computer networking device that links network segments or network devices. The term commonly refers to a multi-port network bridge that processes and routes data at the data link... or routerWikipedia: A router is a device that forwards data packets between computer networks, creating an overlay internetwork. A router is connected to two or more data lines from different networks. When a data packet....
Cisco devices use IOS images which are typically in .bin (binary) format. The device will download the image of your choice from a TFTPWikipedia: Trivial File Transfer Protocol (TFTP) is a file transfer protocol notable for its simplicity. It is generally used for automated transfer of configuration or boot files between machines in a local env... server and write it to its internal flash memory. Once you have obtained your new IOS image, you will need to set up a TFTP server on a networked PC. A good free TFTP server for Windows can be obtained from http://tftpd32.jounin.net/.
Once you have installed and are running the TFTP server, you will need to go into the Settings (using the obvious button) and change the Base Directory to the directory in which your IOS image resides. Once you have done this and restarted the TFTP server application, you are ready to use it.
Now ensure that at least one EthernetWikipedia: Ethernet pron.: /ˈiːθərnɛt/ is a family of computer networking technologies for local area networks (LANs). Ethernet was commercially introduced in 1980 and standardized in 1985 as IEEE 802.3. Et... port of your Cisco device is connected to the same network as the PC running TFTP and log into the console of your router.
Now you must, if you have not done so already, assign an appropriate IP address to the network interface on the Cisco device. For my examples, I am using a Cisco 2610 router which labels its only Ethernet port as Ethernet0/0.
To assign an IP address, you would do the following. The bold bits are the bits that you type:
Enter configuration commands, one per line. End with CNTL/Z.
00:04:03: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
00:04:04: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state
router-2610-1(config-if)#ip address 10.0.0.253 255.255.255.0
This assigns the IP address 10.0.0.253 to Ethernet0/0 with a subnet mask of 255.255.255.0.
The device should now be pingable from your TFTP host machine:
Pinging 10.0.0.253 with 32 bytes of data:
Reply from 10.0.0.253: bytes=32 time=7ms TTL=255
Reply from 10.0.0.253: bytes=32 time=5ms TTL=255
Reply from 10.0.0.253: bytes=32 time=4ms TTL=255
Reply from 10.0.0.253: bytes=32 time=5ms TTL=255
Ping statistics for 10.0.0.253:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 7ms, Average = 5ms
Now you can copy the IOS image to your flash from the TFTP server. In my example below, I am copying the image c2600-i-mz.123-19a.bin from the TFTP server at 10.0.0.5 to flash. The bold bits are the bits that you type, <Hit Enter> is an instruction:
router-2610-1#copy tftp: flash:
Address or name of remote host ? 10.0.0.5
Source filename ? c2600-i-mz.123-19a.bin
Destination filename [c2600-i-mz.123-19a.bin]? c2600-i-mz.123-19a.bin
Erase flash: before copying? [confirm] <Hit Enter>
Erasing the flash filesystem will remove all files! Continue? [confirm] <Hit Enter>
Erasing device… eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee …erased
Erase of flash: complete
Loading c2600-i-mz.123-19a.bin from 10.0.0.5 (via Ethernet0/0): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! etc. etc.
[OK - 7738476 bytes]
Verifying checksum… OK (0x213C)
7738476 bytes copied in 68.568 secs (112858 bytes/sec)
Now you can reload your router:
System configuration has been modified. Save? [yes/no]: no
Proceed with reload? [confirm] <Hit Enter>
Your router should now reboot and will hopefully show your new IOS as running when you type show ver on the console.
This is a really useful tip, and it has infinite uses in a *nix environment. You can pipe data over SSH, from both a client and a server, and process it on the other side. This is pretty useful as it avoids the requirement to have the hard disk space to store a file before it is imported. Here’s a few examples:
Copying a remote database to a local database
- ssh firstname.lastname@example.org 'mysqldump -u root --password=passwordhere remote-database-name-here | gzip -c' | gunzip | mysql -u root --password=passwordhere local-database-name-here
Copying a folder of files to a remote server
- cd /path/to/dir/to/copy;
- tar -cz . | ssh email@example.com 'tar -C /path/to/remote/dir -xzv'
The two examples above have shown you using ssh on the left and right of the command. There’s plenty of other uses, see what you can do with it.
It’s mighty dull but pretty tricky to find on the travesty that is the Council’s website. First you’ll need to go to http://www.rugby.gov.uk/site/custom_scripts/wcsc.php. Enter you postcode or street name and hit Go. It’ll tell you when your next collection is and for which bins it is. Now you’ll have to work out whether you’re covered by the ‘Week 1′ calendar or the ‘Week 2′ calendar. Download both and see, on which, does the next collection match up with what the above calculator told you. These are available below, as PDFs.
Tcpdump is a useful tool to capture network packets on a Linux, UNIX, BSD, etc. system. It is nice, however, to be able to see its output in a graphical UI. Wireshark can be used to view capture files created by Tcpdump, if you use the right parameters on the tcpdump command. Run tcpdump as follows:
- tcpdump -s 65535 -w /path/to/file.cap
Download the .cap to your computer and import it into Wireshark.
You can also pass filters into tcpdump to get a smaller cap file. The below captures only port 80 (http traffic):
- tcpdump -s 65535 -w /path/to/file.cap 'src port 80 || dst port 80'
Based on Google’s (stolen) life expectancy data we made a (piss poor) attempt to work out when we were going to die. I say that it was a piss poor attempt because it’s probably really inaccurate. Graphing the data suggests it had a near perfect polynomial, of power 2, trend. However, this gave a silly life expectancy (about 111 for me) and we felt that if we had more than 49 years’ of data to work with, it wouldn’t be polynomial. As such, I opted for the next closest – exponential.
A link to an Excel spreadsheet that calculates this is below. The data that is in the “CONFIG” bit is my age and UK mixed gender data taken from the above link. I should probably clarify that by “mixed gender”, I mean male and female combined – I sadly couldn’t find accurate statistics on the life expectancy of hermaphrodites. Change the config to match your own data. Seems I’m going to die at the ripe old age of 96. Sounds good to me
If you’re currently thinking something along the lines of “OMfuckingG! This is so inaccurate”… you’re probably missing the point.
Here’s a graph of it, for shits ‘n’ giggles: