www.howtonetwork.org

CCNA & CCNP Certifcation Training

  • About
  • Contact
  • FAQ
  • Join
  • Home
  • CCNA
    • ICND1
    • ICND2
    • 101 CCNA LABS
  • CCNP
    • ROUTE
    • SWITCH
    • TSHOOT
    • 101 CCNP LABS
  • CompTIA
    • Security+
    • Network+
  • Design
    • CCDA
    • CCDP
You are here: Home / ICND1 / Day 4 – Router and Switch Security / Day 4 Labs / Basic Switch Security Lab

Basic Switch Security Lab

Topology

Topology

Please note that your switch will need to have a security image which permits basic security settings.

Purpose

Learn how to apply basic security settings to a Cisco switch.

Walkthrough

  1. Connect a PC or laptop to your switch. In addition, set up a console connection for your configuration. The port to which you connect your PC will be the one you configure security settings on in this lab. I have chosen FastEthernet 0/1 on my switch.
  2. Log in to the vty lines and set up Telnet access referring to a local username and password.

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#line vty 0 ?

<1-15>  Last Line number

<cr>

Switch(config)#line vty 0 15

Switch(config-line)#?

Switch(config-line)#login local

Switch(config-line)#exit

Switch(config)#username in60days password cisco

Switch(config)#

  1. Add an IP address to VLAN 1 on the switch (all ports are in VLAN 1 automatically). Additionally, add the IP address 192.168.1.1 to your PC’s FastEthernet interface.

Switch(config)#interface vlan1

Switch(config-if)#ip address 192.168.1.2 255.255.255.0

Switch(config-if)#no shut

%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up

Switch(config-if)#^Z ← press Ctrl+Z keys

Switch#

Switch#ping 192.168.1.1 ← test connection from switch to PC

 

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 31/31/32 ms

 

Switch#

  1. Test Telnet by Telnetting from your PC to your switch.

 Command Prompt

 

  1. Your IT manager changes his mind and wants only SSH access, so change this on your vty lines. Only certain models and IOS versions will support the SSH command.

Switch(config)#line vty 0 15

Switch(config-line)#transport input ssh

  1. Now Telnet from your PC to the switch. Because only SSH is permitted, the connection should fail.

 

 Command Prompt

 

  1. Set port security on your switch for the FastEthernet port. It will fail if you have not hard set the port to access (as opposed to dynamic or trunk).

Switch(config)#interface FastEthernet0/1

Switch(config-if)#switchport port-security

Command rejected: FastEthernet0/1 is a dynamic port.

Switch(config-if)#switchport mode access

Switch(config-if)#switchport port-security

Switch(config-if)#

  1. Hard set the mac address from your PC to be permitted on this port. You can check this with the ipconfig/all command on your PC command line. Then check the port security status and settings.

Switch(config-if)#switchport port-security mac-address 0001.C7DD.CB18

Switch(config-if)#^Z

Switch#show port-security int FastEthernet0/1

Port Security              : Enabled

Port Status                : Secure-up

Violation Mode             : Shutdown

Aging Time                 : 0 mins

Aging Type                 : Absolute

SecureStatic Address Aging : Disabled

Maximum MAC Addresses      : 1

Total MAC Addresses        : 1

Configured MAC Addresses   : 0

Sticky MAC Addresses       : 0

Last Source Address:Vlan   : 0001.C7DD.CB18:1

Security Violation Count   : 0

  1. Change the mac address on your PC, or if you can’t do this, plug another device into the switch port. This should make the port shut down due to a breach in the security settings. The screenshot below shows where you would change the mac address in Packet Tracer.

 

FastEthernet

 

  1. You should see your FastEthernet port go down immediately.

Switch#

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down

Switch#

%SYS-5-CONFIG_I: Configured from console by console

Switch#show port-security interface FastEthernet0/1

Port Security              : Enabled

Port Status                : Secure-shutdown

Violation Mode             : Shutdown

Aging Time                 : 0 mins

Aging Type                 : Absolute

SecureStatic Address Aging : Disabled

Maximum MAC Addresses      : 1

Total MAC Addresses        : 0

Configured MAC Addresses   : 0

Sticky MAC Addresses       : 0

Last Source Address:Vlan   : 0001.C7DD.CB19:1

Security Violation Count   : 1

Note: Please repeat this lab until you understand the commands and can type them without looking at the Walkthrough section (and do the same for all the other labs in this book).

 

Prev

About Us

This is a free bonus site for members of www.howtonetwork.com

Copyright

The content on this copyright Reality Press Ltd.
Copyright Reality Press Ltd.