Showing posts with label switching. Show all posts
Showing posts with label switching. Show all posts

Friday, February 18, 2011

LAB: FLex LInks


Flex Links feature is used as an alternative to Spanning-Tree Protocol in
environments where physical loops occur in the layer 2 network
- The backup link operates in standby mode, and waits for the line protocol of the active link to go down. If the line protocol of the active link is down, the backup link becomes active and immediately starts forwarding. When the active link’s line protocol status comes back up, the backup link goes back into standby state and stops forwarding traffic.


SW1:

interface Port-channel1
switchport trunk encapsulation dot1q
switchport mode trunk
switchport backup interface Fa0/16
switchport backup interface Fa0/16 preemption mode forced
switchport backup interface Fa0/16 preemption delay 20
!
interface FastEthernet0/13
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode on
!
interface FastEthernet0/14
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode on
!
interface FastEthernet0/16
switchport trunk encapsulation dot1q
switchport mode trunk

SW2:

interface Port-channel1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/13
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode on
!
interface FastEthernet0/14
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 1 mode on
!
interface FastEthernet0/16
switchport trunk encapsulation dot1q
switchport mode trunk

SW3:

interface FastEthernet0/13
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/16
switchport trunk encapsulation dot1q
switchport mode trunk


verification:

SW1#show interfaces po1 switchport backup
Switch Backup Interface Pairs:
Active Interface Backup Interface State
------------------------------------------------------------------------
Port-channel1 FastEthernet0/16 Active Up/Backup Standby

Thursday, February 17, 2011

notes: 3550 & 3560 QoS

3550
fastethernet
QOS scheduling: tx-(4q0t),tx-(1p3q0t)

gigabitethernet
QOS scheduling: tx-(4q2t),tx-(1p3q2t)

- priority at queue 4
- default port cos 0
- default port is untrusted
- default cos to tx queue mapping
0 - 1
1 - 1
2 - 2
3 - 2
4 - 3
5 - 3
6 - 4
7 - 4

- default cos-dscp map

show mls qos maps cos-dscp
Cos-dscp map:
cos: 0 1 2 3 4 5 6 7
--------------------------------
dscp: 0 8 16 24 32 40 48 56

- default wrr weights
wrr bandwidth weights:
qid-weights
1 - 25
2 - 25
3 - 25
4 - 25

weight 4 range (0-255) when set to "0" it is configured as expedite queue

3560
QoS scheduling: tx-(4q2t)
-same cos-tx queues mapping
-same cos-dscp mapping
- same queue bandwidth weights
-no vlan-based classification
- can use class based marking to set dscp



to verify queing

show mls qos interface queueing

to change cos-dscp mapping:

mls qos map cos-dscp (dscp-values)


config-set for 3550 setting cos-tx queues mapping:

Rack1SW3(config-if)#wrr-queue cos-map 1 0 1 2
Rack1SW3(config-if)#wrr-queue cos-map 2 3
Rack1SW3(config-if)#wrr-queue cos-map 3 4
Rack1SW3(config-if)#wrr-queue cos-map 4 5
Rack1SW3(config-if)#priority-queue out ---configure priority queueing

Rack1SW3#show mls qos interface queueing
FastEthernet0/1
QoS is disabled. Only one queue is used
When QoS is enabled, following settings will be applied
Egress expedite queue: dis
wrr bandwidth weights:
qid-weights
1 - 25
2 - 25
3 - 25
4 - 25
Cos-queue map:
cos-qid
0 - 1
1 - 1
2 - 1
3 - 2
4 - 3
5 - 4
6 - 4

ex:

wrr-queue bandwidth 1 2 3 4

10%- queue1
20%-queue2
30%-queue3
40%-queue4

notes: IP Phone Trust and CoS Extend

- ports are configured to trust the QoS marking only if the presence of a Cisco IP Phone is
sensed via CDP messages.
- If no Cisco device is detected on the port then the QoS markings are not trusted, even if the port is configured for trust.
- the switch may also instruct the IP Phone’s switch to apply specific CoS markings for frames received from the connected PC. The switch may either accept (trust) 802.1p bits received from the attached PC or enforce the instructed value. This feature particularly
makes sense to be used with the dot1p Voice VLAN option.

config-set:

interface FastEthernet0/6
mls qos trust cos
mls qos trust device cisco-phone
switchport priority extend cos 1


verification:

show mls qos interface #

notes: Voice VLAN

