10 Securing VLANs
10 Securing VLANs
Securing VLANs
Topology
Introduction
In this lab, you will configure the network to protect the VLANs using router ACLs, VLAN ACLs, and private
VLANs. First, you will secure the new server farm (Host C) by using private VLANs. Service providers use
private VLANs to separate different customers’ traffic while utilizing the same parent VLAN for all server
traffic. The private VLANs provide traffic isolation between devices, even though they might exist on the same
VLAN.
You will then secure the staff VLAN from the student VLAN by using a RACL, which prevents traffic from the
student VLAN from reaching the staff VLAN. This allows the student traffic to utilize the network and Internet
services while keeping the students from accessing any of the staff resources.
Lastly, you will configure a VACL that allows a host on the staff network to be set up to use the VLAN for
access but keeps the host isolated from the rest of the staff machines. This machine is used by temporary
staff employees.
Required Resources
2 switches (Cisco 2960)
2 switches (Cisco 3560)
4 PCs
Ethernet and console cables
Page 1 of 10
Network Security Lab
Dr. Mohammed Sharaf Eng. Ibrahim Amreya
b. Once this is complete, verify that VLAN 150 is preset in the database of every switch.
Page 2 of 10
Network Security Lab
Dr. Mohammed Sharaf Eng. Ibrahim Amreya
DLS1(config-vlan)# private-vlan isolated
DLS1(config-vlan)# exit
DLS1(config)# vlan 152
DLS1(config-vlan)# private-vlan community
DLS1(config-vlan)# exit
DLS1(config)# vlan 150
DLS1(config-vlan)# private-vlan primary
DLS1(config-vlan)# private-vlan association 151,152
DLS1(config-vlan)# exit
DLS1(config)#
c. Verify the creation of the secondary PVLANs and their association with the primary VLAN using the show
vlan private-vlan command. Note that no ports are currently associated with these VLANs. This is
expected behavior.
Page 3 of 10
Network Security Lab
Dr. Mohammed Sharaf Eng. Ibrahim Amreya
DLS2(config)# interface vlan 150
DLS2(config-if)# private-vlan mapping 152
DLS2(config-if)# end
Will hosts assigned to ports on private VLAN 151 be able to communicate directly with each other?
__________________________________________________________________________________
d. Use the show vlan private-vlan command and note that the ports configured are currently associated
with these VLANs.
DLS2# show vlan private-vlan
Page 4 of 10
Network Security Lab
Dr. Mohammed Sharaf Eng. Ibrahim Amreya
Primary Secondary Type Ports
------- --------- ----------------- -----------------------------------------
150 151 isolated Fa0/6
150 152 community Fa0/18, Fa0/19, Fa0/20
e. Configure HOST C on DLS1 interface f0/6 with the IP address 172.16.150.50/24. Use 172.16.150.1 as
the default gateway address.
f. Configure HOST D on DLS2 interface f0/6 with the IP address 172.16.150.150/24. Use 172.16.150.1 as
the default gateway address.
Part 3: RACLs.
You can use router access control lists (RACLs) to separate the student and staff VLANs. In this lab scenario,
write an ACL that allows the staff VLAN (100) to access the student VLAN (200), and deny student VLAN
access to the staff VLAN.
e. Check the configuration using the show ip access-list and show ip interface vlan vlan-id commands.
Page 5 of 10
Network Security Lab
Dr. Mohammed Sharaf Eng. Ibrahim Amreya
DLS1# show access-lists
Extended IP access list 100
10 permit tcp 172.16.200.0 0.0.0.255 172.16.100.0 0.0.0.255 established
20 permit icmp 172.16.200.0 0.0.0.255 172.16.100.0 0.0.0.255 echo-reply
30 deny ip 172.16.200.0 0.0.0.255 172.16.100.0 0.0.0.255
40 permit ip any any
Page 6 of 10
Network Security Lab
Dr. Mohammed Sharaf Eng. Ibrahim Amreya
b. Change the configuration of HOST C so that it is using the IP address 172.16.100.150/24 with the default
gateway set as 172.16.100.1
b. The VACL is defined using a VLAN access map. Access maps are evaluated in a numbered sequence.
To set up an access map, use the vlan access-map map-name seq# command. The following
configuration defines an access map named block-temp, which uses the match statement to match the
traffic defined in the access list and denies that traffic. You also need to add a line to the access map that
allows all other traffic. If this line is not added, an implicit deny catches all other traffic and denies it.
DLS1(config)# vlan access-map block-temp 10
DLS1(config-access-map)# match ip address temp-host
DLS1(config-access-map)# action drop
DLS1(config-access-map)# vlan access-map block-temp 20
DLS1(config-access-map)# action forward
DLS1(config-access-map)# exit
c. Define which VLANs the access map should be applied to using the vlan filter map-name vlan-list vlan-
ID command.
DLS1(config)# vlan filter block-temp vlan-list 100
d. Verify the VACL configuration using the show vlan access-map command on DLS1.
DLS1# show vlan access-map
Page 7 of 10
Network Security Lab
Dr. Mohammed Sharaf Eng. Ibrahim Amreya
Page 8 of 10
Network Security Lab
Dr. Mohammed Sharaf Eng. Ibrahim Amreya
Appendix A: start configuration of all devices
DLS1: DLS2:
hostname DLS1 hostname DLS2
enable secret pass enable secret pass
ip routing ip routing
no ip domain-lookup no ip domain-lookup
ip domain-name SEC.LAB ip domain-name SEC.LAB
vlan 99 vlan 99
name Management name Management
vlan 100 vlan 100
name STAFF name STAFF
vlan 200 vlan 200
name STUDENTS name STUDENTS
vlan 666 vlan 666
name NATIVE_DO_NOT_USE name NATIVE_DO_NOT_USE
exit exit
spanning-tree mode pvst spanning-tree mode pvst
spanning-tree vlan 99-100 priority 24576 spanning-tree vlan 99-100 priority 28672
spanning-tree vlan 200 priority 28672 spanning-tree vlan 200 priority 24576
interface range FastEthernet0/1-5 interface range FastEthernet0/1-6
switchport mode access shutdown
shutdown interface range FastEthernet0/7-12
interface FastEthernet0/6 switchport trunk encapsulation dot1q
switchport access vlan 99 switchport trunk native vlan 666
switchport mode access switchport mode trunk
spanning-tree portfast switchport nonegotiate
interface range FastEthernet0/7-12 interface range FastEthernet0/13-48
switchport trunk encapsulation dot1q shutdown
switchport trunk native vlan 666 interface range GigabitEthernet0/1-4
switchport mode trunk shutdown
switchport nonegotiate interface Vlan99
interface range FastEthernet0/13-48 ip address 172.16.99.4 255.255.255.0
switchport mode access standby 0 preempt
shutdown standby 99 ip 172.16.99.1
interface range GigabitEthernet0/1-4 interface Vlan100
switchport mode access ip address 172.16.100.4 255.255.255.0
shutdown standby 100 ip 172.16.100.1
interface Vlan99 standby 100 preempt
ip address 172.16.99.3 255.255.255.0 interface Vlan200
standby 0 preempt ip address 172.16.200.4 255.255.255.0
standby 99 ip 172.16.99.1 standby 200 ip 172.16.200.1
standby 99 priority 150 standby 200 priority 150
interface Vlan100 standby 200 preempt
ip address 172.16.100.3 255.255.255.0 line con 0
standby 100 ip 172.16.100.1 exec-timeout 0 0
standby 100 priority 150 logging synchronous
standby 100 preempt line vty 0 15
interface Vlan200 password pass
ip address 172.16.200.3 255.255.255.0 login
ip helper-address 172.16.99.50 end
standby 200 ip 172.16.200.1
standby 200 preempt
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 15
password pass
login
end
Page 9 of 10
Network Security Lab
Dr. Mohammed Sharaf Eng. Ibrahim Amreya
ALS1: ALS2:
hostname ALS1 hostname ALS2
enable secret pass enable secret pass
no ip domain-lookup no ip domain-lookup
ip domain-name SEC.LAB ip domain-name SEC.LAB
vlan 99 vlan 99
name Management name Management
vlan 100 vlan 100
name STAFF name STAFF
vlan 200 vlan 200
name STUDENTS name STUDENTS
vlan 666 vlan 666
name NATIVE_DO_NOT_USE name NATIVE_DO_NOT_USE
exit exit
spanning-tree mode pvst spanning-tree mode pvst
interface range FastEthernet0/1-5 interface range FastEthernet0/1-5
shutdown shutdown
interface FastEthernet0/6 interface FastEthernet0/6
switchport access vlan 200 switchport access vlan 200
switchport mode access switchport mode access
spanning-tree portfast spanning-tree portfast
interface range FastEthernet0/7-12 ip dhcp snooping limit rate 20
switchport trunk native vlan 666 interface range FastEthernet0/7-12
switchport mode trunk switchport trunk native vlan 666
switchport nonegotiate switchport mode trunk
interface range FastEthernet0/13-14 switchport nonegotiate
shutdown ip dhcp snooping trust
interface range FastEthernet0/15-48 interface range FastEthernet0/13-14
switchport access vlan 100 shutdown
switchport mode access interface range FastEthernet0/15-24
spanning-tree portfast switchport access vlan 200
interface range GigabitEthernet0/1-2 switchport mode access
shutdown spanning-tree portfast
interface Vlan99 interface range GigabitEthernet0/1-2
ip address 172.16.99.5 255.255.255.0 shutdown
ip default-gateway 172.16.99.1 interface range FastEthernet0/25-48
line con 0 shutdown
exec-timeout 0 0 interface Vlan99
logging synchronous ip address 172.16.99.6 255.255.255.0
line vty 0 15 ip default-gateway 172.16.99.1
password pass line con 0
login exec-timeout 0 0
end logging synchronous
line vty 0 15
password pass
login
Page 10 of 10