Sunday, May 30, 2010

Enabling NetFlow on a Cisco Catalyst 6500 Switch


NetFlow can be enabled on Catalyst 6500 Switches with a Supervisor Engine 32, RSP 720 or a Supervisor Engine 720. NetFlow cache on the Multilayer Switch Feature Card (MSFC) captures statistics for flows routed in software and the NetFlow cache on the Policy Feature Card (PFC) captures statistics for flows routed in hardware. The configuration of Netflow neither disrupts the traffic nor disables the configured interface.


To start first install NetFlow Analyzer (or similar tool) on your PC so that your PC becomes a NetFlow Collector. Do note the port number (e.g.: 9996) used by you NetFlow Analyzer Application. With the data obtained NetFlow Collectors can generate reports and statistics of traffic flowing through the switch or router.


Next on the Catalyst 6500 configure NetFlow to enable NetFlow on both the MSFC and PFC, so that it can send the Netflow information to the NetFlow Collector. You also need to configure the NetFlow Data Export (NDE) on the switch in order to export the NetFlow statistics to the NetFlow collector. Assuming the NetFlow Collector IP Address is 172.16.16.1, the following configuration has to be made


ip flow-export destination 172.16.16.1 9996

ip flow-export source Loopback 0

ip flow-export version 5


To avoid spikes in the traffic report, use the ip flow-cache time active N command (where N can be from 1 to 60 minutes). The default is 30 minutes, which can lead to having spikes in your traffic report. It is important to set this value to 1 minute to generate alerts and view troubleshooting data.


ip flow-cache timeout active 1


On interfaces that need to be monitored, enter the ip route-cache command. Enabling ip route-cache on the interface enables NetFlow on the MFSC. On 6500 12.2SXH Release, NetFlow is enable on the Layer 3 interface using ip flow ingress command on the interface.


To enable NetFlow & NDE for Layer 2


interface vlan 10

ip route-cache

!

interace GigabitEthernet 1/1

ip route-cache


To enable NetFlow on the PFC, enter the mls netflow command and to configure flow mask on the PFC, configure mls flow ip interface-full. Apply ip flow ingress layer2-switched vlan 10,20 command to enables NetFlow and NDE for Layer 2-switched traffic (for ingress-bridged traffic) on the PFC. Should note that NetFlow does not show statistics of traffic that goes across the same VLAN and hence cannot be configured on a layer 2 interface.


Once configured, the interfaces in the NetFlow tool will be shown as ifindex instead of the actual interface name. To obtain the actual interface names the NetFlow tool will have to pull it from the switch SNMP MIB values, therefore you will have to configure SNMP on the NetFlow Collector as well as on the Catalyst 6500 Switch.


access-list 99 permit 172.16.16.1

!

snmp-server group GRPName v3 auth

snmp-server user snmp_username GRPName v3 auth md5 user_authpwd

snmp-server user snmp_username GRPName remote 172.16.16.1 v3 auth md5 user_authpwd access 99

snmp-server host 172.16.16.1 traps version 3 auth snmp_username

Monday, May 24, 2010

Decrypting Cisco Device Login Passwords

If your router or switch has been globally configured with the service password-encryption command, the passwords in the configuration will be encrypted for secrecy. In dire cases we would like to retrieve this password and that is when this procedure using the key chain command can be of great help. For this to work you have to be already logged into the device of which you are decrypting the password and you should have the authorization to execute these commands.

Key chains are typically used in EIGRP and RIPv2 routing protocols for authentication. A key chain can have number of keys and each key will have a key string associated with it.

Switch(config)#key chain CRACK
Switch(config-keychain)#do sh run | inc Admin
username Admin privilege 15 password 7 107E290A1600421908
Switch(config-keychain)#key 1
Switch(config-keychain-key)#key-string 7 107E290A1600421908
Switch(config-keychain-key)#exit
Switch#sh key chain CRACK
Key-chain CRACK:
key 1 -- text "P@ssw0rd"
accept lifetime (always valid) - (always valid) [valid now]
send lifetime (always valid) - (always valid) [valid now]

You can also decrypt the enable, line vty and console passwords using this method. However this method cannot be used to decrypt passwords which have been configured using the secret command (e.g: enable secret password or username username secret password ) as they use the more secure MD5 encryption. Considering the Security implication it is adviced to apply the enable secret password command and use TACACS+ or RADIUS for authentication. Using Cisco ACS you can block non-privileged administrators from using key chain command.

Monday, March 1, 2010

Obtaining the pre-shared key used for VPN on an ASA

Usually the pre-shared key for a VPN configuration is encrypted and can be only seen as a * when you do a show run.