Voice VLAN (VVLAN)
- Most Cisco phones have a built-in 3-port switch and is able to distinguish the phone and the PC using different VLANs and optionally 802.1p COS.
- Voice config is communicated via CDP to the IP phone.

3 different connecting options:

1. Separate DATA VLAN / VOICE VLAN.
- VOIP frames are tagged with COS 5.
- Connection between switch and IP phone is a 802.1q trunk with native VLAN equal to data VLAN.

config set:

interface FastEthernet0/2
switchport access vlan 146
switchport voice vlan 600
spanning-tree portfast
!
interface FastEthernet0/4
switchport trunk encapsulation dot1q
switchport trunk native vlan 146
switchport trunk allowed vlan 146,600
switchport mode trunk
switchport voice vlan 600
spanning-tree portfast trunk
spanning-tree bpdufilter enable


Note that as soon as the switchport voice vlan command is applied to the
port, the spanning-tree portfast feature is automatically enabled.


2. Single VLAN for both VOICE and DATA
- Frames are not tagged, thus the phone merely acts as a switch.
- Connection between switch and IP phone is configured as a ACCESS link.

if no "switchport voice vlan" configured, then option 2 automatically applies.

3. Single VLAN for DATA and VOICE but with COS 5 marking

- ATA traffic is marked as COS 0 within a 802.1q header.
- VOICE traffic is marked as COS 5 within the 802.1q header.
- COS zero will be accepted as the access VLAN.

config set:

interface FastEthernet0/6
switchport access vlan 146
switchport voice vlan dot1p

notes: VACL

VACL

- VLAN access map similar to route-map
- Is used to apply a layer3 filter to layer2 transit traffic.
- Uses route-map logic to permit(forward) or deny(drop) traffic.
- Changes made to the access-map, will not take effect until the access-map is removed and re-applied.
- ONLY a ACL-permit performs the "forward"/"drop" function in the access-map. A ACL-deny will be ignored.
- So to deny traffic with VLAN ACL's, permit the traffic and use a "drop" action in the access-map.

MAC-ACL’s will only match NON-IP traffic.
- Cisco 3560 switch sees IPv6 traffic as IP-traffic, but a Cisco 3550 switch sees IPv6 traffic as NON-IP-traffic.
- Ethertypes are not fully listed on IOS command help or DOC-CD,

memorise!
0x0806 0x0 : ARP
0x0800 0x0 : IPv4
0x86DD 0x0 : IPv6
0xAAAA 0x0 : CISCO proprietary (STP, PAGP, VTP, PVST+, CDP, DTP, and UDLD)
0x4242 0x0 : CST

config-set: Blocks all ICMP echo’s & IPv6 on VLAN-162 but forward all other
access-list 101 permit icmp any any echo

mac access-list extended EtherType
permit any any 0xAAAA 0x0
!
vlan access-map VACL 10
action drop
match ip address 101 - Drops ICMP Echo
vlan access-map VACL 20
action drop
match mac address EtherType
vlan access-map VACL 30
action forward - Forwards all other traffic
!
vlan filter VACL vlan-list 162 - Applies access-map

notes: DHCP Snooping and IP Source Guard

DHCP Snooping

- DHCP snooping is a feature that provides network security by filtering untrusted DHCP messages and by building and maintaining a DHCP snooping binding database.
- acts like a firewall between untrusted hosts and DHCP servers.
- One can use DHCP snooping to differentiate between untrusted interfaces connected to the end user and trusted interfaces connected to the DHCP server or another switch.

enable snooping globally:

ip dhcp snooping

ip dhcp snooping vlan #

interface command:

interface FastEthernet 0/1
ip dhcp snooping trust
ip dhcp snooping limit rate 200


IP Source Guard

- IP Source Guard is a Catalyst security feature related to DHCP snooping.
- IP source guard helps prevent IP spoofing by enabling only the IP addresses obtained through DHCP snooping on a particular port. When a client receives an IP address from the authorized DHCP server, a port access control list (PACL) is installed on the port. This PACL enables traffic in the interface if it is sourced from the DHCP provided IP address.

global command:

ip verify source vlan dhcp-snooping port-security

Wednesday, February 16, 2011

notes: Switchport Security

port security feature to restrict input to an interface by limiting and identifying MAC addresses of the stations allowed to access the port.
- Can only be configured on static access or trunk ports. No dynamic links.

You can configure these types of secure MAC addresses:

