Showing posts with label SWITCH. Show all posts
Showing posts with label SWITCH. Show all posts

05 November, 2014

Disable "Mode" Button on Cisco

! Disable Setup Express
ASW1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
ASW1(config)#no setup express
ASW1(config)#do show run | in express
no setup express

26 October, 2014

VTP Version 3

SW8(config)#vtp version 3

SW8#vtp  primary
This system is becoming primary server for feature vlan
No conflicting VTP3 devices found.
Do you want to continue? [confirm]
*Mar  1 02:27:11.115: %SW_VLAN-4-VTP_PRIMARY_SERVER_CHG: 000f.f72c.c600 has become the primary server for the VLAN VTP feature

SW8(config)#do show vtp status
VTP Version capable             : 1 to 3
VTP version running             : 3
VTP Domain Name                 : cisco
VTP Pruning Mode                : Enabled
VTP Traps Generation            : Disabled
Device ID                       : 000f.f72c.c600

Feature VLAN:
--------------
VTP Operating Mode                : Server
Number of existing VLANs          : 7
Number of existing extended VLANs : 0
Configuration Revision            : 2
Primary ID                        : 0000.0000.0000
Primary Description               :
MD5 digest                        : 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

Feature MST:
--------------
VTP Operating Mode                : Transparent

Feature UNKNOWN:
--------------
VTP Operating Mode                : Transparent

SW8#show vtp status | include Revision|modified
Configuration last modified by 10.10.21.10 at 3-1-93 01:05:27
Configuration Revision            : 37

SW8(config)#vtp password cisco ?
  hidden  Set the VTP password hidden option
  secret  Specify the vtp password in encrypted form
  <cr>

SW8(config)#vtp password cisco
Setting device VTP password to cisco
SW8(config)#do show vtp password
VTP Password: cisco

SW8(config)#vtp password cisco hidden
Setting device VTP password

SW8(config)#do show vtp password
VTP Password: 52C518C46CE6647155DE01304CECA63E

Implement and Troubleshoot Layer 2 Protocols : UDLD

- UDLD (Unidirectional Link Detection)

- Unidirectional Link Detection (UDLD) is one of two major features (UDLD and loop guard) in Cisco Switches to prevent Layer 2 loops.
- Spanning-Tree Protocol (STP) resolves redundant physical topology into a loop-free, tree-like forwarding topology via blocking one or more ports.
However, Unidirectional Link failure can cause " traffic blackholing" and loop in the Switch topology.
- In order to detect the unidirectional links before the forwarding loop is created, UDLD works by exchanging protocol packets between the neighboring devices.
- In order for UDLD to work, both switch devices on the link must support UDLD and have it enabled on respective ports.
- Recomendation configure both side with same config
- Those frames are only understood by Cisco switches
Online Capture file: Here

! Configure UDLD Global
SW8(config)#udld ?
  aggressive  Enable UDLD protocol in aggressive mode on fiber ports except where locally configured
  enable      Enable UDLD protocol on fiber ports except where locally configured
  message     Set UDLD message parameters

! Configure UDLD per interface
SW8(config)#in fastEthernet 1/0/23
SW8(config-if)#udld port aggressive

! Check UDLD Status per interface
SW8#show udld fastEthernet 1/0/23
Interface Fa1/0/23
---
Port enable administrative configuration setting: Enabled / in aggressive mode
Port enable operational state: Enabled / in aggressive mode
Current bidirectional state: Bidirectional
Current operational state: Advertisement - Single neighbor detected
Message interval: 15
Time out interval: 5

    Entry 1
    ---
    Expiration time: 40
    Device ID: 1
    Current neighbor state: Bidirectional
    Device name: FDO1123Z5D3
    Port ID: Fa0/23
    Neighbor echo 1 device: CAT0815Y0VD
    Neighbor echo 1 port: Fa1/0/23

    Message interval: 15
    Time out interval: 5
    CDP Device name: SW7

SW8#show udld neighbors
Port     Device Name   Device ID     Port ID    Neighbor State
----     -----------   ---------     -------    --------------
Fa1/0/23 FDO1123Z5D3     1            Fa0/23     Bidirectional

! Resets all LAN ports that have been shut down by UDLD.
SW7#udld reset

! Enables fast UDLD error reporting
R1(config)#udld fast-hello error-reporting

! Configure UDLD Recovery
SW8(config)#errdisable recovery cause udld 

Cisco Site

 #UDLD (Unidirectional Link Detection)
UDLD has two modes of operation

* Normal Mode - When a undirectional link condition is detected, the port is allowed to continue its operation.
 UDLD merely marks the port as having an undetermined state and generates a syslog message.

* Aggressive Mode - When a undirectional link condition is detected, the switch takes action to reestablish the link. 
 UDLD messages are sent out onec a second for 8 seconds. If none of those messages is echoed back, the port is placed 
 in the errdisable state so that it cannot be used.

#To Enable UDLD Globally Use The Following Command
S3(config)#udld [ enable | aggressive | message time SECONDS ] !(Ranging from 7 to 90 sec)

