
BCMSN Exam Certification Guide
.pdf
476 Chapter 20: Securing with VLANs
■Host—The switch port connects to a regular host that resides on an isolated or community VLAN. The port communicates only with a promiscuous port or ports on the same community VLAN.
Figure 20-1 shows the basic private VLAN operation. Some host PCs connect to a secondary community VLAN. The two community VLANs associate with a primary VLAN, where the router connects. The router connects to a promiscuous port on the primary VLAN. A single host PC connects to a secondary isolated VLAN, so it can communicate only with the router’s promiscuous port.
Figure 20-1 Private VLAN Functionality Within a Switch
|
|
Secondary VLAN 10 |
|
|
|
1/1 |
(Community) |
|
|
|
|
|
||
|
1/2 |
|
|
|
|
|
Secondary VLAN 30 |
2/1 |
|
Host Ports |
1/3 |
(Isolated) |
||
|
||||
|
|
|
Primary VLAN |
|
|
|
|
(Promiscuous) |
|
|
1/4 |
|
|
|
|
1/5 |
|
|
|
|
|
Secondary VLAN 20 |
|
|
|
|
(Community) |
|

Private VLANs 477
Private VLAN Configuration
Defining a private VLAN involves several configuration steps. These steps are described in the sections that follow so you can use them.
Configure the Private VLANs
To configure a private VLAN, begin by defining any secondary VLANs that are needed for isolation using the following configuration commands:
Switch(config)# vlan vlan-id
Switch(config-vlan)# private-vlan {isolated | community}
The secondary VLAN can be an isolated VLAN (no connectivity between isolated ports) or a community VLAN (connectivity between member ports).
Now, define the primary VLAN that will provide the underlying private VLAN connectivity using the following configuration commands:
Switch(config)# vlan vlan-id Switch(config-vlan)# private-vlan primary
Switch(config-vlan)# private-vlan association {secondary-vlan-list | add secondary-vlan- list | remove secondary-vlan-list}
Be sure to associate the primary VLAN with all of its component secondary VLANs using the association keyword. If the primary VLAN has already been configured, you can add (add) or remove (remove) secondary VLAN associations individually.
These VLAN configuration commands set up only the mechanisms for unidirectional connectivity from the secondary VLANs to the primary VLAN. You must also associate the individual switch ports with their respective private VLANs.
Associate Ports with Private VLANs
First, define the function of the port that will participate on a private VLAN using the following configuration command:
Switch(config-if)# switchport mode private-vlan {host | promiscuous}
If the host connected to this port is a router, firewall, or common gateway for the VLAN, use the promiscuous keyword. This allows the host to reach all other promiscuous, isolated, or community ports associated with the primary VLAN. Otherwise, any isolated or community port must receive the host keyword.

478 Chapter 20: Securing with VLANs
For a nonpromiscuous port (using the switchport mode private-vlan host command), you must associate the switch port with the appropriate primary and secondary VLANs. Remember, only the private VLANs themselves have been configured until now. The switch port must know how to interact with the various VLANs using the following interface configuration command:
Switch(config-if)# switchport private-vlan host-association primary-vlan-id secondary- vlan-id
NOTE Configuring a static access VLAN on a switch port when the port is associated with private VLANs is not necessary. Instead, the port takes on membership in the primary and secondary VLANs simultaneously. This does not mean that the port has a fully functional assignment to multiple VLANs. Instead, it takes on only the unidirectional behavior between the secondary and primary VLANs.
For a promiscuous port (using the switchport mode private-vlan promiscuous command), you must map the port to primary and secondary VLANs. Notice that promiscuous mode ports, or ports that can communicate with any other private VLAN device, are mapped, while other secondary VLAN ports are associated. One (promiscuous mode port) exhibits bidirectional behavior, while the other (secondary VLAN ports) exhibits unidirectional or logical behavior.
Use the following interface configuration command to map promiscuous mode ports to primary and secondary VLANs:
Switch(config-if)# switchport private-vlan mapping {primary-vlan-id} {secondary- vlan-list} | {add secondary-vlan-list} | {remove secondary-vlan-list}
As an example, assume the switch in Figure 20-1 is configured as in Example 20-2. Host PCs on ports FastEthernet 1/1 and 1/2 are in community VLAN 10, hosts on ports FastEthernet 1/4 and 1/5 are in community VLAN 20, and the host on port FastEthernet 1/3 is in isolated VLAN 30. The router on port FastEthernet 2/1 is in promiscuous mode on primary VLAN 100. Each VLAN is assigned a role, and the primary VLAN is associated with its secondary VLANs. Then, each interface is associated with a primary and secondary VLAN (if a host is attached) or mapped to the primary and secondary VLANs (if a promiscuous host is attached).
Example 20-2 Configuring Ports with Private VLANs
Switch(config)# vlan 10
Switch(config-vlan)# private-vlan community
Switch(config)# vlan 20
Switch(config-vlan)# private-vlan community
Switch(config)# vlan 30
Switch(config-vlan)# private-vlan isolated
Switch(config)# vlan 100
Switch(config-vlan)# private-vlan primary
Switch(config-vlan)# private-vlan association 10,20,30



