Posts tagged switch
How to configure a VTP Server and Client
Oct 25th
VLAN Trunking Protocol (VTP) is Cisco’s proprietary protocal for propagating VLAN information that exists on one switch to another switch. The advantage of VTP is that it eliminates the need to create VLANs on each individual switch within a site. Instead you only need to create your VLANs on the switch you designate as the server and assign your other switches to the role of a client.
For the purposes of this example Switch A will be the VTP Server and Switch B will be the VTP client.
- Setup VTP server role for Switch A
- Create VLANs on Switch A
- Setup VTP client role for Switch B
- Setup 802.1q Trunking between Switch A and Switch B
- Assign VLANs to specific interfaces
The configuration goes like this:
1. Setup VTP server on Switch A
SwitchA#vlan database (enter vlan configuration mode)
SwitchA(vlan)#vtp server (sets the VTP mode)
SwitchA(vlan)#vtp password MYPASSWORD (optional, assign a password to the VTP domain)
SwitchA(vlan)#vtp domian CORP (assigns a name to the VTP domain)
SwitchA(vlan)#exit (exit vlan configuration mode)
2. Create VLANs on Switch A (the VTP server)
SwitchA#configure teminal (enter into configuration mode)
SwitchA(config)#vlan 2 (defines the vlan, in this case vlan 2)
SwitchA(config)#vlan 2 name accounting (assigns a name to the vlan for description)
SwitchA(config)#exit (exit configuration mode)
3. Setup VTP client role on Switch B
SwitchB#vlan database (enter vlan configuration mode)
SwitchB(vlan)#vtp client (sets the VTP mode)
SwitchB(vlan)#vtp domain CORP (defines the VTP domain name)
SwitchB(vlan)#vtp password MYPASSWORD (the password for the VTP domain)
SwitchB(vlan)#exit (exits VTP configuration mode)
4. Setup Trunking between Switch A and Switch B
SwitchA(config)#configure terminal (enter the configuration mode)
SwitchA(config)#interface fastethernet 0/1 (select ethernet port 1)
SwitchA(config-if)#switchport mode trunk (set port 1 as a trunk port)
SwitchA(config-if)#switchport trunk encapsulation dot1q (set the trunk type)
SwitchA(config-if)#end (exit configuration mode)SwitchB(config)#interface fastethernet 0/1 (select ethernet port 1)
SwitchB(config-if)#switchport mode trunk (set port 1 as a trunk port)
SwitchA(config-if)#switchport trunk encapsulation dot1q (set the trunk type)
SwitchB(config-if)#end (exit configuration mode)
5. Assign VLANs to particular interfaces
SwitchA(config)#configure terminal (enter configuration mode)
SwitchA(config)#interface fastethernet 0/2 (select the interface)
SwitchA(config-if)# switchport access vlan2 (assign the VLAN to the interface)
SwitchA(config-if)#exit (exit interface configuration)
Of course there are a few other options, but the above example covers all the basics you need to know to setup VTP on your switches.
Helpful Cisco Documents
Jun 11th
I always need to look up features on different Cisco routers and switches. Cisco actually produces two documents that let you quickly see all the available models and associated features:
How to find the port a device is plugged into
Jun 3rd
Have you ever needed to quickly find out which switch port a network device is plugged into and you only know the IP address of the device? You could always trace the cables in your data closet and drive yourself crazy or you could use a few simple commands on your switch and quickly find it.
sh ip arp | inc <ip address>
This will return the mac address
sh mac-address-table | inc <mac address>
This will return the switch port
If the IP address is on another switch, the port that is returned in the output will be for the trunked port that goes to the next “hop”. Go to the next switch and repeat.
sh run int <switch port>
This will return the config for that interface
Here is an example:
switch01#sh ip arp | inc 172.16.11.200
Internet 172.16.11.200 0 0080.a38a.10dc ARPA Vlan11
switch01#sh mac-address-table | inc 0080.a38a.10dc
11 0080.a38a.10dc dynamic ip GigabitEthernet3/3
switch01#sh run int gi3/3
Building configuration…
Current configuration : 152 bytes
!
interface GigabitEthernet3/3
description IBM APPLICATION SERVER
switchport access vlan 11
switchport mode access
qos trust dscp
spanning-tree portfast
end
switch01#