#To Enable UDLD on Specific Switch Port Use The Following Command
S3(config-if)#udld [ enable | aggressive | disable ] 

#Reenable ports that UDLD aggressive mode has errdisabled
S3#udld reset

Implement and Troubleshoot Layer 2 Protocols : LLDP 802.1AB

L2 Neighbor Discovery
- LLDP (Link Layer Discovery Protocol 802.1AB)

Default LLDP Configuration
-------------------------
Feature                                Default Setting
----------------------------------------------------------
LLDP global state                       Disabled
LLDP timer (packet update frequency)    30  Seconds
LLDP holdtimer (before discarding)      120 Seconds
LLDP reinitialization delay             2 Seconds
LLDP Multicast destination address      01:80:C2:00:00:0E
----------------------------------------------------------

Link captured file: Here

Switch(config)#lldp ?
  holdtime    Specify the holdtime (in sec) to be sent in packets
  reinit      Delay (in sec) for LLDP initialization on any interface
  run         Enable LLDP
  timer       Specify the rate at which LLDP packets are sent (in sec)
  tlv-select  Selection of LLDP TLVs to send

! Enable LLDP Global.
Switch(config)#lldp run 

! Check LLDP per interfaces
SW8#show lldp interface fastEthernet 1/0/22
FastEthernet1/0/22:
    Tx: enabled
    Rx: enabled
    Tx state: INIT
    Rx state: WAIT PORT OPER

SW8#show lldp interface fastEthernet 1/0/23
FastEthernet1/0/23:
    Tx: enabled
    Rx: enabled
    Tx state: IDLE
    Rx state: WAIT FOR FRAME

! Enable/Disable LLDP per Interface
SW7(config)#interface fastEthernet 0/1
SW7(config-if)#no lldp ?
  med-tlv-select  Selection of LLDP MED TLVs to send
  receive         Enable LLDP reception on interface
  tlv-select      Selection of LLDP TLVs to send
  transmit        Enable LLDP transmission on interface

SW7(config-if)#no lldp transmit
SW7(config-if)#no lldp receive

SW7#show lldp interface fastEthernet 0/1
FastEthernet0/1:
    Tx: disabled
    Rx: disabled
    Tx state: INIT
    Rx state: WAIT PORT OPER

SW8#show lldp
Global LLDP Information:
    Status: ACTIVE
    LLDP advertisements are sent every 30 seconds
    LLDP hold time advertised is 120 seconds
    LLDP interface reinitialisation delay is 2 seconds