tunnel-group USERVPN ipsec-attributes
pre-shared-key *

If you want to see the pre-shared key that has been configured on an ASA, type

more system:running-config

Thursday, August 13, 2009

IOS Upgrade on 3750 Switch Stack

A Switch Stack is a group of individual switches stacked together (connected together using Stack cables) to form a single larger switch. The complication of upgrading the IOS on a 3750 Switch Stack is that the IOS has to be upgraded on all the switches in the stack and the IOS has to be the same on each individual 3750 switch in the stack. Use the show stack or show switch commands to determine the Master switch and how many switches form the stack.

A telnet access to the Stack Switch will give access to only the Master Switch in the Stack, thereafter a normal copy tftp: flash: command will only copy the IOS from the TFTP to the flash on the Master switch but not the other slave switches in the stack. The flash memory on each switch in the stack can be accessed separately, for eg; flash1: is the flash of switch1, flash2: is the flash of switch2.....etc., therefore you can do

SW# copy tftp: flash1:
SW# copy tftp: flash2:
....

to copy the IOS from TFTP to the flash memory in each switch. If you have already a copy of IOS on one flash, you can use copy flash1: flash2: to copy the IOS from one flash to another. Finally to instruct the stacked switch to boot the same IOS from all the individual switches

SW(config)# boot system switch all flash:c3750e-universalk9-mz.122-44.SE2.bin

Saturday, August 8, 2009

Google Eula Launcher Issue

If you have an annoying "Google end user license agreement" window pop-up each time you log into Windows, then keep reading! This usually happens after you install a Google product and instrestingly it wont go even if you uninstall it. It is caused by Google Eula Launcher running at startup of Windows login. To get rid of this, follow these steps:

* Click on Start
* Type regedit inside the Start Search box
* Go to Computer/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/
Currentversion/Run/
* Find the RegKey that has GoogleEULALauncher.exe
* Right click and select Delete
* close regedit and reboot the system, the problem should not appear again.

PS: Before you reboot, delete any GoogleEULALauncher.exe file that might be present on your hard disk aswell.

Friday, August 7, 2009

Checking the DFC Memory on a Catalyst 6500 Line Card

For checking the available memory on a line card, for example a WS-X6704-10GE card inserted in a Catalyst 6500 switch, first you have to attach to the DFC (Distributed Forward Card) on the line card. (Use the show module command to see the sub-modules you have on your 6500 chassis, this will also show the DFC's in each slot)

CoreSW# attach 8

where 8 is the slot number in which the line card is inserted.

CoreSW-DFC8# show version

....
cisco Catalyst 6000 (SB1121) processor with 1048576K bytes of memory
....

show version will show you the memory on the DFC. This command is useful especially when you change the DFC (DFC3A, DFC3B, DFC3BXL....etc.,) on your line card. It is recommended that the memory on the DFC on any line card in the 6500 chassis should match the RP memory in Sup720.

Wednesday, August 5, 2009

Speedy Catalyst Switch IOS Crash Recovery

If your Cisco Catalyst Switch have boot errors, i.e., the switch is continuously booting or if it shows an error while booting and goes to the switch: prompt then its pretty obvious that you have an IOS crash. Catalyst Switches do not go to a rommon mode and hence TFTP upload in rommon is not possible on a switch. Therefore we have to resort to transferring the IOS image from your PC to the Switch through the console cable using Xmodem.

You can avail the Xmodem feature of Windows Hyperterminal. Open your Hyperterminal Application and set the baud rate to 9600 to access the switch console via your COM port. If your switch is already not at the switch: prompt, unplug the cord of the switch and power it back on as you press on the MODE button. Release the MODE button after the STAT LED goes out. Now you will be at the switch: prompt. Since downloading at a baud rate of 9600 is very very slow (can take more than 3 1/2 hours), therefore the best solution is to set the baud rate to 115200.

switch: set BAUD 115200

Now close your Hyperterminal Application and reopen it with a baud rate of 115200 for your COM port. Enter the command flash_init and load_helper. Issue the command to transfer the image at the prompt.

switch: copy xmodem: flash:c3750-ipbasek9-mz.122-50.SE3.bin

From the top of the Hyperterminal window, choose Transfer > Send File and from the Send File pop-up window browse the location of the correct IOS image and from the Protocol drop down list select Xmodem and click Send. Now the IOS image will start downloading to your switch which can take nearly half an hour, which is not that bad. Once the download in complete revert back to the baud rate of 9600.

switch: set BAUD 9600

Close your Hyperterminal Application again and reopen it with a baud rate of 9600. Issue the command to boot the image from flash.

switch: boot flash:c3750-ipbasek9-mz.122-50.SE3.bin