1. Static secure MAC addresses: Manually configured by using the switchport port-security mac-address
- MAC address interface configuration command.

2. Dynamic secure MAC addresses: Dynamically learned, stored only in the address table and removed when the switch restarts.

3. Sticky secure MAC addresses: Dynamically learned or manually configured, stored in the address table and added to the running configuration. These addresses can be saved in the configuration file.


3 violation modes, based on the action to be taken if a violation occurs:

1. Protect: Packets with unknown source addresses are dropped until you remove a sufficient number of secure MAC addresses or increase the number of maximum allowable addresses.

2. Restrict: Packets with unknown source addresses are dropped until you remove a sufficient number of secure MAC addresses or increase the number of maximum allowable addresses; you are notified.
-Generates SNMP/Syslogs.

3. Shutdown: Port security violation causes the interface to immediately become error-disabled and turns off the port LED; it also sends a Simple Network Management Protocol (SNMP) trap, logs a syslog message, and increments the violation counter.


command set to configure port security:

switchport port-security
switchport port-security maximum value [vlan [vlan-list]]
switchport port-security violation {protect | restrict | shutdown}
switchport port-security mac-address mac-address [vlan vlan-id]
switchport port-security mac-address sticky

You can use port security aging to set the aging time for static and dynamic secure addresses on a port. Two types of aging are supported per port:

1. Absolute: The secure addresses on the port are deleted after the specified aging time.
2. Inactivity: The secure addresses on the port are deleted only if the secure addresses are inactive for the specified aging time.

command:

switchport port-security aging {static | time time | type {absolute | inactivity}}

setting error disable aging for port security:

errdisable recovery cause psecure-violation
errdisable recovery interval 5400 (sec)

Tuesday, February 15, 2011

LAB: Bridging over WAN


Rack1R2

bridge irb
!
interface FastEthernet0/0
no ip address
speed 100
full-duplex
bridge-group 1
!
interface Serial0/0
ip address 155.1.0.2 255.255.255.0
encapsulation frame-relay
clock rate 2000000
cdp enable
frame-relay map bridge 205 broadcast
frame-relay interface-dlci 205
bridge-group 1
!
interface BVI1
ip address 111.111.111.2 255.255.255.0
!
!
bridge 1 protocol ieee
bridge 1 route ip


Rack1R5


bridge irb
!
interface FastEthernet0/0
no ip address
speed 100
full-duplex
bridge-group 1
!
interface Serial0/0
ip address 155.1.0.5 255.255.255.0
encapsulation frame-relay
clock rate 2000000
cdp enable
frame-relay map bridge 502 broadcast
frame-relay interface-dlci 502
bridge-group 1
!
interface BVI1
ip address 111.111.111.5 255.255.255.0
!
!
bridge 1 protocol ieee
bridge 1 route ip


VERIFICATION:

Rack1R2#ping 111.111.111.5 source bvI 1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 111.111.111.5, timeout is 2 seconds:
Packet sent with a source address of 111.111.111.2
!!!!!

Rack1R5#ping 111.111.111.2 source bvI 1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 111.111.111.2, timeout is 2 seconds:
Packet sent with a source address of 111.111.111.5
!!!!!

LAB: Fallback Bridging (VLAN bridging)


R4:

interface FastEthernet0/1
ip address 104.0.0.4 255.255.255.0
ipv6 address 2001::4/64
!
router rip
version 2
no auto-summary
network 104.0.0.0

R6:

interface FastEthernet0/1
ip address 106.0.0.6 255.255.255.0
ipv6 address 2001::6/64
!
router rip
version 2
no auto-summary
network 106.0.0.0

SW4:

vlan 104
!
bridge 1 protocol vlan-bridge
!
interface FastEthernet0/4
switchport access vlan 104
!
interface FastEthernet0/6
no switchport
ip address 106.0.0.10 255.255.255.0
bridge-group 1
!
interface Vlan104
ip address 104.0.0.10 255.255.255.0
bridge-group 1
!
ip routing
!
router rip
version 2
no auto-summary
network 104.0.0.0
network 106.0.0.0

verification:

Rack1R4#traceroute 106.0.0.6
Translating "106.0.0.6"
Type escape sequence to abort.
Tracing the route to 106.0.0.6
1 104.0.0.10 4 msec 0 msec 4 msec
2 106.0.0.6 0 msec * 0 msec

Rack1R4#traceroute 2001::6
Type escape sequence to abort.
Tracing the route to 2001::6
1 2001::6 4 msec 0 msec 0 msec