SW8#show lldp neighbors
Capability codes:
    (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
    (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other

Device ID           Local Intf     Hold-time  Capability      Port ID
SW7                 Fa1/0/23       120        B               Fa0/23
Total entries displayed: 1

SW7#show lldp neighbors detail
------------------------------------------------
Chassis id: 000f.f72c.c600
Port id: Fa1/0/23
Port Description: FastEthernet1/0/23
System Name: SW8

System Description:
Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 12.2(55)SE5, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2012 by Cisco Systems, Inc.
Compiled Thu 09-Feb-12 18:59 by prod_rel_team

Time remaining: 112 seconds
System Capabilities: B,R
Enabled Capabilities: B
Management Addresses - not advertised
Auto Negotiation - supported, enabled
Physical media capabilities:
    100base-TX(FD)
    100base-TX(HD)
    10base-T(FD)
    10base-T(HD)
Media Attachment Unit type: 16
Vlan ID: 1
Total entries displayed: 1

SW8#show lldp traffic
LLDP traffic statistics:
    Total frames out: 24
    Total entries aged: 0
    Total frames in: 1
    Total frames received in error: 0
    Total frames discarded: 0
    Total TLVs discarded: 0
    Total TLVs unrecognized: 0

SW8#show lldp errors
LLDP errors/overflows:
    Total memory allocation failures: 0
    Total encapsulation failures: 0
    Total input queue overflows: 0
    Total table overflows: 0

! Change LLDP Timers
SW7(config)#lldp timer 10
SW7(config)#lldp holdtime 30
SW7(config)#lldp reinit 5

! Check only SW8 entry
SW7#show lldp entry SW8

Implement and Troubleshoot Layer 2 Protocols : CDP

L2 Neighbor Discovery
- CDP (Cisco Discovery Protocol)

Default CDP Configuration
-------------------------
Feature                                Default Setting
-------------------------------------------------------
CDP global state                        Enabled
CDP interface state                     Enabled
CDP timer (packet update frequency)     60  Seconds
CDP holdtimer (before discarding)       180 Seconds
CDP Version-2 advertisements            Enabled
CDP Multicast destination address       01-00-0C-CC-CC-CC
-------------------------------------------------------
*Note: This MAC address also used for VTP,DTP,PAgP and UDLD

Link captured file Here 

CDP Configuration 
! Enable CDP Global
SW1(config)#cdp run

! Enable CDP per Interface
SW1(config)#in fas0/5
SW1(if-config)#cdp enable

! Check CDP Timers
SW1#show cdp
Global CDP information:
    Sending CDP packets every 60 seconds
    Sending a holdtime value of 180 seconds
    Sending CDPv2 advertisements is enabled

! Configure CDP Timers
SW1(config)#cdp timer 30 (Sec) Packet sent interval

! Configure Holdtime
SW1(config)#cdp holdtime 90 (Sec) 

! Check CDP per Interface
SW1#show cdp interface fas 0/5
FastEthernet0/5 is up, line protocol is up
  Encapsulation ARPA
  Sending CDP packets every 30 seconds
  Holdtime is 90 seconds

! Check CDP Traffic
SW1#show cdp traffic
CDP counters :
        Total packets output: 16, Input: 6
        Hdr syntax: 0, Chksum error: 0, Encaps failed: 0
        No memory: 0, Invalid packet: 0, Fragmented: 0
        CDP version 1 advertisements output: 0, Input: 0
        CDP version 2 advertisements output: 16, Input: 6

! Check CDP Neighbors
SW1#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
DSW1              Fas 0/24           133          S I      WS-C3550-2Fas 0/24

SW1#show cdp neighbors detail
-------------------------
Device ID: DSW1
Entry address(es):
  IP address: 10.99.0.20
Platform: Cisco WS-C3550-24,  Capabilities: Switch IGMP
Interface: FastEthernet0/24,  Port ID (outgoing port): FastEthernet0/24
Holdtime : 157 sec
Version :
Cisco IOS Software, C3550 Software (C3550-IPSERVICESK9-M), Version 12.2(44)SE6, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2009 by Cisco Systems, Inc.
Compiled Mon 09-Mar-09 20:28 by gereddy
advertisement version: 2
Protocol Hello:  OUI=0x00000C, Protocol ID=0x0112; payload len=27, value=00000000FFFFFFFF010221FF0000000000000013C4260B00FF0000
VTP Management Domain: 'CISCO'
Native VLAN: 99
Duplex: full
Management address(es):
  IP address: 10.99.0.20

SW8#show cdp neighbors detail | include Device|address
Device ID: DSW1
Entry address(es):
IP address: 10.99.0.20

! Check only DSW1 entry
SW1#show cdp entry DSW1

19 September, 2014

Configure DHCP Relay on Cisco SG300 series

Switch(config)#ip dhcp relay address 10.1.1.100
Switch(config)#ip dhcp relay enable
Switch(config)#interface vlan 10 
Switch(config-if)#ip dhcp relay enable
Switch(config-if)#end

30 July, 2014

MacSec, VACLs, PACLs

MacSec, VACLs, PACLs :

- VLAN Access Control Lists (VLAN MAP)
- Port based Access Control Lists
- MACsec L2 Hop by Hop encryption 

### VLAN Access Control Lists (VLAN MAP)

SW2(config)#ip access-list extended UNWANTED-IP-PORT
SW2(config-ext-nacl)#permit tcp 10.1.2.0 0.0.0.255 any eq 456
SW2(config-ext-nacl)#permit udp 10.1.2.0 0.0.0.255 any eq 678
SW2(config-ext-nacl)#exit

SW2(config)#mac access-list extended UNWANTED-MAC
SW2(config-ext-macl)#permit host 0000.1234.5678 any
SW2(config-ext-macl)#exit

SW2(config)#ip access-list extended ALLOWED-TRAFFIC
SW2(config-ext-nacl)#permit ip any any
SW2(config-ext-nacl)#exit

SW2(config)#vlan access-map VACL 10
SW2(config-access-map)#match ip address UNWANTED-IP-PORT
SW2(config-access-map)#action drop
SW2(config-access-map)#exit
SW2(config)#vlan access-map VACL 20
SW2(config-access-map)#match ip address UNWANTED-MAC
SW2(config-access-map)#action drop
SW2(config-access-map)#exit
SW2(config)#vlan access-map VACL 30
SW2(config-access-map)#match ip address ALLOWED-TRAFFIC
SW2(config-access-map)#action forward
SW2(config-access-map)#exit

SW2(config)#vlan filter VACL vlan 55

### Port based Access Control Lists

! Create access list
SW2(config)#ip access-list extended NO-PING-TO-11
SW2(config-ext-nacl)#deny icmp any host 10.123.0.11
SW2(config-ext-nacl)#permit ip any any

! Check Ping 
root@kali:~# ping 10.123.0.11
it´s works!

! Apply this access control list on interface
SW2(config)#in fas 0/7
SW2(config-if)#ip access-group NO-PING-TO-11 in

! Check Ping again
root@kali:~# ping 10.123.0.11
not works!

### MACsec (Encription)

SW2(config)#in fastEthernet 0/24
SW2(config-if)#cts manual
SW2(config-if-cts-manual)#sap pmk ABCD
SW2(config-if-cts-manual)#do show run in fas0/24
interface FastEthernet0/24
 description LINK_TO_SW1
 switchport trunk encapsulation dot1q
 switchport mode trunk
 cts manual
  sap pmk 00000000000000000000000000000000000000000000000000000000ABCD
end
* You have to configure the other side same like this

* Note: For More info use
SW2#show cts interface

* Note: MACsec is open standard
* Note: CTS = Cisco trustsec
* Note: SAP = Security Associate Protocol 
* Note: PMK = Pairwise Master Key