Sunday, July 3, 2011

Cisco Catalyst 2960 switch IOS recovery


Sometimes in my lab happens that students delete IOS of the switch from its flash. Unfortunately switches does not have rommon to realize quick IOS recovery over tftp. Only one way is over Xmodem.

Cat 2960 switchIOS recovery

To speed up the process of the recovery we may setup Xmodem speed to higher rate as default 9600 bits:
Set the speed rate to 115200 baud on the switch prompt of the switch:
switch: set BAUD 115200
Of course we lose our console session and therefore we need to restart it with the correct speed settings. Then  we may realize the recovery.
Enter copy command:
copy xmodem: flash:filename
for our Cat2960-24TTL:
switch:copy xmodem: flash:c2960-lanbasek9-mz.122-52.SE.bin
Begin the Xmodem or Xmodem-1K transfer now...
CCC
and start sending of the file over console Xmodem software.

Recovery over HyperTerminal

Choose Transfer > Send File.
 
and than we choose as protocol the Xmodem and in filename click Browse and select the Cisco IOS image (.bin file) from the disk to be uploaded.
and click Send to send the file,

Recovery over Putty

Putty does not support Xmodem protocol, tears.

Final steps

To boot the new image that we just copied over with the Xmodem procedure issue the boot flash:filename command, as the example shows:
switch: boot flash:c2960-lanbasek9-mz.122-52.SE.bin
After the Xmodem recovery, we set the BAUD rate back to 9600. If the set BAUD 9600 command does not bring the baud rate to 9600, issue the unset BAUD command in order to bring the baud rate to a default value of 9600 bps.

Saturday, July 2, 2011

Connect Vmware VM 2 GNS3 Lab

1. Select network adapter "Host only" to your Virtual machine in Vmware 
2. Check from Windows Network connections how this network adapter (vmnet1) is named.
3. Add cloud to your workspace in GNS3
4. Configure cloud and select the network adapter you just checked from Windows Network connections menu.

  • Right Click cloud and select Configure
  • Select your cloud C0
  • Select NIO Ethernet
  • Select Generic Ethernet NIO
  • Select appropriate adapter from drop-down menu and press Add button

5. Connect cloud to your topology. (For example to router)
6. Assing IP addresses from same subnet to the Virtual Machine and to emulated router in GNS3.
7. Ping between router and virtual machine should be successful.

Tuesday, June 28, 2011

Configure the Native VLAN on Both Side Of The Trunk


Be sure to remember to configure the native VLAN on both sides of the trunk link or you will get this error until you do so (or disable CDP):

*Mar  1 01:35:01: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/13 (1), with sw1 FastEthernet0/13 (10).
They come in once every minute (CDP updates go every 60 seconds by default):
*Mar  1 01:38:01: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/13 (1), with sw1 FastEthernet0/13 (10).
*Mar  1 01:39:01: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/13 (1), with sw1 FastEthernet0/13 (10).
*Mar  1 01:40:01: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on FastEthernet0/13 (1), with sw1 FastEthernet0/13 (10).
sw2(config-if)#do sh cdp
Global CDP information:
        Sending CDP packets every 60 seconds
        Sending a holdtime value of 180 seconds
        Sending CDPv2 advertisements is  enabled
What happens if you disable CDP?  Will you still get the error?
sw1:
sw1(config)#do sh run int fa0/13
Building configuration…
Current configuration : 128 bytes
!
interface FastEthernet0/13
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 10
 switchport mode trunk
end
sw2:
sw2(config-if)#do sh run int fa0/13
Building configuration…
Current configuration : 110 bytes
!
interface FastEthernet0/13
 switchport trunk encapsulation dot1q
 switchport mode trunk
 no cdp enableend
***
sw1#sh int fa0/13 trunk
Port        Mode         Encapsulation  Status        Native vlan
Fa0/13      on           802.1q         trunking      10
sw1#sh int fa0/13 switch | i Native VLAN
Administrative Native VLAN tagging: enabled
sw1#sh cdp int fa0/13
FastEthernet0/13 is up, line protocol is up
  Encapsulation ARPA
  Sending CDP packets every 60 seconds  Holdtime is 180 seconds