Saturday, February 12, 2011

LAB: EtherChannel over 802.1q Tunneling

R1:
interface FastEthernet0/0
ip address 155.1.146.1 255.255.255.0

R4:
interface FastEthernet0/1
ip address 155.1.146.4 255.255.255.0

SW1:
vlan 146
!
interface FastEthernet0/1
switchport access vlan 146
!
interface FastEthernet0/13
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 14 mode desirable
!
interface FastEthernet0/14
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 14 mode desirable
!
interface FastEthernet0/15
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 14 mode desirable

SW2:

vlan 100,200,300
!
interface FastEthernet0/13
switchport access vlan 100
switchport mode dot1q-tunnel
l2protocol-tunnel cdp
l2protocol-tunnel stp
l2protocol-tunnel point-to-point pagp
!
interface FastEthernet0/14
switchport access vlan 200
switchport mode dot1q-tunnel
l2protocol-tunnel cdp
l2protocol-tunnel stp
l2protocol-tunnel point-to-point pagp
!
interface FastEthernet0/15
switchport access vlan 300
switchport mode dot1q-tunnel
l2protocol-tunnel cdp
l2protocol-tunnel stp
l2protocol-tunnel point-to-point pagp
!
interface FastEthernet0/16
switchport trunk encapsulation dot1q
switchport mode trunk


metro VLAN tags of 100, 200, and 300

SW3:

vlan 100,200,300
!
interface FastEthernet0/16
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/19
switchport access vlan 100
switchport trunk encapsulation dot1q
switchport mode dot1q-tunnel
l2protocol-tunnel cdp
l2protocol-tunnel stp
l2protocol-tunnel point-to-point pagp
!
interface FastEthernet0/20
switchport access vlan 200
switchport mode dot1q-tunnel
l2protocol-tunnel cdp
l2protocol-tunnel stp
l2protocol-tunnel point-to-point pagp
!
interface FastEthernet0/21
switchport access vlan 300
switchport mode dot1q-tunnel
l2protocol-tunnel cdp
l2protocol-tunnel stp
l2protocol-tunnel point-to-point pagp

SW4:

vlan 146
!
interface FastEthernet0/4
switchport access vlan 146
!
interface FastEthernet0/19
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 14 mode auto
!
interface FastEthernet0/20
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 14 mode auto
!
interface FastEthernet0/21
switchport trunk encapsulation dot1q
switchport mode trunk
channel-group 14 mode auto


VERIFICATION:

Rack1SW1#show cdp neighbor
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
Rack1SW4 Fas 0/15 153 S I WS-C3550-2Fas 0/21
Rack1SW4 Fas 0/14 153 S I WS-C3550-2Fas 0/20
Rack1SW4 Fas 0/13 153 S I WS-C3550-2Fas 0/19
Rack1R1 Fas 0/1 131 R S I 2610XM Fas 0/0
Rack1R3 Fas 0/3 128 R S I 2611XM Fas 0/0
Rack1R5 Fas 0/5 124 R S I 2611XM Fas 0/0

LAB: 802.1q Layer 2 tunneling




R1:
interface FastEthernet0/0
no shutdown
!
interface FastEthernet0/0.14
encapsulation dot1Q 14
ip address 14.0.0.1 255.255.255.0
!
interface FastEthernet0/0.41
encapsulation dot1Q 41
ip address 41.0.0.1 255.255.255.0
R4:
interface FastEthernet0/1
no shutdown
!
interface FastEthernet0/1.14
encapsulation dot1Q 14
ip address 14.0.0.4 255.255.255.0
!
interface FastEthernet0/1.41
encapsulation dot1Q 41
ip address 41.0.0.4 255.255.255.0

SW1:
system mtu 1504
!
interface FastEthernet0/1
switchport access vlan 100
switchport mode dot1q-tunnel
l2protocol-tunnel cdp
no cdp enable
!
interface FastEthernet0/13
switchport trunk encapsulation dot1q
switchport mode trunk
SW2:
system mtu 1504
!
interface FastEthernet0/13
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/16
switchport trunk encapsulation dot1q
switchport mode trunk

SW3:
system mtu 1504
!
interface FastEthernet0/16
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/19
switchport trunk encapsulation dot1q
switchport mode trunk
SW4:
system mtu 1504
!
interface FastEthernet0/4
switchport access vlan 100
switchport mode dot1q-tunnel
l2protocol-tunnel cdp
no cdp enable
!
interface FastEthernet0/19
switchport trunk encapsulation dot1q
switchport mode trunk

