You are on page 1of 35

Chapter 8

VLAN & Trunking

Objectives
Upon completion of this chapter, you will be able to perform the following tasks:
Configure a VLAN Configure VLAN Trunking Protocol (VTP) Configure a switch for trunking Configure a router for trunking Routing between Vlans Verify VLAN connectivity

VLAN introduction

VLAN Overview

Segmentation
Flexibility Security

A VLAN = A broadcast domain = Logical network (subnet)

Benefits of VLANs

Easily move workstations on the LAN. Easily add workstations to the LAN. Easily change the LAN configuration. Easily control network traffic. Improve security.

VLAN Operations
Switch A
Trunk
Fast Ethernet

Switch B

Red VLAN

Black VLAN

Green VLAN

Red VLAN

Black VLAN

Green VLAN

Each logical VLAN is like a separate physical bridge VLANs can span across multiple switches Trunks carries traffic for multiple VLANs Trunks use special encapsulation to distinguish between different VLANs

VLAN Membership Modes

Static VLAN
Trunk

Dynamic VLAN

Port e0/4
VLAN5

Port e0/9
VLAN10

VMPS 1111.1111.1111 = vlan 10


MAC = 1111.1111.1111

VLAN CONFIGURATION

Configuring Static VLANs


Create VLANs: Switch# vlan database Switch(vlan)# vlan <vlan_number> name <vlan name> Switch(vlan)# exit Assign ports to VLANs: Switch(config)# interface fastethernet 0/9 Switch(config-if)#switchport access vlan <vlan_number> Deleting VLANs Use the no form of the command. EX : Create VLANs: Switch# vlan database Switch(vlan)# vlan 2 name VlanBGD Switch(vlan)# exit Assign ports to VLANs: Switch(config)# interface fastethernet 0/9 Switch(config-if)#switchport access vlan 2 Deleting VLANs Use the no form of the command.

Verifying and save VLAN configuration

show vlan copy running-config startup-config Copy running-config TFTP

TRUNKING

Trunking concept
A trunk is a single communications line that carries data of multiple Vlans.

VLAN1

VLAN1

VLAN1

VLAN2

VLAN2

VLAN2

VLAN1
TRUNK VLAN2 VLAN1 and VLAN2

VLAN1

VLAN2

VLANs and trunking

ISL 802.1Q (dot1q)

Frames Tagging

ISL 802.1Q (dot1q)

ISL Tagging
ISL trunks enable VLANs across a backbone

VLAN Tag added by incoming port

Inter-Switch Link carries VLAN identifier

Not intrusive to client stations, client does not see the ISL header Effective between switches, routers and switches, switches and servers with ISL network interface cards

VLAN Tag stripped by forwarding port

ISL Encapsulation
ISL Header 26 bytes CRC 4 bytes

Encapsulated Ethernet frame

DA

Type User

SA LEN AAAA03 HSA VLAN BPDU BPDU INDEX RES VLAN BPDU

Frames encapsulated with ISL header and CRC Support for many VLANs (1024) VLAN field BPDU bit

IEEE 802.1q
Dest Src Len/Type Data FCS

Dest

Src

Type

Tag

Len/Type

Data

FCS

Priority

VLAN ID

802.1q does not actually encapsulate the original frameinstead, it adds an extra 4-byte header to the middle of the original Ethernet header. 802.1q encapsulation forces a recalculation of the original FCS field in the Ethernet trailer

ISL and 802.1q Compared

Both ISL and 802.1q provide trunking. Both allow the use of a 12-bit-long VLAN ID field. So, either works fine and supports the same number of VLANs. Both support a separate instance of spanning tree for each VLAN. The header used by each varies, and only ISL actually encapsulates the original frame.

Trunking implementation

Switch# show port capabilities


Switch # configure terminal Switch(config)# interface f0/1 Switch(config-if)# Switchport mode trunk. Switch(config-if)# Switchport trunk encapsulation dot1q/isl Switch # Show trunk

INTER-VLAN ROUTING OVERVIEW

Inter-VLAN issues and solutions


Every Vlan is one subnetwork. When a host on one VLAN wants to communicate with a host on another, a router must be involved. Networks with many VLANs must use VLAN trunking to assign multiple VLANs to a single router interface.

Dividing a Physical Interface into Subinterfaces

Physical interfaces can be divided into multiple subinterfaces.

Physical and logical interfaces

Configuring Router for Trunking


