Configurations

You can purchase Cisco switches, install devices with the correct cabling, turn on the switches, and they work. You would never need to configure the switch and it would work fine, even if you interconnected switches-until you needed more than one VLAN. Even the default STP and trunking settings would likely work just fine, but if you want to use VLANs, you need to add some configuration.

In real networks, VLANs are the most likely feature to be configured on a switch. Almost every network uses them, and there is no reasonable dynamic way to assign specific ports to specific VLANs. So you simply need to configure the switch to know which ports are in which VLANs.

You can also configure VTP and trunking. VTP is on by default, and trunking negotiation is attempted on all ports by default. So, although you might not be required to configure either VTP or trunking in a real network you should certainly be ready to configure VTP and trunking for the exams.

Command Description
vlan database EXEC command that puts the user in VLAN configuration mode.
vtp {domain domain-name | password password | pruning | v2-mode | {server | client | transparent}} Defines VTP parameters in VLAN configuration mode.
vlan vlan-id [name vlan-name] VLAN database configuration command that creates and names a VLAN.
switchport mode {access | dynamic {auto | desirable} | trunk} Interface subcommand that configures the interface for trunking.
switchport trunk {{allowed vlanvlan-list} | {native vlan vlan-id} | {pruning vlan vlan-list}} Interface subcommand that refines the list of allowed VLANs, defines the 802.1Q native VLAN, and limits the range of VLANs for which pruning can occur.
switchport access vlan vlan-id Interface subcommand that statically configures the interface into that one VLAN.
show interfaces [interface-id | vlanvlan-id] [switchport | trunk] Displays trunk status.
show vlan [brief | id vlan-id | namevlan-name | summary] EXEC command that lists information about the VLAN.
show vlan [vlan] Displays VLAN information.
show vtp status Lists VTP configuration and status information.
show spanning-tree vlan vlan-id EXEC command that lists information about the spanning tree for a particular VLAN.

Switches like Cisco Catalyst 3560 or Cisco Catalyst 3750 are Layer 3 switches (L3), which means that they can be used as a routers. As you already know, if we have two devices in different VLANs we must have L3 device which will do interVLAN routing.

Here is an example of configuring Cisco Catalyst 3560 switch with interVLAN capabilities:

CiscoTests-3560#sh run
Building configuration...

Current configuration : 8459 bytes
!
version 12.2
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname CiscoTests-3560
!
enable secret 5 $1$I6Rl$2H9uCxhfFZ5844trhNwo71
!
no aaa new-model
ip subnet-zero
ip routing
!

!
interface FastEthernet0/4
description Port for Agent
switchport access vlan 10
switchport mode access
speed 100
duplex full
spanning-tree portfast
!
interface FastEthernet0/5
description Port for Agent
switchport access vlan 10
switchport mode access
speed 100
duplex full
spanning-tree portfast
!
interface FastEthernet0/6
description Port for Agent
switchport access vlan 10
switchport mode access
speed 100
duplex full
spanning-tree portfast
!

!
interface FastEthernet0/39
description Port for Server
switchport access vlan 20
switchport mode access
speed 100
duplex full
spanning-tree portfast
!
interface FastEthernet0/40
description Port for Server
switchport access vlan 20
switchport mode access
speed 100
duplex full
spanning-tree portfast
!

!
interface FastEthernet0/48
description Link_to_R2811-GW
no switchport
ip address 172.16.252.253 255.255.255.128
!

!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
description Agent’s VLAN
ip address 10.2.0.126 255.255.255.128
no ip route-cache cef
no ip route-cache
!
interface Vlan20
description Server’s VLAN
ip address 10.2.0.254 255.255.255.128
no ip route-cache cef
no ip route-cache
!
ip classless
ip route 0.0.0.0 0.0.0.0 172.16.252.254

Our Recommended Premium CCNA Training Resources

These are the best CCNA training resources online:

Click Here to get the Cisco CCNA Gold Bootcamp, the most comprehensive and highest rated CCNA course online with a 4.8 star rating from over 30,000 public reviews. I recommend this as your primary study source to learn all the topics on the exam. Cisco CCNA Gold Bootcamp
Want to take your practice tests to the next level? AlphaPreps purpose-built Cisco test engine has the largest question bank, adaptive questions, and advanced reporting which tells you exactly when you are ready to pass the real exam. Click here for your free trial. Cisco CCNA Gold Bootcamp