verification:

Rack1R4#show cdp neighbor
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater
Device ID Local Intrfce Holdtme Capability Platform Port ID
Rack1R1 Fas 0/1 125 R S I 2610XM Fas 0/0

notes: Storm Control & Unicast flooding

Storm control
- is used to limit the amount of unicast, multicast, or broadcast traffic
received in a port.
- The most common application of this feature is to prevent
broadcast storms, but it can also be used to police individual ports not to exceed
a desired rate.
-Traffic above multicast rate suppresses unicast, broadcast and multicast.
- With storm control it recommended to hardcode the interface speed to get around 10/100/1000 negotiation issue.

command:

interface FastEthernet0/1
storm-control unicast level pps 100

interface FastEthernet0/6
storm-control broadcast level 1.00

interface FastEthernet0/4
storm-control broadcast level bps 10m

verification:

show storm-control


"every broadcast is a multicast, but every multicast is not a broadcast"

if you want to limit multicast to 10% and broadcast to 20%, it will not reach the 20% broadcast.

Unicast Flooding

If a destination MAC address is not in the MAC address table of the switch, the frame is flooded out all ports for that respective VLAN. Although some flooding is unavoidable and expected, excessive flooding might be caused by asymmetric routing, STP topology changes, or forwarding table overflow. Also, flooding can result from attacks on the network, especially if denial-of-service (DoS) attacks occur.
- Switches can now implement a unicast flood-prevention feature.

global command:

mac-address-table unicast-flood {limit kfps} {vlan vlan} {filter timeout | alert | shutdown}

notes: Private VLANS, protected ports

Private VLANs

- Can split a single broadcast domain, defined by a single VLAN, into multiple isolated broadcast subdomains, that are defined by primary VLAN and secondary VLANs.
- Basically it is VLANs inside a VLAN.
- Commonly used in shared layer2 environments, like ISP co-locations/hotel rooms, so two sites/rooms can't communicate directly.
- PVLANs can only be configured when a switch is in VTP transparent mode!!!
- Difference between PVLAN and protected port, PVLAN can span multiple switches whereas protected ports don't.
- Private VLAN information is NOT propagated via VTP.
- Secondary VLANs (isolated and community) do not run their own instance of spanning-tree.

Different port roles:

1. Promiscuous ports - Are allowed to talk to all other ports within the VLAN.
- Are the roles assigned to the primary VLAN ports.

2. Community ports - Are allowed to talk to any other ports only in the same community.

3. Isolated ports - Can only talk to other promiscuous ports.


steps to configure Private VLANS

Note: must be in vtp transparent mode ( so vtp domain must be configured)

1. Create the secondary VLANs as community or isolated.

vlan 1000
private-vlan community

vlan 2000
private-vlan isolated

2. Create the primary VLANs and associate the secondary VLANs.

vlan 100
private-vlan primary
private-vlan association 1000,2000

3. Assign ports to which mode and map/associate it with secondary vlans

interface fa0/1
switchport mode private-vlan promiscuous
switchport private-vlan mapping 100 1000,2000

int fa0/2
switchport mode private-vlan host
switchport private-vlan host-association 100 1000

int fa0/3
switchport mode private-vlan host
switchport private-vlan host-association 100 2000

verification:

show vlan private-vlan


Protected Ports:

are used to prevent traffic from being exchanged at layer 2 between two or more ports that are in the same VLAN.
- Traffic received in a protected port cannot be sent out another protected port, however traffic received in a protected port can be sent out a non-protected port.
This feature is a much smaller subset of the Private VLAN feature, and cannot span between multiple physical switches.


command:

interface FastEthernet0/2
switchport protected

interface FastEthernet0/24
switchport protected

notes: SPAN and RSPAN

- SPAN (Switchport Analyzer)

-Is used to redirect traffic from a port or VLAN onto another for analysis by devices such as a packet sniffer or IPS.
-By default traffic coming in on the destination SPAN port will get dropped.
-The [ingress] keyword tells the switch, which access VLAN inbound traffic on the destination port should belong to.

config-set:

monitor session 1 source vlan 146
monitor session 1 destination interface Fa0/24

monitor session 1 source interface Fa0/4
monitor session 1 destination interface Fa0/24 ingress vlan 146

note: session # are locally significant

RSPAN

- Feature is used when the source port or VLAN that is being monitored, is on a different physical switch than the sniffer.