sw2#sh int fa0/13 trunk
Port        Mode         Encapsulation  Status        Native vlan
Fa0/13      on           802.1q         trunking      1
sw2#sh int fa0/13 switch | i Native VLAN
Administrative Native VLAN tagging: enabled
sw2#sh cdp int fa0/13
[Note: No output because we've disabled CDP]sw2#
It’s been a few minutes and no alarms(on either switch):
*Mar  1 01:42:14: %SYS-5-CONFIG_I: Configured from console by console
sw1#sh clo
*01:48:09.468 UTC Mon Mar 1 1993
*Mar  1 01:41:51: %SYS-5-CONFIG_I: Configured from console by console
sw2#sh clo
*01:45:09.826 UTC Mon Mar 1 1993
Another good reason to run CDP.  

Sunday, May 29, 2011

Configuring a Trunk Port


          The Enterprise Edition Software, Cisco IOS Release 11.2(8)SA6, does not support trunk negotiation via the Dynamic   Trunk Protocol (DTP), formerly known as Dynamic ISL (DISL). If you are connecting a trunk port to a Catalyst 5000 switch or other DTP device, use the non-negotiate option on the DTP-capable device to configure the switch port to not generate DTP frames.

This example shows how to configure a port as a trunk, verify the trunk configuration, and save the change to the startup configuration file:
Switch# configure terminal

Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)# interface fa0/1

Switch(config-if)# switchport mode trunk

Switch(config-if)# switchport trunk encapsulation isl

Switch(config-if)# end

Switch# show interface fa0/1 switchport

Name: Fa0/1
Switchport: Enabled

Administrative mode: trunk

Operational Mode: trunk
Administrative Trunking Encapsulation: isl

Operational Trunking Encapsulation: isl

Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: 1-3,1002-1005
Trunking VLANs Active: 1-3
Pruning VLANs Enabled: NONE
Switch# copy running-config startup-config

Building configuration...
[OK]
Switch#

Monday, February 14, 2011

How to disable USB sticks and limit access to USB storage devices on Windows systems


USB storage - a possible security risk?

Decent IT administrators secure their networks behind firewalls. They install mail filters on their SMTP servers and deploy anti-virus software on all client workstations. But securing the network is not sufficient -- what happens if the users bring their own USB memory sticks and connect them to the computers at their office? A 1 Gb USB stick can sometimes hold an entire company's vital data. Within minutes or even seconds an employee has all the files they need in order to start up their own business and take all the customers with them. Alternatively, what happens if a careless user accidentally compromises the network with an infected USB stick?

What does Microsoft have to say about it?

If you, the administrator, want to establish a minimum level of security, it is absolutely necessary to control which users can connect USB memory sticks to a computer. Unfortunately, a default Windows XP or Windows 2000 installation comes with no limitations on who is able to install and use USB storage media. Microsoft knowledge base article 823732 contains instructions on how to disable USB storage access for a certain group of users; however, the article only distinguishes between whether or not a USB storage device has been installed on a particular computer. Furthermore, the instructions are limited to a stand-alone computer. According to the general rule of thumb "If it's tedious, there is a better way", I try to avoid techniques that force me to repeat certain tasks for each computer that I manage. That's what group policy objects (GPO) are for.

Suggestions?

Mark Heitbrink describes how to disable USB storage devices entirely on all or some computers in the network. He employs an ADM template in a group policy object that disables the USB storage driver (USBSTOR). The ADM template simply sets the registry valueHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor\Start to 4 (Disable). But his technique has a serious drawback. It only works if the USB storage driver is already installed. If it has not yet been installed, Windows' plug & play subsystem automatically resets the Start value to 3 (Manual) when it installs USBSTOR after a USB storage device is plugged in for the first time. In that case, USBSTOR remains enabled until the GPO is re-applied, usually at the next reboot. If the storage device is plugged in during that reboot, it will still be available because the USBSTOR driver is started before any GPOs are processed.

The Howto!