Router(config)#Interface fastethernet port-number Router(config-if)#no shutdown Router(config-if)#exit Router(config)# interface fastethernet port-number. Subinterface-number Router(config-if)#encapsulation dot1q/isl vlan-number Router(config-if)#ip address <Ip address> <Subnetmask>

EX : Configuring Router for Trunking

R1 F0/0.10:192.168.1.254 F0/0.12:192.168.2.254 F0/0.13:192.168.3.254 SW2 .1.20 .2.20 .3.20 .1. 10 Vlan3 SW1

.2.10

.3.10

Vlan1 Vlan2

Vlan1 Vlan2 Vlan3

Configuring router
Router(config)#Interface fastethernet 0/0 Router(config-if)#no shutdown Router(config-if)#exit
SW2 .1.20 .2.20 .3.20 .1. 10 Vlan3 Vlan1 Vlan2

R1 F0/0.10:192.168.1.254 F0/0.12:192.168.2.254 F0/0.13:192.168.3.254 SW1 .2.10 .3.10

Vlan1 Vlan2 Vlan3

Router(config)#interface fastethernet 0/0.10 Router(config-subif)#ip address 192.168.1.254 255.255.255.0 Router(config-subif)#encapsulation dot1q 1 Router(config)#interface fastethernet 0/0.12 Router(config-subif)#ip address 192.168.2.254 255.255.255.0 Router(config-subif)#encapsulation dot1q 2 Router(config)#interface fastethernet 0/0.300 Router(config-subif)#ip address 192.168.3.254 255.255.255.0 Router(config-subif)#encapsulation dot1q 3

Switch(config)#interface fastethernet 0/1 Switch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk encapsulation dot1q

VTP

VLAN Trunking Protocol (VTP)


A messaging system that advertises VLAN configuration information Maintains VLAN configuration consistency throughout a common administrative domain VTP sends advertisements on trunk ports only Support mixed media trunks (Fast Ethernet, FDDI, ATM) VTP Domain ICND 3.Sync to the latest vlan information

2 1.new vlan added

VTP Modes
Create vlans Modify vlans Delete vlans Sends/forwards advertisements Synchronize Saved in NVRAM

Forwards advertisements Synchronize Not saved in NVRAM

Transparent

Create vlans Modify vlans Delete vlans Forwards advertisements Does not synchronize Saved in NVRAM

How VTP Works


VTP advertisements are sent as multicast frames VTP servers and clients synchronized to latest revision number

VTP advertisement are sent every five minutes or when there is a change

1.Add new VLAN 2.Rev 3 --> Rev 4

Server

4.Rev 3 --> Rev 4 5.Sync new vlan info


Client Client

4.Rev 3 --> Rev 4 5.Sync new vlan info

VTP Pruning
Increases available bandwidth by reducing unnecessary flooded traffic Example: Station A sends broadcast, broadcast is only flooded toward any switch with ports assigned to the red VLAN
Port 2

Switch 4 Flooded traffic is pruned

Switch 2 Switch 5 Red VLAN

Port 1

Switch 6

Switch 3

Switch 1

VLAN Configuration Guidelines

Maximum number of VLANs is switch-dependent Catalyst 1900 supports 64 VLANs with a separate spanning tree per VLAN VLAN1 is One of the factory default VLANs CDP and VTP advertisements are sent on VLAN1 Must be in VTP server or transparent mode to create, add, or delete VLANs

VLAN Configuration Steps

Enable VTP (optional) Enable trunking

Create VLANs
Assign VLAN to ports

VTP Configuration Guidelines


VTP domain name VTP mode (server/client/transparent) VTP server mode is the default VTP pruning VTP password
wg_sw_2950#vlan database wg_sw_2950(vlan)#vtp [ server | client | transparent ] wg_sw_2950(vlan)#vtp domain domain-name wg_sw_2950(vlan)#vtp password password wg_sw_2950(vlan)#vtp pruning wg_sw_2950(vlan)#exit

Use caution when adding a new switch into an existing domain. A new switch should be added in client mode to prevent the new switch from propagating incorrect VLANs information Use the delete vtp command to reset the VTP revision number

Verifying VTP Configurations

wg_sw_a#show vtp
wg_sw_a#show vtp VTP version: 1 Configuration revision: 4 Maximum VLANs supported locally: 1005 Number of existing VLANs: 6 VTP domain name : switchlab VTP password : VTP operating mode : Transparent VTP pruning mode : Enabled VTP traps generation : Enabled Configuration last modified by: 10.1.1.40 at 00-00-0000 00:00:00

You might also like