steps to configure:

1. configure the RSPAN VLAN, which carries special attributes.

SW4:

vlan 500
remote-span

2. configure the source of the traffic for the SPAN session and direct it to the RSPAN VLAN.

SW2:

monitor session 2 source interface Fa0/4
monitor session 2 destination remote vlan 500


3. On the switch with the attached sniffer, create a SPAN session with the source as the RSPAN VLAN and the destination as port where the sniffer is attached.

SW1:

monitor session 2 destination interface Fa0/24 ingress vlan 146
monitor session 2 source remote vlan 500


verification:

show monitor session all

notes: 802.1X Port-Based Authentication

defines a client/server-based access control and authentication protocol that restricts unauthorized clients from connecting to a LAN through publicly accessible ports.

remembers
- DO NOT forget to add “aaa authentication login default none”, else you might lock the switch and forfeit any points related to that switch.
- Uses AAA with RADIUS for authentication
- everytime " aaa new-model" is type it will erase existing aaa config.

You control the port authorization state by using the dot1x port-control interface configuration command and these keywords:

1. force-authorized: Disables 802.1X authentication and causes the port to transition to the authorized state without any authentication exchange required

2. force-unauthorized: Causes the port to remain in the unauthorized state, ignoring all attempts by the client to authenticate

3. auto: Enables 802.1X authentication and causes the port to begin in the unauthorized state

802.1X port-based authentication is supported in two topologies:

1. Point-to-point
2. Wireless LAN

Use the following commands to enable 802.1X authentication. Note that dot1x authentication requires RADIUS as the method.

global:

aaa new-model
aaa authentication dot1x default group radius
dot1x system-auth-control

radius-server host 10.10.10.10
radius-server key cisco
aaa authorization network default group radius

interface:
dot1x port-control auto
dot1x host-mode multihost (multiple devices can be authenticated on that single port)
dot1x auth-fail vlan 888
dot1x auth-fail max 2 (default:3)
dot1x guest-vlan 888
dot1x critical vlan 24 (if port authentication failed, and to ensure port comes up)

notes: Smartport Macros

Smartport Macros
- Used to define a well known template of config to apply onto multiple interfaces.
- There are default macros on a switch, that can be seen with "sh parser macro [brief]"

Type:

1. global - applying macro on global mode.
2. interface - applying macro on interface mode.

command to create macro:

macro name name

command to apply the macro:

macro apply name


example config for interface mode:

macro name setvlan
switchport access vlan $VLAN
spanning-tree portfast bpduguard
@

interface range fa0/10-19
macro apply setvlan $VLAN 5


example config for global:

macro name rangeport
interface range fa0/15-15
switchport mode access
spanning-tree portfast
@

Note: since the interface range cmd is included it is a macro global.
- macro is really not working for interface range cmd.



predefined macros

- need to be familiar with those macros

to check the built-in and custom macros:

show parser macro

CCIE lab scenario: use smartport macro voice vlan 20, enable switchport mode security using one cmd, an you may not need macro to do it.

macro apply cisco-phone $access_vlan 10 $voice-vlan 20

How to know when you used the macro: there is a macro definition:


Here are some predefine macros:

Rack1SW1#show parser macro
Total number of macros = 7
--------------------------------------------------------------
Macro name : cisco-global
Macro type : default global
# Enable dynamic port error recovery for link state failures.
errdisable recovery cause link-flap
errdisable recovery interval 60

# Config Cos to DSCP mappings
mls qos map cos-dscp 0 8 16 26 32 46 46 56

# Enable aggressive mode UDLD on all fiber uplinks
udld aggressive

# Enable Rapid PVST+ and Loopguard
spanning-tree mode rapid-pvst
spanning-tree loopguard default
spanning-tree extend system-id
--------------------------------------------------------------
Macro name : cisco-desktop
Macro type : default interface
# macro keywords $access_vlan
# Basic interface - Enable data VLAN only
# Recommended value for access vlan should not be 1
switchport access vlan $access_vlan
switchport mode access

# Enable port security limiting port to a single
# MAC address -- that of desktop
switchport port-security
switchport port-security maximum 1

# Ensure port-security age is greater than one minute
# and use inactivity timer
switchport port-security violation restrict
switchport port-security aging time 2
switchport port-security aging type inactivity

# Configure port as an edge network port
spanning-tree portfast
spanning-tree bpduguard enable
--------------------------------------------------------------
Macro name : cisco-phone
Macro type : default interface
# Cisco IP phone + desktop template