If we combine Mark Heitbrink's approach with the one outlined in knowledge base article 823732, we get a more reliable solution. Firstly, we need to prevent USBSTOR from being installed unless the currently logged on user is allowed to use USB storage. We do that by restricting access toUSBSTOR.INF and USBSTORE.PNF in a GPO such that PNP can't automatically install the driver. This is possible because when PNP installs a driver, the installation is performed using the priviledges of the currently logged on user. Secondly, we need to make sure that USBSTOR is not started when a USB storage device is plugged in. For that we use Mark's ADM template. The only minor drawback of my solution is that users with access to USB storage need to manually start USBSTOR before connecting USB storage devices.
  1. In Active Directory Users and Computers, open an existing GPO or create a new one and open it. Use the security settings of that GPO to specify which computers it affects.
  2. In that GPO, go to Computer Configuration – Windows Settings – Security Settings – File System and create a new entry (right-click File System and select Add File). Specify the location of USBSTOR.INF (usually SystemRoot%\Inf\USBSTOR.INF)
  3. Change the security settings of the new entry. The security settings that you specify here will be enforced on the USBSTOR.INF of every computer to which the GPO is applied. This process is not additive, which means that the previous security settings ofUSBSTOR.INF will be overwritten by the ones given in the GPO. It is therefore recommended to grant full control to SYSTEM and local administrators. But unlike in the default security settings of USBSTOR.INF, you should not grant any priviledges to Everybody. You do not need to explicitly deny access – just omit an entry for Everybody. Optionally, you can grant read access to a certain group. Members of this group will be able to use USB storage.
  4. Repeat the above two steps for USBSTOR.PNF.
  5. Download USBSTOR.ADM.
  6. Back in the GPO, right-click Administrative Templates under Computer Configuration and select Add/Remove Templates. Click Add and browse to the location of USBSTOR.ADM. Close the dialog.
  7. You should now have an additional entry called Services and Drivers in Administrative Templates. Click on it. If it is empty, select View from the menu and uncheck Show Policies Only. Click back on Services and Drivers in Administrative Templates. It should now show the USB Storage policy. Double click it, select Enabled and pick Disabled from the Startup Type drop down. Again, the policy must be enabled wheras Startup Type must be Disabled.
  8. Close the dialog as well as the GPO and boot/reboot one of your workstations. Make sure no USB strorage device is connected to that computer. Log on with administrative privileges and check the permissions of USBSTOR.INF and USBSTOR.PNF. Check the value of theHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor\Start. It should be 4. It is also ok if the UsbStor key doesn't exist at all.
  9. On the same workstation, log off and back on as a user that should not have access to USB storage. Connect a USB memory stick or a similar device. Nothing should happen. Remove the memory stick.
  10. Log on as a user that should have access to USB storage and execute net start usbstorin a command shell or at Start – Run before connecting the memory stick. The memory stick should initialized and mapped to a drive letter. If USBSTOR fails to start, it's probably because this is the first time a memory stick is plugged into the workstation in which case USBSTOR is not yet installed. Nevertheless, the memory stick should be initialized and mapped correctly but you need to reboot in order to reapply the administrative template such that USBSTOR is disabled again. Alternatively, you can disable it manually by downloading and double clicking USBSTOR.REG as well as executing net stop usbstor.
  11. Instruct the users with access to USB storage that they need to execute net start usbstor before they can connect a USB storage device.
