Professional Documents
Culture Documents
Overview
Forhostindifferentvlanstocommunicate,alayer3devicemustbeimplementedtoroutebetween thevlans.Inourcasewewillhavearouterconnectedtoaswitchviaafastethernetportwhichwill beconfiguredintrunkingmode.
Topology
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)#
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.