# macro keywords $access_vlan $voice_vlan


# VoIP enabled interface - Enable data VLAN
# and voice VLAN
# Recommended value for access vlan should not be 1
switchport access vlan $access_vlan
switchport mode access

# Update the Voice VLAN value which should be
# different from data VLAN
# Recommended value for voice vlan should not be 1
switchport voice vlan $voice_vlan

# Enable port security limiting port to a 2 MAC
# addressess -- One for desktop on data vlan and
# one for phone on voice vlan
switchport port-security
switchport port-security maximum 2

# Ensure port-security age is greater than one minute
# and use inactivity timer
switchport port-security violation restrict
switchport port-security aging time 2
switchport port-security aging type inactivity

# Enable auto-qos to extend trust to attached Cisco phone
auto qos voip cisco-phone

# Configure port as an edge network port
spanning-tree portfast
spanning-tree bpduguard enable
--------------------------------------------------------------
Macro name : cisco-switch
Macro type : default interface
# macro keywords $native_vlan
# Access Uplink to Distribution
# Do not apply to EtherChannel/Port Group
switchport trunk encapsulation dot1q

# Define unique Native VLAN on trunk ports
# Recommended value for native vlan should not be 1
switchport trunk native vlan $native_vlan

# Update the allowed VLAN range such that it
# includes data, voice and native VLANs
switchport trunk allowed vlan ALL

# Hardcode trunk
switchport mode trunk

# Configure qos to trust this interface
auto qos voip trust

# 802.1w defines the link as pt-pt for rapid convergence
spanning-tree link-type point-to-point
--------------------------------------------------------------
Macro name : cisco-router
Macro type : default interface
# macro keywords $native_vlan
# Access Uplink to Distribution
switchport trunk encapsulation dot1q

# Define unique Native VLAN on trunk ports
# Recommended value for native vlan should not be 1
switchport trunk native vlan $native_vlan

# Update the allowed VLAN range such that it
# includes data, voice and native VLANs
switchport trunk allowed vlan ALL

# Hardcode trunk
switchport mode trunk

# Configure qos to trust this interface
auto qos voip trust
mls qos trust dscp

# Ensure fast access to the network when enabling the interface.
# Ensure that switch devices cannot become active on the interface.
spanning-tree portfast trunk
spanning-tree bpduguard enable
--------------------------------------------------------------
Macro name : cisco-wireless
Macro type : default interface
# macro keywords $native_vlan
# Access Uplink to Distribution
switchport trunk encapsulation dot1q

# Define unique Native VLAN on trunk ports
# Recommended native vlan should NOT be 1
switchport trunk native vlan $native_vlan

# Update the allowed VLAN range such that it
# includes data, voice and native VLANs
switchport trunk allowed vlan ALL

# Hardcode trunk and disable negotiation to speed up convergence
switchport mode trunk
switchport nonegotiate

# Configure qos to trust this interface
auto qos voip trust
mls qos trust cos

# Ensure that switch devices cannot become active on the interface.
spanning-tree bpduguard enable
--------------------------------------------------------------

notes: Bridging

Transparent bridging
- is using normal STP rules
- same election root bridge and root port election

Router in bridge mode doesnt support the sys-id-ext, brigde priority will always be 32768 for any vlan which will make the router as a root bridge.

enabling transparent bridging on routers:

step1: enable bridging:

bridge # protocol ieee

step2: bind to the interfaces:

interface fa0/1
bridge-group #

for frame-relay interfaces:

interface s0/0
encapsulation frame-relay
frame-relay map bridge dlci# broadcast
bridge-group #


CRB (concurrent Routing and Bridging)
- this protocol can be routed on one interface while being bridged on another interface.
- When CRB is used traffic in the routed domain cannot be passed onto the bridge domain.
- CRB is considered legacy since IRB includes all the functionality of CRB with the addition of the BVI.


IRB (Integrated Routing and Bridging)
- this protocol can be both routed and bridged on the same interface.
- When IRB is used traffic from the routed domain can be passed onto the bridge domain.


enabling IRB:

1. Create transparent bridge group

bridge # protocol ieee

2. Enable IRB and what to be bridged

bridge irb
bridge # route ip

bridge # bridge ip
-on by default

3. Enable routing & bridging for the bridge-group under the interface

interface fa0/0
bridge-group #

4. Configure BVI to connect the bridged and routed domain

