VTP, Inter-VLAN CSE-310 Fall-24
VTP, Inter-VLAN CSE-310 Fall-24
Department of CSE
CSE-310
Week 10 ( VTP, inter-VLAN )
VLAN Recap
Advantages of VLAN
➢ Solve broadcast problem
➢ Reduce size of the broadcast
➢ Allow additional layer of security
➢ Make device management easier.
➢Simpler project and application management.
VTP
Now, instead of a single switch in the above mentioned LAN, if there are 2000
switches connected throughout the network then we have to create VLANs in all
those switches individually. As a result the process will become time consuming
and the device management will be complex again.
That’s why we use VTP, a layer 2 messaging protocol that maintains VLAN
configuration consistency by managing addition, deletion and naming of VLANs
with a VTP domain. And this VTP protocol greatly simplifies network
administration. It helps to centralize changes which are sent to other switches.
VTP Mode
1. Server Switch
✓ Switches are set to this mode by default.
✓ Allows to create, add, delete VLANs and specify other configuration
parameters.
✓Any changes should be done in this mode and will be advertised to all the
switches that are in the same VTP domain.
2. Client Switch
✓ Switches receive the update and forward the update to other switches of
the same VTP domain.
✓ Can not create, delete, change VLANs on a VTP client.
3. Transparent Switch
✓ Only forwards the VTP summary advertisements through the trunk link
but doesn’t advertise its VLAN config and also doesn’t synchronize on
received advertisements.
✓ Can create and delete VLANs on a VTP transparent switch, but the
changes will not be sent to other switches.
VTP Advertisement
● Client Advertisement Request
✓ Messages are sent by VTP clients to VTP servers to request VLAN and
VTP information they may be missing.
✓ Server responds with both summary and subset advertisements.
● Summary Advertisement:
✓ Sent out every 300 sec by default or when a configuration change occurs
which is the summarized VLAN info (Version, domain name, revision
number etc.).
● Subset Advertisement
✓ Send when a VLAN configuration change occurs.
✓ Contains specific changes that have been performed in server switch
(add, delete & change VLAN name, status etc.).
Create VLANs in the above mentioned network and make sure that PCs in a
certain VLAN can communicate among themselves.
Command
First assign IP to each host/end device.
Switch0
Switch> en
Switch# conf t
Switch(config)# hostname vtpserver
vtpserver(config)# vtp ver 2
vtpserver(config)# vtp domain dsi
vtpserver(config)# vtp password nm
vtpserver(config)# vtp mode server
vtpserver(config)# vlan 2
vtpserver(config-vlan)# name admin
vtpserver(config-vlan)# vlan 3
vtpserver(config-vlan)# name hr
vtpserver(config-vlan)# ex
vtpserver(config)# int range f0/1-2
vtpserver(config-if-range)# switchport mode trunk
vtpserver(config-if-range)# ex
Switch1
Switch> en
Switch# conf t
Switch(config)# hostname vtpclient1
vtpclient1(config)# vtp ver 2
vtpclient1(config)# vtp domain dsi
vtpclient1(config)# vtp password nm
vtpclient1(config)# vtp mode client
vtpclient1(config)# int f0/2
vtpclient1(config-if)# switchport mode access
vtpclient1(config-if)# switchport access vlan 3
vtpclient1(config-if)# ex
vtpclient1(config)# int f0/3
vtpclient1(config-if)# switchport mode access
vtpclient1(config-if)# switchport access vlan 2
vtpclient1(config-if)# ex
Switch2
Switch>en
Switch#conf t
Switch(config)#hostname vtpclient2
vtpclient2(config)#vtp ver 2
vtpclient2(config)#vtp domain dsi
vtpclient2(config)#vtp pass nm
vtpclient2(config)#vtp mode client
vtpclient2(config)#int f0/2
vtpclient2(config-if)#switchport mode access
vtpclient2(config-if)#switchport access vlan 3
vtpclient2(config-if)#ex
vtpclient2(config)#int f0/3
vtpclient2(config-if)#switchport mode access
vtpclient2(config-if)#switchport access vlan 2
vtpclient2(config-if)#ex
Additional Instruction:
Switch(config)# do show vtp status
Task 2:
In addition to the commands for task1, the following command should be given.
Command
Switch0
Switch>en
Switch#conf t
vtpserver>en
vtpserver#conf t
vtpserver(config)#vlan 4
vtpserver(config-vlan)#name dev
vtpserver(config-vlan)#ex
Switch3
Switch>en
Switch#conf t
Switch(config)#hostname vtpclient3
vtpclient3(config)#vtp ver 2
vtpclient3(config)#vtp domain dsi
vtpclient3(config)#vtp pass nm
vtpclient3(config)#vtp mode client
vtpclient3(config)#int f0/1
vtpclient3(config-if)#switchport mode trunk
vtpclient3(config-if)#ex
vtpclient3(config)#int f0/2
vtpclient3(config-if)#switchport mode access
vtpclient3(config-if)#switchport access vlan 2
vtpclient3(config-if)#ex
vtpclient3(config)#int f0/3
vtpclient3(config-if)#switchport mode access
vtpclient3(config-if)#switchport access vlan 4
vtpclient3(config-if)#ex
InterVLAN
● InterVLAN routing is a process in which different VLANs communicate with
each other irrespective of where the VLANs are present (on the same or
different switch).
● InterVLAN routing can be achieved through a layer 3 device (router).
● When the interVLAN routing is done through a router, it is known as Router
on a stick.
Router-on-a-stick
● It is a type of configuration in which you are able to use a single physical
interface to route traffic between multiple VLANs.
● The switchport connecting to the router is configured as a trunk link.
● The router accepts traffic that is tagged from the VLANs on the switch
through the trunk link.
● On the router, the physical interface is divided into smaller interfaces known
as sub-interfaces.
● When the router receives the tagged traffic, it forwards the traffic out to
the sub-interface that has the destination IP address.
● Each sub-interface is configured with an IP address and assigned a VLAN
based on the design.
Encapsulation dot1q
To enable IEEE 802.1q encapsulation of traffic on a specified sub interface.
IEEE 802.1q: Standard protocol for interconnecting multiple switches and routers.
Some instructions:
encapsulation dot1q ‘vlan-id’
no encapsulation dot1q ‘vlan-id’
Task 3:
Divide the following network into the mentioned VLANs and make sure that hosts
of the VLANs can communicate among themselves. Also make sure that VLAN-2
can communicate with VLAN-4.
Switch0
Switch> en
Switch# conf t
Switch(config)# vlan 2
Switch(config-vlan)# name v2
Switch(config-vlan)# vlan 3
Switch(config-vlan)# name v3
Switch(config-vlan)# vlan 4
Switch(config-vlan)# name v4
Switch(config-vlan)# ex
Switch(config)# int range f0/1-2
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 2
Switch(config-if-range)# ex
Switch(config)# int range f0/3
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 3
Switch(config-if-range)# ex
Switch(config)# int range f0/4-5
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 4
Switch(config-if-range)# ex
Switch(config)# int range f0/6
Switch(config-if-range)# switchport mode trunk
Switch(config-if-range)# ex
Router1
Router>en
Router#conf t
Router(config)#int f0/0
Router(config-if)#no shut
Router(config-if)#int f0/0.10
Router(config-subif)#encapsulation dot1q 2
Router(config-subif)#ip address 192.168.10.1 255.255.255.0
Router(config-subif)#ex
Router(config)#int f0/0.30
Router(config-subif)#encapsulation dot1q 4
Router(config-subif)#ip address 192.168.30.1 255.255.255.0
Router(config-subif)#ex
Task 4:
Design the above network in cisco packet tracer. Now implement the following
tasks.
● Assign IP to each end device (PC, Laptop, Server)
● Create and rename VLAN in server switch (Switch 0)
● Assign IP to each router interface
● Divide the office’s network into mentioned VLANs and make sure that only
Admin and Server can communicate with each other