Well, I finished up the lab portfolio today!!!! Hooraaahhh
I felt that I finished up pretty strong writing some VACLS on one of my switches. Basically permitting a host to still use its default gateway, but blocking it from reaching other hosts on the vlan. Config is as follows:
dsl2(config)#ip access-list extended temp-host
dsl2(config-ext-nacl)#permit ip host 172.16.200.7 172.16.200.0 0.0.0.255 - id what you are identifying
dsl2(config-ext-nacl)#exit
dsl2(config)#vlan access-map block-temp 10 -create "access-map"
dsl2(config-access-map)#match ip address temp-host
dsl2(config-access-map)#action ?
drop Drop packets
forward Forward packets
dsl2(config-access-map)#action drop - drop packets from 172.16.200.7
dsl2(config-access-map)#vlan access-map block-temp 20
dsl2(config-access-map)#action forward -permit all others (there is still an implicit deny at the end)
dsl2(config-access-map)#exit
dsl2(config)#vlan filter block-temp vlan-list 200 - identify the access-map with a specific vlan
dsl2(config)#end
dsl2#sh vlan access-map - check your work
Vlan access-map "block-temp" 10
Match clauses:
ip address: temp-host
Action:
drop
Vlan access-map "block-temp" 20
Match clauses:
Action:
forward
I did test this with a host in vlan 200 with the ip address of 172.16.200.7. It worked flawlessly. The host could not communicate within the vlan, but could still get out to others and the internet.
So, now its on to a little review, some practice questions, reinforcement labbing, and then the exam pretty soon! I will keep everyone posted (the few that may ever see this anyways!).
Sunday, August 30, 2009
STP Root Guard
Well, using the same topology as before, I configured DLS 1 to be the root switch for vlans 1 and 100, while being the secondary for vlan 200.
I essentially did the same thing, except opposite on DLS2, making it the root for 200, and the secondary root for 1 and 100. This gives some consistency in the network, allowing the admin to really control what is happening with the elections. This primarily gives each switch a value based on the current roots priority.
*Mar 1 00:28:31.159: %SPANTREE-2-ROOTGUARD_CONFIG_CHANGE: Root guard enabled on port Port-channel1.
*Mar 1 00:28:31.163: %SPANTREE-2-ROOTGUARD_BLOCK: Root guard blocking port Port-channel1 on VLAN0001.
dsl2(config-if)#
*Mar 1 00:28:40.831: %HSRP-5-STATECHANGE: Vlan100 Grp 1 state Standby -> Active
*Mar 1 00:28:40.879: %HSRP-5-STATECHANGE: Vlan1 Grp 1 state Standby -> Active
Whoa! Blocked the port, and forced an HSRP statechange. Now, the port stayed blocked, but DLS 1 took its active HSRP priority back over (Remember this was a redundant switching topology!) It just took a little bit. Around 1 minute.
I think that I have talked about this before...but admins can also enable bpdu guard on ports with portfast enabled. Because bpdu's are NOT expected to be heard on ports with portfast enabled, why not ensure that if bpdu's are received, that the switchport be shut down? Do you really want switches plugged in where your not expecting them? Not me! Enable it globally on all portfast ports by typing:
dsl2#
*Mar 1 00:44:40.051: %SYS-5-CONFIG_I: Configured from console by console
dsl2#sh spanning summary
Switch is in pvst mode
Root bridge for: VLAN0200
Extended system ID is enabled
Portfast Default is disabled
PortFast BPDU Guard Default is enabled
Portfast BPDU Filter Default is disabled
Loopguard Default is disabled
EtherChannel misconfig guard is enabled
UplinkFast is disabled
BackboneFast is disabled
Configured Pathcost method used is short
dls1(config)#spanning-tree vlan 1,100 root primary
dls1(config)#spanning-tree vlan 200 root secondary
dls1(config)#spanning-tree vlan 200 root secondary
I essentially did the same thing, except opposite on DLS2, making it the root for 200, and the secondary root for 1 and 100. This gives some consistency in the network, allowing the admin to really control what is happening with the elections. This primarily gives each switch a value based on the current roots priority.
When you enter this command, the switch checks the switch priority of the root switches for each VLAN. Because of the extended system ID support, the switch sets its own priority for the specified VLAN to 24576 if this value will cause this switch to become the root for the specified VLAN. If any root switch for the specified VLAN has a switch priority lower than 24576, the switch sets its own priority for the specified VLAN to 4096 less than the lowest switch priority. --> From Cisco.com
I then, just for fun, was playing with root guard. This again is a feature to protect from rouge switches being placed on the network, and taking over root bridge responsibilities if they have a lower priority number. Essentially if a bpdu is received on a port with this feature, it will be placed in the root inconsistent state. Look what happened when I configured it on the port channel connecting DLS1 and DLS2:
dsl2(config-if)#spanning-tree guard root
dsl2(config-if)#*Mar 1 00:28:31.159: %SPANTREE-2-ROOTGUARD_CONFIG_CHANGE: Root guard enabled on port Port-channel1.
*Mar 1 00:28:31.163: %SPANTREE-2-ROOTGUARD_BLOCK: Root guard blocking port Port-channel1 on VLAN0001.
dsl2(config-if)#
*Mar 1 00:28:40.831: %HSRP-5-STATECHANGE: Vlan100 Grp 1 state Standby -> Active
*Mar 1 00:28:40.879: %HSRP-5-STATECHANGE: Vlan1 Grp 1 state Standby -> Active
Whoa! Blocked the port, and forced an HSRP statechange. Now, the port stayed blocked, but DLS 1 took its active HSRP priority back over (Remember this was a redundant switching topology!) It just took a little bit. Around 1 minute.
I think that I have talked about this before...but admins can also enable bpdu guard on ports with portfast enabled. Because bpdu's are NOT expected to be heard on ports with portfast enabled, why not ensure that if bpdu's are received, that the switchport be shut down? Do you really want switches plugged in where your not expecting them? Not me! Enable it globally on all portfast ports by typing:
dsl2(config)#spanning-tree portfast bpduguard default
dsl2(config)#enddsl2#
*Mar 1 00:44:40.051: %SYS-5-CONFIG_I: Configured from console by console
dsl2#sh spanning summary
Switch is in pvst mode
Root bridge for: VLAN0200
Extended system ID is enabled
Portfast Default is disabled
PortFast BPDU Guard Default is enabled
Portfast BPDU Filter Default is disabled
Loopguard Default is disabled
EtherChannel misconfig guard is enabled
UplinkFast is disabled
BackboneFast is disabled
Configured Pathcost method used is short
Saturday, August 29, 2009
BCMSN Lab 8 - Switch Security
Saturday at last! The kid is napping, the wife is working on her project, and I finally get some "daytime" studying hours. Today I labbed up the switch security chapter in the BCMSN Lab Portfolio. I started with a lab topology that looked like so:
Port Security : Enabled
Port Status : Secure-down
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 : 0000.0000.0000
Security Violation Count : 0
The staff ports were configured as follows:
ALS1(config)#int range fa0/1 - 2
ALS1(config-if-range)#switchport mode access
ALS1(config-if-range)#switch access vlan 100
ALS1(config-if-range)#switchport port-security
ALS1(config-if-range)#switchport port-security maximum 2
ALS1(config-if-range)#switchport port-security mac-address sticky ?
H.H.H 48 bit mac address
ALS1(config-if-range)#switchport port-security mac-address sticky
ALS1(config-if-range)#end
ALS1#sh port-security int fastEthernet 0/1
Port Security : Enabled
Port Status : Secure-down
Violation Mode : Shutdown
Aging Time : 0 mins
Aging Type : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses : 2
Total MAC Addresses : 0
Configured MAC Addresses : 0
Sticky MAC Addresses : 0
Last Source Address : 0000.0000.0000
Security Violation Count : 0
So as you can see, the configured maximum mac addresses to be learned on the ports were different for the two access vlan ports. The mac-address sticky command allows the first two mac addresses to be learned dynamically, and then added to the running config. What what happens when I plug a switch into that port:
ALS1#sh run int fa0/1
Building configuration...
Current configuration : 312 bytes
!
interface FastEthernet0/1
switchport access vlan 100
switchport mode access
switchport port-security
switchport port-security maximum 2
switchport port-security mac-address sticky
switchport port-security mac-address sticky 000d.65eb.5e88
switchport port-security mac-address sticky 0014.692f.7f00
end
The first two addresses learned where added to the config. Good shit! Currently there is no aging time set on these ports, so those dynamically learned addresses are it! Notice in the show port-security interface commands, the aging time is 0, essentially disabled. If we wanted to change this we would use the switchport port-security aging {static | time time | type {absolute | inactivity}} command.
The next lesson was DHCP spoofing attack mitigation. This is to protect from rouge DHCP servers being put on your network. They create was is a man in the middle attack scenario, which we should all try to avoid. Here is the basic config:
ALS1(config)#ip dhcp snooping - enable it globally
ALS1(config)#ip dhcp snooping vlan 100 200 - enable it for vlans 100 and 200
ALS1(config)#int fa0/24
ALS1(config-if)#ip dhcp snooping trust - Trust all trunk ports!!
ALS1(config-if)#int range fa0/15 - 16
ALS1(config-if-range)#ip dhcp snooping trust - Trust all trunk ports!!
ALS1(config-if-range)#exit
The config was the same on all of the other switches. However on DLS1 I also trusted fa0/6 which was the port that the DHCP server was connected too. Here is a show command from ALS1:
ALS1#sh ip dhcp snooping
Switch DHCP snooping is enabled
DHCP snooping is configured on following VLANs:
100-200
Insertion of option 82 is enabled
Interface Trusted Rate limit (pps)
------------------------ ------- ----------------
FastEthernet0/15 yes unlimited - we COULD change this with the ip dhcp snooping limit rate [# in pps command]
FastEthernet0/16 yes unlimited
FastEthernet0/24 yes unlimited
Now the port is suppose to shut down if it sees any dhcp server activity, but the only results I got were that of the packets being blocked :)
Just a note: I did not hook up ALS2. I ran basically a triangle with dls1, dls2, and als1. A dhcp server was set up off of fa0/6 on dls1. This lab also ran these vlans and HSRP gateways:
- VLAN 1 - 172.16.1.1/24
- VLAN100 (staff)- 172.16.100.1/24 (USERS WHERE ON ALS1 FA0/3 -4)
- VLAN200 (students)- 172.16.200.1/24 (USERS WHERE ON ALS1 FA0/1 -2)
ALS1(config)#int range fa0/3 - 4
ALS1(config-if-range)#switchport mode access
ALS1(config-if-range)#switchport access vlan 200
ALS1(config-if-range)#switchport port-security
ALS1(config-if-range)#switch port-security max 1
ALS1(config-if-range)#end
ALS1#sh port-security interface fastEthernet 0/3ALS1(config-if-range)#switchport mode access
ALS1(config-if-range)#switchport access vlan 200
ALS1(config-if-range)#switchport port-security
ALS1(config-if-range)#switch port-security max 1
ALS1(config-if-range)#end
Port Security : Enabled
Port Status : Secure-down
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 : 0000.0000.0000
Security Violation Count : 0
The staff ports were configured as follows:
ALS1(config)#int range fa0/1 - 2
ALS1(config-if-range)#switchport mode access
ALS1(config-if-range)#switch access vlan 100
ALS1(config-if-range)#switchport port-security
ALS1(config-if-range)#switchport port-security maximum 2
ALS1(config-if-range)#switchport port-security mac-address sticky ?
H.H.H 48 bit mac address
ALS1(config-if-range)#switchport port-security mac-address sticky
ALS1(config-if-range)#end
ALS1#sh port-security int fastEthernet 0/1
Port Security : Enabled
Port Status : Secure-down
Violation Mode : Shutdown
Aging Time : 0 mins
Aging Type : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses : 2
Total MAC Addresses : 0
Configured MAC Addresses : 0
Sticky MAC Addresses : 0
Last Source Address : 0000.0000.0000
Security Violation Count : 0
So as you can see, the configured maximum mac addresses to be learned on the ports were different for the two access vlan ports. The mac-address sticky command allows the first two mac addresses to be learned dynamically, and then added to the running config. What what happens when I plug a switch into that port:
ALS1#sh run int fa0/1
Building configuration...
Current configuration : 312 bytes
!
interface FastEthernet0/1
switchport access vlan 100
switchport mode access
switchport port-security
switchport port-security maximum 2
switchport port-security mac-address sticky
switchport port-security mac-address sticky 000d.65eb.5e88
switchport port-security mac-address sticky 0014.692f.7f00
end
The first two addresses learned where added to the config. Good shit! Currently there is no aging time set on these ports, so those dynamically learned addresses are it! Notice in the show port-security interface commands, the aging time is 0, essentially disabled. If we wanted to change this we would use the switchport port-security aging {static | time time | type {absolute | inactivity}} command.
The next lesson was DHCP spoofing attack mitigation. This is to protect from rouge DHCP servers being put on your network. They create was is a man in the middle attack scenario, which we should all try to avoid. Here is the basic config:
ALS1(config)#ip dhcp snooping - enable it globally
ALS1(config)#ip dhcp snooping vlan 100 200 - enable it for vlans 100 and 200
ALS1(config)#int fa0/24
ALS1(config-if)#ip dhcp snooping trust - Trust all trunk ports!!
ALS1(config-if)#int range fa0/15 - 16
ALS1(config-if-range)#ip dhcp snooping trust - Trust all trunk ports!!
ALS1(config-if-range)#exit
The config was the same on all of the other switches. However on DLS1 I also trusted fa0/6 which was the port that the DHCP server was connected too. Here is a show command from ALS1:
ALS1#sh ip dhcp snooping
Switch DHCP snooping is enabled
DHCP snooping is configured on following VLANs:
100-200
Insertion of option 82 is enabled
Interface Trusted Rate limit (pps)
------------------------ ------- ----------------
FastEthernet0/15 yes unlimited - we COULD change this with the ip dhcp snooping limit rate [# in pps command]
FastEthernet0/16 yes unlimited
FastEthernet0/24 yes unlimited
Now the port is suppose to shut down if it sees any dhcp server activity, but the only results I got were that of the packets being blocked :)
Subscribe to:
Posts (Atom)