interface BVI #
ip add 1.1.1.1 255.255.255.0

Fallback Bridging (VLAN bridging)
used to bridge non-routed or non-supported protocols (SNA, DECNet, AppleTalk, etc.)
to communicate across VLANs and routed ports. one good implementation also is bridging IPv6.

enabling VLAN bridging

1. Specify the bridging VLAN

bridge # protocol vlan-bridge

2. Assign the SVI and routed port to this bridge.

interface vlan1
bridge-group #

interface fa0/1
no switchport

bridge-group #

verification:

sh bridge # group

notes: layer 2 tunneling

802.1q Tunnel
- Used to provide transparent layer2 VPN over a switched ethernet network, to carry unicast, broadcast, multicast, CDP, VTP or STP.
- Uses dot1q inside dot1q, to tunnel layer2 traffic.
- Cannot be dynamically negotiated, and traffic is not encrypted.
NOTE: Confirm prior to configuration that underlying end-to-end connectivity is established.
- When using dot1q tunneling CDP, STP & VTP are NOT carried across the tunnel by default.
- Additionally dot1q also supports etherchannels between customer sites.
- Dot1q-Tunnel requires:
- 802.1q trunking end-to-end
- System MTU should be a minimum of 1504, to support the additional 4-byte metro tag.

PITFALL: Careful when running OSPF to a switch with a system MTU of 1504, the adjacency won’t come up, due to a MTU mismatch.
Disable the MTU check on the routers OSPF interface with "ip ospf mtu-ignore"

Note: you can configure l2 protocol tunneling on ports configured as access or tunnel ports. You cant enable l2 tunneling on ports that is configured
switchport dynamic mode auto
switchport dynamic desirable

from Ruhan's CCIE notes

notes: MSTP 802.1s

Multiple Spanning Tree
- MSTP is using RSTP
- Allows user-defined STP instances to be mapped to multiple VLANs.
- Up to 64 instance.
- If no instances are defined, all VLANs are mapped to instance 0.
- Same election process as STP. MST also uses the lowest BID in the network to elect the Root Bridge.
- With MST there is only one election per user-defined instance.
- MST also uses a cost value derived from the inverse bandwidth of the interface.
- When MST is enabled, RSTP is automatically enabled.

MSTP configuration

Step 1. Globally enable MISTP (MSTP) on your switches:

spanning-tree mode mst

Step 2. Enter MST configuration submode:

spanning-tree mst configuration

Step 3. Set the MST region name:

name name

Step 4. Set a configuration revision number: optional

revision rev_num

Step 5. Map your VLANs to MST instances:

instance # vlan range

verification:

show spanning-tree mst configuration

show spanning-tree mst vlan_id

CCIE Lab Scenario: if you are to ask to create 2 instance/ you just need to create 1 instance since instance 0 is already running.

configuration of root

per vlan

spanning-tree vlan # root primary/secondary

per mst

spanning-tree mst # root primary/secondary

priority

per vlan

spanning-tree vlan # priority #

per mst

spanning-tree mst # priority #

notes: RSTP 802.1w

RSTP

- takes advantage of STP features;
a. portfast - now called edge port, not participating in STP.
b. uplinkfast - built-in
c. backbonefast - built-in

RSTP port roles

1. Root port - Is the port that has the best root path cost to the root.

2. Designated port - Is the downstream port that has the best root path cost to the root.
- Is a downstream interface pointing away from the root bridge.
- By default, all ports on the root bridge are DP

3. Alternate port - Is a port that has an alternate path to the root. An alternate port, is less desirable than the root port.
- In blocking state will receive STP info, but not send any out that interface.

4. Backup port - Is a backup designated port.
- quickly converging backup to the root port for a system.

RSTP Port States

RSTP port states are simplified from 802.1D and consist of the following:

1. Discarding
- Incoming frames are simply dropped; no MAC addresses are learned.
- Combines the 802.1D (STP) disabled, blocking, and listening states.

2. Learning

- Incoming frames are dropped, but MAC addresses are learned.

3. Forwarding
- Incoming frames are forwarded according to MAC addresses that have been (and are being) learned.

Implementing RSTP

On most Cisco switches, configuring 802.1s (Multiple Spanning Tree, MST) automatically enables RSTP. Cisco did invent a mode of operation, PVST+ mode, that enables you to use RSTP without the implementation of MST.

command to enable rstp/pvst+:

spanning-tree mode rapid-pvst