AttachmentSize
usbstore.adm530 bytes
usbstore.reg258 bytes
( categories: Windows | Administrator )
Submitted by Hannes Schmidt on Fri, 10/15/2010 - 10:57.
Thanks! -- Hannes
Submitted by Anonymous on Tue, 10/12/2010 - 17:00.
It seems Microsoft has changed this for Windows 7... and almost none of the sites with instructions have been updated to include the new 7-specific instructions (the old method--even for Vista--didn't work in 7). Here are the new GPO settings you also need to use if you have Windows 7 clients:
Block USB in Windows 7 using Group Policy
Computer Configuration > Policies > Administrative Templates > System > Removable Storage Access
Removable Disks: Deny execute access    Enabled
Removable Disks: Deny read access       Enabled
Removable Disks: Deny write access      Enabled

Saturday, February 5, 2011

P2P file sharing: Know the risks


Peer-to-peer (P2P) file sharing is a convenient way to share public-domain music, audio, images, documents, and software programs over the Internet.
Using P2P, you can store files on your computer and go online to search for and share files with others using the same software; programs such as BitTorrent, Morpheus, Kazaa, LimeWire, and iMesh, among many others.
It's a good idea to understand and anticipate the risks of P2P file sharing before you download your first file.
Risk #1: Exposing your computer to unwanted software
Shared files can contain security risks such as virusesspyware, and other unwanted software. A file that appears legitimate could be a virus in disguise. Unwary file sharers can download beneficial software that incorporates undisclosed spyware with it.
You can help prevent these dangers by following these steps:
Risk #2: Breaking copyright laws
Reputable P2P software is legal to use, but if you choose to do so, it's important to understand and differentiate between copyrighted and public domain material and to share responsibly.
When in doubt about a given file, it's best not to share or download it.

Tips for file sharing more safely

  • Monitor family P2P use and don't assume that using an Internet filter will protect your family from accessing or downloading unwanted or illegal material.

    Because most Internet filters cannot block P2P file sharing, it's important to set guidelines and ensure that all family members are educated about illegal file sharing.
  • Treat all downloaded files with suspicion and use updated industry standard antivirus software to scan each new file before you click it. Set your antivirus software to automatically scan your hard disk on a regular basis, or do it manually yourself.
  • Delete any pirated material found on a family computer, digital audio player, CD-ROM disc, or other storage device and consider disabling the P2P software's downloading option or blocking outside access to the program by changing your computer's Internet firewall settings.
  • Learn all you can about your P2P software and be very careful about which files you make available to others. Most P2P shared files are typically stored in a single folder on your computer (often named "Shared Files").
  • Do not store copies of copyrighted files that you have legally purchased, such as songs from a CD or a licensed retail music site in your P2P file-sharing folder.
  • Back up important files on an external storage device or a CD-ROM disc before sharing or downloading files.
  • For more information about P2P file sharing, visit the Electronic Frontier Foundation and theRecording Industry Association of America (RIAA).

How to better protect your PC with botnet protection and avoid malware


How to better protect your PC with botnet protection and avoid malware


Cybercriminals work tirelessly to enlist your computer in their network of computers known as abotnet, which they then use to commit crimes. Find out more about botnets, botnet protection, and how you can help protect your PC against these attackers.

What is a botnet?

The term bot is short for robot. Criminals distribute malware (malicious software) that can turn your computer into a bot, also called a zombie. When this occurs, your computer can perform automated tasks over the Internet without your knowledge.
Criminals typically use bots to infect large numbers of computers. These computers form a network, or a botnet.
Botnets can be used to send out spam email messages, spread viruses, attack computers and servers, and commit other kinds of crime and fraud. If your computer becomes part of a botnet, it might slow down and you might be inadvertently helping criminals.

How to tell if your computer is infected with malware

It's not always easy to tell if your computer has been infected with malware. If it is unusually slow, crashes or stops responding frequently, for example, these problems might be signs that your computer has been infected. However, the same problems might also point to hardware or software issues that have nothing to do with malware. Because it's difficult to tell the reasons for your computer's unusual behavior, we suggest that you follow these steps:
  1. Get a more complete list of symptoms.
  2. If, based on the complete list of symptoms, you think your computer has been infected, let Microsoft help you diagnose the problem and solve it.

How to help avoid malware

Cybercriminals use two basic strategies to penetrate your computer's defenses and enlist computers in their botnets:
  • They install malware on a computer by taking advantage of unintended vulnerabilities in its software or by breaking into accounts guarded by weak passwords.
  • They try to trick you into installing their malware.
To help secure your computer against bots, follow the advice below. For specific how-to info, seeHow to boost your malware defense and protect your PC.

Strengthen your computer's defenses

  1. Install antivirus and antispyware programs from a trusted source. Anti-malware programs scan and monitor your computer for known viruses and spyware. When they find something, they warn you and help you take action.
  2. Keep all software up to date. Regularly install updates for all your software and subscribe to automatic updates wherever possible.
  3. Use strong passwords and keep them secret. Use our password checker to determine the strength of your password.
  4. Never turn off your firewall. A firewall puts a protective barrier between your computer and the Internet. Turning it off for even a minute increases the risk that your PC will be infected with malware.
  5. Use flash drives cautiously. Putting your flash drive (sometimes called a thumb drive) in a computer that is infected could corrupt the drive, and ultimately your computer.

Do not be tricked into downloading malware

Attackers can enlist your computer in a botnet by:
  • Delivering malware in downloads that you think are pictures or movies, or through links that you click in email or instant messages (IM), or on a social network.
  • Scaring you into clicking a button or link they supply with fake warnings that your computer has a virus.
Botnet in action
Click on the Image to Enlarge

The Shift - Traditional vs. AI-Based Computing - CPU to GPU

  The Shift - Traditional vs. AI-Based Computing Computing has evolved significantly over the years, with a notable shift from traditional m...