You are on page 1of 5

RouteronaStick

CCNATutorial
ShaneKillian
http://www.shanekillian.net
shane@shanekillian.net

Overview
Forhostindifferentvlanstocommunicate,alayer3devicemustbeimplementedtoroutebetween
thevlans.Inourcasewewillhavearouterconnectedtoaswitchviaafastethernetportwhichwill
beconfiguredintrunkingmode.

Topology

Inourexamplewewillhavetwovlans:
VLAN10192.168.1.0/24
VLAN20192.168.2.0/24
Ontherouterwewillconfiguretwofastethernetsubinterfaces(f0/0.10andf0/0.20),oneforeachof
thevlansontheswitch(eachsubinterfacewillbegivenanipaddressinitsrespectivevlan).We
willhavetwoPC'sconnectedtotheswitch(oneineachvlan)onportsf0/1andf0/2.

IntheexampleaboveIamusingaCisco3600routerwithIOSc3640jsmz.12421.bin,however
fortheswitchinmycaseIamusinga3600routerwitha16portNM16ESWmoduleinstalled,this
particularmodule.YoucanreadmoreabouttheNM16ESWmoduleathttp://tinyurl.com/5owu6x
YouofcourseuseaCiscoswitchforthesamepurpose.

SwitchConfiguration
Thefirstthingthatweneedtodoisconfigureourswitch.
IwillbeconfiguringtheswitchwiththehostnameSW0
Whenaskedifyouwouldliketoentertheinitialconfigurationdialogue,typenoandhitreturn.
Nowconfigurethehostname:
Router>enable
Router#configureterminal
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Router(config)#hostnameSW0
SW0(config)#
Onceyouhaveconfiguredthehostnametypeexitandhitreturn
Nowweneedtoaddouttwovlans(vlan10andvlan20)tothevlandatabase:
SW0#
SW0#vlandatabase
SW0(vlan)#vlan10
VLAN10added:
Name:VLAN0010
SW0(vlan)#vlan20
VLAN20added:
Name:VLAN0020
SW0(vlan)#apply
APPLYcompleted.
SW0(vlan)#

Nowecanconfiguref0/0asatunkinterfacetotherouter:
SW0(config)#intf0/0
SW0(configif)#switchporttrunkencapsulationdot1q
SW0(configif)#switchportmodetrunk
SW0(configif)#

Nextweneedtoconfiguref0/1asanaccessportforPC1andf0/2asanaccessportforPC2:
SW0(configif)#
SW0(configif)#intf0/1
SW0(configif)#switchportaccessvlan10
SW0(configif)#switchportmodeaccess
SW0(configif)#
SW0(configif)#intf0/2
SW0(configif)#switchportaccessvlan20
SW0(configif)#switchportmodeaccess
SW0(configif)#^Z
SW0#
*Mar100:09:52.107:%SYS5CONFIG_I:Configuredfromconsolebyconsole
SW0#wr
Buildingconfiguration...
[OK]
SW0#SW0(config)#

RouterConfiguration
We'llconfiguretherouterwiththehostnameR0andthenaddthevlans(10and20)tothevlan
databaseontherouter:
Router>enable
Router#configureterminal
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Router(config)#hostnameR0
R0(config)#
R0(config)#
R0(config)#vlandatabase
R0(config)#exit
R0#
*Mar100:15:03.399:%SYS5CONFIG_I:Configuredfromconsoleby
console
R0#
R0#vlandatabase
R0(vlan)#vlan10
VLAN10added:
Name:VLAN0010
R0(vlan)#vlan20
VLAN20added:
Name:VLAN0020
R0(vlan)#apply
APPLYcompleted.
R0(vlan)#exit
APPLYcompleted.
Exiting....

Nowweneedtoenabletof0/0interfaceontherouterandconfiguresubinterfaces(f0/0.10and
f0/0.20withIPaddresses):
R0(configif)#
R0(configif)#
R0(configif)#intf0/0.10
R0(configsubif)#encapsulationdot1q10
R0(configsubif)#ipaddress192.168.1.1255.255.255.0
R0(configsubif)#
R0(configsubif)#intf0/0.20
R0(configsubif)#encapsulationdot1q20
R0(configsubif)#ipaddress192.168.2.1255.255.255.0
R0(configsubif)#
R0(configsubif)#^Z
R0#
*Mar100:25:49.183:%SYS5CONFIG_I:Configuredfromconsoleby
console
R0#
R0#exit
Thisistherouterconfigurationcomplete.
YounowneedtoconfigurePC1withthefollowing:
IP192.168.1.2
SubnetMask255.255.255.0
DefaultGateway192.168.1.1
YouneedtoconfigurePC2withthefollowing:
IP192.168.2.2
SubnetMask255.255.255.0
DefaultGateway192.168.2.1
YoushouldnowbeabletopingPC2fromPC1toverifyconnectivity.

You might also like