Set the telnet source IP address for a Cisco router

The default source IP address when telnetting from a Cisco router is that of the interface closest to the destination. Because some access lists may block traffic from the default IP address, or to help test access lists, it may be useful to temporarily or permanently set the telnet source IP address.


To temporarily set the telnet source IP address for a single telnet session, use the/source-interface extension to the telnet command. For example, to telnet to 192.168.1.4 using the source IP address of the interface FastEthernet0

telnet 192.168.1.4 /source-interface FastEthernet0

To set this interface as the source IP address for all telnet sesions, use this command in configuration mode (conf t):

ip source-interface fastethernet0


Set the time on a Cisco router manually

To set the time, use this command in enable mode (not configuration mode):

Router# clock set 22:55:05 June 19 2006

The time is in 24 hour mode. To see the information about the clock settings, use:

Router# show clock detail
22:56:07.136 PDT Mon Jun 19 2006
Time source is user configuration

This will show the current date and time and the source of the time configuration (in this case showing that the time was manually set).


Configure Cisco router to set time from NTP server

Using NTP to synchronize the date and time of multiple devices makes sense even in a small network. When performing forensic analyses or troubleshooting connection problems, having consistent logging timestamps from multiple devices can save your life. Well, at least help keep your hair attached to your head.


To configure a router to use the NTP server 192.168.1.15, issue these commands from enable mode:

Router# conf t
Router# ntp server 192.168.1.15

Multiple ntp server lines can be used for redundancy. By default, the router will use UTC as the time zone. To set the time zone to PST and add a second ntp server at 172.32.10.55, use these commands instead:

Router# conf t
Router# ntp server 192.168.1.15
Router# ntp server 172.32.10.55
Router# clock timezone PST -8


Configure Cisco router as an NTP server

An NTP server can provide synchronized date and times for devices in a network. Since a router cannot be a Stratum 1 device (cannot connect to a Stratum 0 device such as a GPS clock), a router is not an accurate source of time information. If this is not important to you, then using a router as an NTP server may be acceptable.


To configure the router to work as an NTP server, use the following command in configuration mode (following a conf t):

ntp master 8

The 8 specifies the stratum of this NTP server, essentially the number of hops away from a Stratum 0 device. The default value is 8.


Cisco Switch 2900/2950: Display VLAN information

Knowing the commands to display configuration information about Virtual LANs (VLANs) is as important as knowing the commands to configure them. The commands here display information about all VLANs or a single VLAN by number or name.


All of these commands must be run from privileged mode. To view detailed information about all VLANs on the local switch, use:

# show vlan

To shorten the output and just display the highlights about all of the VLANs:

# show vlan brief

To display information about VLAN 3, use:

# show vlan id 3

This version of the command can be extended to look at multiple VLANs. For example, to view information about VLANs 1, 2, 3 and 10, use:

# show vlan id 1-3,10

For increased administratability, VLANs can be named. To view information about a VLAN by name, for instance the VLAN named ‘engineering’ use this command:

# show vlan name engineering


Cisco 2950 switch password recovery

This documents the procedure for performing a password recovery on a Cisco 2950 switch (and probably other models, as well).

1. Unplug the power cable

2. Hold down the mode button while replugging the power cable

3. Type flash_init over the console

4. Type load_helper

5. Type Dir flash :
//make sure to type the semi-colons

6. Type rename flash:config.txt flash:config.old
//the password is contained in the config.txt file

7. Type boot
//this reboots the system

8. Type n to skip the initial setup configuration

9. Type enable
//this takes you to the enable mode

10. Type rename flash:config.old flash:config.txt

11. Save config.txt to system
#copy flash:config.txt system:running-config

12. Enter config mode and change the password
# config t
# no enable secret
//this applies only if the enable secret password was created

13. Finally, write the changes to memory
# write memory


How to convert VMware virtual disks from thin to thick with the vSphere client

Have you ever provisioned a new virtual machine in vSphere, put it in production, and discovered belatedly that you mistakenly used “thin provisioned” virtual disks? This can often happen when deploying from a template which was thin provisioned since the default option is to use the same disk format as the source. Good news! It is quite easy to convert these to thick with the vSphere client and your mouse.

No command line required, as was the case with previous versions of VMware Infrastructure. The only downside is that the virtual machine must be shut down prior to inflating its disk(s).

1. Launch your vSphere client and log in to your vCenter server.

2. Select the virtual machine which has mistakenly been thin provisioned.

3. Select the option to “Shut Down Guest” under Commands. This is a necessary step. If your virtual machine is in production, you will have to schedule some downtime.

4. Right-click the virtual machine and select the Snapshot menu. If you see the option to “Revert to snapshot”, it means that you have at least one snapshot of this virtual machine. I highly recommend that you remove all snapshots by opening Snapshot Manager and selecting Delete All. Please keep in mind that this has its own implications so please understand them before continuing.

4. Look at the Datastore list on the right to see what Datastores your virtual machine is using. Note the free space listed – you must have enough free space to allow the disks to expand to their “provisioned” size or you will cause yourself quite a headache!

5. Now right-click the Datastore and select “Browse Datastore…”

6. Select the folder for your virtual machine on the left, and the contents will show on the right.

7. Look for the file(s) ending in the “.vmdk” extension. These will be labeled “Virtual Disk” under the “Type” header. Note the “Provisioned Size” header and make sure that you have enough free space in this datastore to support your virtual disk(s) growing to consume this space.

8. Finally, to inflate your virtual machine’s disk you simply right-click the .vmdk and select “Inflate”. Depending on the size of the disk and your underlying storage architecture, this may take quite some time.

9. If the virtual machine has more than one virtual disk that needs to be inflated simply repeat step 8.

10. When complete, the inflated virtual disk will be “eager zeroed thick”, which is the highest performing type of virtual disk in vSphere land.