Switch Port Monitoring 481
Local SPAN and VSPAN
The SPAN source can be identified as one or more physical switch ports, a trunk, or a VLAN. Packets that are being forwarded from the destination are also copied into the destination port’s queue. Because the packets are merely copied, neither the original data nor its being forwarded is affected. Figure 20-2 demonstrates two cases where a network analyzer on the SPAN destination port is receiving frames that SPAN has copied from the source port. Here, SPAN session A monitors all communication on VLAN 100. SPAN session B uses a normal access mode source port to monitor communication between a server and its client PCs.
Figure 20-2 Basic Local SPAN and VSPAN Operation
File Server
|
|
A: VSPAN |
|
|
|
|
|
|
|
|
|
Server |
|
PC |
|||
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
|
B: Source |
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
||||||
|
Source - VLAN 100 |
|
|
|
|
|
|
|
|
|
|||||||
|
Port |
|
|
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
B: Destination |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Port |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Network |
|
|
|
|
|
|
|
|
|
|
|
Network |
|||||
Analyzer |
|
|
|
|
|
|
|
|
|
|
|
Analyzer |
|||||
|
A |
|
|
|
|
|
|
|
|
|
|
|
|
B |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PC
What happens if a speed mismatch occurs between the SPAN source and destination ports? This could easily happen if the source is a VLAN with many hosts, or if the source is a GigabitEthernet port and the destination is a FastEthernet port.
Packets are copied only into the destination port’s egress queue. If the destination port becomes congested, the SPAN packets are dropped from the queue and are not seen at the destination port. Therefore, if the bandwidth of source traffic exceeds the destination port speed, some packets might not be seen at the destination port. Then, traffic from the SPAN source is not affected by any congestion at the SPAN destination.



484 Chapter 20: Securing with VLANs
Example 20-4 Displaying the Currently Active SPAN Sessions (Continued)
Source RSPAN VLAN: None
Destination Ports: Gi0/2
Encapsulation: Native
Ingress: Disabled
Reflector Port: None
Filter VLANs: None
Dest RSPAN VLAN: None
CAUTION After you finish using a SPAN session, you should always disable or delete it. Otherwise, someone might try to connect to the port that is configured as the SPAN destination at some later date. You could spend a good bit of time troubleshooting that user’s connectivity problem only to find that you left a SPAN session active!
NOTE When Local SPAN or VSPAN is enabled, the Spanning Tree Protocol (STP) is disabled on the destination port. This allows STP BPDUs to be captured and monitored but also allows the possibility for a bridging loop to form. Never connect a SPAN session’s destination port back into an active network. If the monitored packets need to be sent toward another switch, use RSPAN instead.
Remote SPAN
In a large switched network or one that is geographically separated, it might not always be convenient to take a network analysis to the switch where a SPAN source is located. To make SPAN more extensible, Cisco developed the Remote SPAN (RSPAN) feature. With RSPAN, the source and destination can be located on different switches in different locations.
The RSPAN source is identified on one switch, just as with local SPAN. The RSPAN destination is identified on its local switch. Then, RSPAN can carry only the mirrored data over a special-purpose VLAN across trunk links and intermediate switches. As long as every switch along the way is RSPAN-capable, the source can be located at the far-end switch, while the network analyzer is conveniently located at the switch nearest you.
Figure 20-3 shows an example network using RSPAN where the packets from the file server (source port) on one switch are copied and transported over the RSPAN VLAN on trunk links. At the destination switch, packets are pulled off the RSPAN VLAN and copied to the network analyzer (destination port). The file server and network analyzer are stationed in geographically separate locations.

Switch Port Monitoring 485
Figure 20-3 Example of Remote SPAN Operation
Trunk |
Trunk |
Source |
RSPAN |
|
Port |
Trunk |
Destination
Port
Network
Analyzer
The RSPAN VLAN has some important differences from a regular VLAN. First, MAC address learning is disabled on the RSPAN VLAN. This is to prevent intermediate switches that transport the RSPAN VLAN from trying to forward the mirrored packets to their real destination MAC addresses. After all, the purpose of SPAN or RSPAN is to simply mirror or copy interesting frames—not forward them normally.
An RSPAN-capable switch also floods the RSPAN packets out all of its ports belonging to the RSPAN VLAN in an effort to send them toward the RSPAN destination. Intermediate switches have no knowledge of the RSPAN source or destination; rather, they know only of the RSPAN VLAN itself.
Remote SPAN Configuration
RSPAN configuration begins with the definition of the special-purpose RSPAN VLAN. If you configure the RSPAN VLAN on a VTP server, VTP correctly propagates it to other intermediate switches. If not using VTP, be sure to configure this VLAN for RSPAN explicitly on each intermediate switch. Otherwise, the RSPAN packets will not be delivered correctly.