Cisco Router Configuration Tutorial

60
Contents 1. What's covered 2. Getting started 3. Cisco Router Configuration 3.1 Global configuration 3.2 Configuring interfaces 3.3 Routing 3.4 IPv6 configuration with IOS 3.5 Saving your configuration 3.6 Example configuration 4. Troubleshooting 5. References 6. More information This work is licensed under a Creative Commons License. PDF version now available. Cisco Router Configuration Tutorial Josh Gentry, [email protected] v.1.4, 14 May, 2011 This document covers basic Cisco router IP configuration using the command-line interface Acknowledgments The following sources where extremely useful: Leinwand, Pinsky, and Culpepper. Cisco Router Configuration. Indianapolis, Indiana: Cisco Press, 1998. Cisco Systems, Inc., http://www.cisco.com Disclaimer This document carries no explicit or implied warranty. Nor is there any guarantee that the information contained in this document is accurate. It is offered in the hopes of helping others, but you use it at your own risk. The author will not be liable for any damages that occur as a result of using this document. Conventions Important terms and concepts, when they are introduced, may be displayed in bold. Commands included in the body of the text will be displayed in this font. All names and addresses used in examples are just that, examples, and should not be used on your network. Do not type them in verbatim when configuring your system. Finally, in some examples where the command rquires an IP address as an argument, the IP address may be represented in this way, xx.xx.xx.xx, or aa.bb.cc.dd. You will never actually use these strings when configuring your system. They are mearly a convention of this document to specify that you should substitute the appropriate IP address at that point. Cisco Configuration tool Free Configuration Management tool for Cisco Routers Switches Firewall ManageEngine.com/DeviceExpert Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm 1 of 60 10-12-2012 17:03

description

Cisco Router Configuration Tutorial

Transcript of Cisco Router Configuration Tutorial

Page 1: Cisco Router Configuration Tutorial

Contents

1. What's covered2. Getting started3. Cisco RouterConfiguration3.1 Global configuration3.2 Configuring interfaces3.3 Routing3.4 IPv6 configurationwith IOS3.5 Saving yourconfiguration3.6 Example configuration4. Troubleshooting5. References6. More information

This work is licensedunder a CreativeCommons License.

PDF versionnow available.

Cisco Router ConfigurationTutorialJosh Gentry, [email protected], 14 May, 2011

This document covers basic Cisco router IP configuration using thecommand-line interface

AcknowledgmentsThe following sources where extremely useful:

Leinwand, Pinsky, and Culpepper. Cisco Router Configuration.Indianapolis, Indiana: Cisco Press, 1998.Cisco Systems, Inc., http://www.cisco.com

DisclaimerThis document carries no explicit or implied warranty. Nor is there anyguarantee that the information contained in this document is accurate. It isoffered in the hopes of helping others, but you use it at your own risk. Theauthor will not be liable for any damages that occur as a result of using thisdocument.

ConventionsImportant terms and concepts, when they are introduced, may be displayed inbold. Commands included in the body of the text will be displayed in this

font. All names and addresses used in examples are just that, examples, andshould not be used on your network. Do not type them in verbatim whenconfiguring your system. Finally, in some examples where the commandrquires an IP address as an argument, the IP address may be represented inthis way, xx.xx.xx.xx, or aa.bb.cc.dd. You will never actually use these stringswhen configuring your system. They are mearly a convention of thisdocument to specify that you should substitute the appropriate IP address atthat point.

Cisco Configuration tool

Free Configuration Management toolfor Cisco Routers Switches Firewall

ManageEngine.com/DeviceExpert

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

1 of 60 10-12-2012 17:03

Page 2: Cisco Router Configuration Tutorial

1. What this documentcovers

There are several methods available forconfiguring Cisco routers. It can bedone over the network from a TFTPserver. It can be done through themenu interface provided at bootup, andit can be done from the menu interfaceprovided by using the command setup.This tutorial does not cover thesemethods. It covers configuration fromthe IOS command-line interface only.Useful for anyone new to Ciscorouters, and those studying for CCNA.

Note that this tutorial does not coverphysically connecting the router to thenetworks it will be routing for. Itcovers operating system configurationonly.

1.1 Reasons for using thecommand-line

The main reason for using thecommand-line interface instead of amenu driven interface is speed. Onceyou have invested the time to learn thecommand-line commands, you canperform many operations much morequickly than by using a menu. This isbasically true of all command-line vs.menu interfaces. What makes itespecially efficient to learn thecommand-line interface of the CiscoIOS is that it is standard across allCisco routers. Also, some questions onthe CCNA exam require you to knowcommand-line commands.

2. Getting started withCisco

Initially you will probably configureyour router from a terminal. If therouter is already configured and atleast one port is configured with an IPaddress, and it has a physicalconnection to the network, you mightbe able to telnet to the router andconfigure it across the network. If it isnot already configured, then you willhave to directly connect to it with a

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

2 of 60 10-12-2012 17:03

Page 3: Cisco Router Configuration Tutorial

terminalandaserialcable.WithanyWindowsboxyoucanuseHyperterminaltoeasilyconnecttotherouter.Plugaserialcableintoaserial(COM)portonthePCandtheotherendintotheconsoleportontheCiscorouter.StartHyperterminal,tellitwhichCOMporttouseandclickOK.Setthespeed

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

3 of 60 10-12-2012 17:03

Page 4: Cisco Router Configuration Tutorial

oftheconnectionto9600baud

andclickOK.Iftherouterisnoton,turniton.

IfyouwishtoconfiguretherouterfromaLinuxbox,eitherSeyonorMinicomshouldwork.Atleastoneofthem,andmaybeboth,willcomewithyourLinuxdistribution.

OftenyouwillneedtohittheEnter

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

4 of 60 10-12-2012 17:03

Page 5: Cisco Router Configuration Tutorial

keytoseethepromptfromtherouter.Ifitisunconfigureditwilllooklikethis:

Router>

Ifithasbeenpreviouslyconfiguredwithahostname,itwilllooklikethis:

hostnameofrouter>

Ifyouhavejustturnedontherouter,afteritbootsitwillaskyouifyouwishtobegininitial

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

5 of 60 10-12-2012 17:03

Page 6: Cisco Router Configuration Tutorial

configuration.Sayno.Ifyousayyes,itwillputyouinthemenuinterface.Sayno.

2.1Modes

TheCiscoIOScommand-lineinterfaceisorganizedaroundtheideaofmodes.Youmoveinandoutofseveraldifferentmodeswhileconfiguringarouter,andwhichmodeyouareindetermineswhatcommandsyoucanuse.

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

6 of 60 10-12-2012 17:03

Page 7: Cisco Router Configuration Tutorial

Eachmodehasasetofcommandsavailableinthatmode,andsomeofthesecommandsareonlyavailableinthatmode.Inanymode,typingaquestionmarkwilldisplayalistofthecommandsavailableinthatmode.

Router>?

2.2Unprivilegedandprivilegedmodes

Whenyoufirstconnecttotherouterandprovide

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

7 of 60 10-12-2012 17:03

Page 8: Cisco Router Configuration Tutorial

thepassword(ifnecessary),youenterEXECmode,thefirstmodeinwhichyoucanissuecommandsfromthecommand-line.Fromhereyoucanusesuchunprivilegedcommandsasping,telnet,and

rlogin.

Youcanalsousesomeoftheshow

commandstoobtaininformationaboutthesystem.Inunprivilegedmodeyouusecommandslike,show

version

todisplay

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

8 of 60 10-12-2012 17:03

Page 9: Cisco Router Configuration Tutorial

theversionoftheIOStherouterisrunning.Typingshow

?

willdiplayalltheshow

commandsavailableinthemodeyouarepresentlyin.

Router>show?

Youmustenterprivilegedmodetoconfiguretherouter.Youdothisbyusingthecommandenable.Privilegedmodewillusuallybepasswordprotectedunlesstherouterisunconfigured.

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

9 of 60 10-12-2012 17:03

Page 10: Cisco Router Configuration Tutorial

Youhavetheoptionofnotpasswordprotectingprivilegedmode,butitisHIGHLYrecommendedthatyoudo.Whenyouissuethecommandenable

andprovidethepassword,youwillenterprivilegedmode.

Tohelptheuserkeeptrackofwhatmodetheyarein,thecommand-linepromptchangeseachtimeyouenteradifferentmode.When

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

10 of 60 10-12-2012 17:03

Page 11: Cisco Router Configuration Tutorial

youswitchfromunprivilegedmodetoprivilegedmode,thepromptchangesfrom:

Router>

to

Router#

Thiswouldprobablynotbeabigdealiftherewerejusttwomodes.Thereare,infact,numerousmodes,andthisfeatureisprobablyindispensable.Paycloseattentiontothepromptatalltimes.

Withinprivilegedmodethere

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

11 of 60 10-12-2012 17:03

Page 12: Cisco Router Configuration Tutorial

aremanysub-modes.InthisdocumentIdonotcloselyfollowCiscoterminologyforthishierarchyofmodes.Ithinkthatmyexplanationisclearer,frankly.Ciscodescribestwomodes,unprivilegedandprivileged,andthenahierarchyofcommandsusedinprivilegedmode.Ireasonthatitismuchclearertounderstandifyoujustconsiderthereto

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

12 of 60 10-12-2012 17:03

Page 13: Cisco Router Configuration Tutorial

bemanysub-modesofprivilegedmode,whichIwillalsocallparentmode.Onceyouenterprivilegedmode(parentmode)thepromptendswithapoundsign(#).Therearenumerousmodesyoucanenteronlyafterenteringprivilegedmode.Eachofthesemodeshasapromptoftheform:

Router(arguments)#

Theystillallendwith

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

13 of 60 10-12-2012 17:03

Page 14: Cisco Router Configuration Tutorial

thepoundsign.Theyaresubsumedwithinprivilegedmode.Manyofthesemodeshavesub-modesoftheirown.Onceyouenterpriligedmode,youhaveaccesstoalltheconfigurationinformationandoptionstheIOSprovides,eitherdirectlyfromtheparentmode,orfromoneofitssubmodes.

3.ConfiguringyourCiscoRouter

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

14 of 60 10-12-2012 17:03

Page 15: Cisco Router Configuration Tutorial

Ifyouhavejustturnedontherouter,itwillbecompletelyunconfigured.Ifitisalreadyconfigured,youmaywanttoviewitscurrentconfiguration.Evenifithasnotbeenpreviouslyconfigured,youshouldfamiliarizeyourselfwiththeshow

commandsbeforebeginningtoconfiguretherouter.Enterprivilegedmodebyissuingthecommandenable,then

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

15 of 60 10-12-2012 17:03

Page 16: Cisco Router Configuration Tutorial

issueseveralshow

commandstoseewhattheydisplay.Remember,thecommandshow

?

willdisplayalltheshowcommandsaavailableinthecurrentmode.Definatelytryoutthefollowingcommands:

Router#showinterfacesRouter#showipprotocolsRouter#showipv6protocolsRouter#showiprouteRouter#showipv6routeRouter#showiparpRouter#showipv6neighbors

Whenyouenterprivilegedmodebyusingthecommandenable,you

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

16 of 60 10-12-2012 17:03

Page 17: Cisco Router Configuration Tutorial

areinthetop-levelmodeofprivilegedmode,alsoknowninthisdocumentas"parentmode."Itisinthistop-levelorparentmodethatyoucandisplaymostoftheinformationabouttherouter.Asyounowknow,youdothiswiththeshow

commands.Hereyoucanlearntheconfigurationofinterfacesandwhethertheyare

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

17 of 60 10-12-2012 17:03

Page 18: Cisco Router Configuration Tutorial

upordown.YoucandisplaywhatIPprotocolsareinuse,suchasdynamicroutingprotocols.YoucanviewtherouteandARPtables,andthesearejustafewofthemoreimportantoptions.

Asyouconfiguretherouter,youwillentervarioussub-modestosetoptions,thenreturntotheparentmodetodisplay

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

18 of 60 10-12-2012 17:03

Page 19: Cisco Router Configuration Tutorial

theresultsofyourcommands.Youalsoreturntotheparentmodetoenterothersub-modes.Toreturntotheparentmode,youhitctrl-z.Thisputsanycommandsyouhavejustissuedintoaffect,andreturnsyoutoparentmode.

3.1Globalconfiguration(config)

Toconfigureanyfeatureoftherouter,youmustenter

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

19 of 60 10-12-2012 17:03

Page 20: Cisco Router Configuration Tutorial

configurationmode.Thisisthefirstsub-modeoftheparentmode.Intheparentmode,youissuethecommandconfig.

Router#configRouter(config)#

Asdemonstratedabove,thepromptchangestoindicatethemodethatyouarenowin.

Inconnfigurationmodeyoucansetoptionsthatapplysystem-wide,alsoreferedtoas"globalconfigurations."Forinstance,it

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

20 of 60 10-12-2012 17:03

Page 21: Cisco Router Configuration Tutorial

isagoodideatonameyourroutersothatyoucaneasilyidentifyit.Youdothisinconfigurationmodewiththehostname

command.

Router(config)#hostnameExampleNameExampleName(config)#

Asdemonstratedabove,whenyousetthenameofthehostwiththehostname

command,thepromptimmediatelychangesbyreplacingRouter

withExampleName.(Note:Itisagood

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

21 of 60 10-12-2012 17:03

Page 22: Cisco Router Configuration Tutorial

ideatonameyourrouterswithanorganizednamingscheme.)

AnotherusefulcommandissuedfromconfigmodeisthecommandtodesignatetheDNSservertobeusedbytherouter:

ExampleName(config)#ipname-serveraa.bb.cc.ddExampleName(config)#ctrl-ZExampleName#

Thisisalsowhereyousetthepasswordforprivilegedmode.

ExampleName(config)#enablesecretexamplepasswordExampleName(config)#ctrl-ZExampleName#

Untilyouhitctrl-Z

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

22 of 60 10-12-2012 17:03

Page 23: Cisco Router Configuration Tutorial

(ortypeexit

untilyoureachparentmode)yourcommandhasnotbeenputintoaffect.Youcanenterconfigmode,issueseveraldifferentcommands,thenhitctrl-Z

toactivatethemall.Eachtimeyouhitctrl-Z

youreturntoparentmodeandtheprompt:

ExampleName#

Hereyouuseshow

commandstoverifytheresultsofthe

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

23 of 60 10-12-2012 17:03

Page 24: Cisco Router Configuration Tutorial

commandsyouissuedinconfigmode.Toverifytheresultsoftheip

name-server

command,issuethecommandshow

host.

3.2ConfiguringCiscorouterinterfaces

Ciscointerfacenamingisstraightforward.Individualinterfacesarereferredtobythisconvention:

mediatypeslot#/port#

"Mediatype"referstothetypeofmediathattheportisaninterface

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

24 of 60 10-12-2012 17:03

Page 25: Cisco Router Configuration Tutorial

for,suchasEthernet,TokenRing,FDDI,serial,etc.Slotnumbersareonlyapplicableforroutersthatprovideslotsintowhichyoucaninstallmodules.Thesemodulescontainseveralportsforagivenmedia.The7200seriesisanexample.Thesemodulesareevenhot-swapable.Youcanremoveamodulefromaslotandreplaceitwitha

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

25 of 60 10-12-2012 17:03

Page 26: Cisco Router Configuration Tutorial

differentmodule,withoutinterruptingserviceprovidedbytheothermodulesinstalledintherouter.Theseslotsarenumberedontherouter.

Portnumberreferstotheportinreferencetotheotherportsinthatmodule.Numberingisleft-to-right,andallnumberingstartsat0,notatone.

Forexample,aCisco7206isa

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

26 of 60 10-12-2012 17:03

Page 27: Cisco Router Configuration Tutorial

7200seriesrouterwithsixslots.TorefertoaninterfacethatisthethirdportofanEthernetmoduleinstalledinthesixthslot,itwouldbeinterfaceethernet6/2.Therefor,todisplaytheconfigurationofthatinterfaceyouusethecommand:

ExampleName#showinterfaceethernet6/2

Ifyourrouterdoesnothaveslots,likea1600,

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

27 of 60 10-12-2012 17:03

Page 28: Cisco Router Configuration Tutorial

thentheinterfacenameconsistsonlyof:

mediatypeport#

Forexample:

ExampleName#showinterfaceserial0

HereisanexampleofconfiguringaserialportwithanIPaddress:

ExampleName#configExampleName(config)#interfaceserial1/1ExampleName(config-if)#ipaddress192.168.155.2255.255.255.0ExampleName(config-if)#ipv6addressfe80::230:1bff:fe80:b8ea/64ExampleName(config-if)#ipv6enableExampleName(config-if)#noshutdownExampleName(config-if)#ctrl-ZExampleName#

Thentoverifyconfiguration:

ExampleName#showinterface

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

28 of 60 10-12-2012 17:03

Page 29: Cisco Router Configuration Tutorial

serial1/1

Notetheno

shutdown

command.Aninterfacemaybecorrectlyconfiguredandphysicallyconnected,yetbe"administrativelydown."Inthisstateitwillnotfunction.Thecommandforcausinganinterfacetobeadministrativelydownisshutdown.

ExampleName(config)#interfaceserial1/1ExampleName(config-if)#shutdownExampleName(config-if)#ctrl-ZExampleName#showinterfaceserial1/1

IntheCiscoIOS,thewaytoreverseor

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

29 of 60 10-12-2012 17:03

Page 30: Cisco Router Configuration Tutorial

deletetheresultsofanycommandistosimplyputno

infrontofit.Forinstance,ifwewantedtounassigntheIPaddresswehadassignedtointerfaceserial1/1:

ExampleName(config)#interfaceserail1/1ExampleName(config-if)#noipaddress192.168.155.2255.255.255.0ExampleName(config-if)ctrl-ZExampleName#showinterfaceserial1/1

ConfiguringmostinterfacesforLANconnectionsmightconsistonlyofassigninganetworklayer

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

30 of 60 10-12-2012 17:03

Page 31: Cisco Router Configuration Tutorial

addressandmakingsuretheinterfaceisnotadministrativelyshutdown.Itisusuallynotnecessarytostipulatedata-linklayerencapsulation.Notethatitisoftennecessarytostipulatetheappropriatedata-linklayerencapsulationforWANconnections,suchasframe-relayandATM.SerialinterfacesdefaulttousingHDLC.Adiscussionofdata-linkprotocolsisoutsidethescopeofthis

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

31 of 60 10-12-2012 17:03

Page 32: Cisco Router Configuration Tutorial

document.YouwillneedtolookuptheIOScommandencapsulation

formoredetails.

3.3ConfiguringCiscoRouting

IProutingisautomaticallyenabledonCiscorouters.Ifithasbeenpreviouslydisabledonyourrouter,youturnitbackoninconfigmodewiththecommandiprouting.

ExampleName(config)#iproutingExampleName(config)#ctrl-Z

ToenableIPv6routing,

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

32 of 60 10-12-2012 17:03

Page 33: Cisco Router Configuration Tutorial

usethecommandipv6unicast-routing.

ExampleName(config)#ipv6unicast-routingExampleName(config)#ctrl-Z

Therearetwomainwaysarouterknowswheretosendpackets.Theadministratorcanassignstaticroutes,ortheroutercanlearnroutesbyemployingadynamicroutingprotocol.

Staticroutesaregenerallyusedinverysimplenetworksorinparticularcasesthatnecessitatetheiruse.

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

33 of 60 10-12-2012 17:03

Page 34: Cisco Router Configuration Tutorial

Tocreateastaticroute,theadministratortellstherouteroperatingsystemthatanynetworktrafficdestinedforaspecifiednetworklayeraddressshouldbeforwardedtoasimiliarlyspecifiednetworklayeraddress.IntheCiscoIOSthisisdonewiththeip

route

andipv6routecommands.

ExampleName#configExampleName(config)#iproute172.16.0.0255.255.255.0192.168.150.1ExampleName(config)#ctrl-ZExampleName#showiproute

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

34 of 60 10-12-2012 17:03

Page 35: Cisco Router Configuration Tutorial

ExampleName#configExampleName(config)#ipv6routefe80::230:1bff:fe80::/64fe80::230:1bff:fe80::1ExampleName(config)#ctrl-ZExampleName#showipv6route

Twothingstobesaidaboutthisexample.First,thepacketdestinationaddressmustincludethesubnetmaskforthatdestinationnetwork.Second,theaddressitistobeforwardedtoisthespecifiedaddresofthenextrouteralongthepathtothedestination.Thisisthemostcommon

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

35 of 60 10-12-2012 17:03

Page 36: Cisco Router Configuration Tutorial

wayofsettingupastaticroute,andtheonlyonethisdocumentcovers.Beaware,however,thatthereareothermethods.

Dynamicroutingprotocols,runningonconnectedrouters,enablethoserouterstoshareroutinginformation.Thisenablesrouterstolearntheroutesavailabletothem.Theadvantageofthismethodisthatroutersareableto

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

36 of 60 10-12-2012 17:03

Page 37: Cisco Router Configuration Tutorial

adjusttochangesinnetworktopologies.Ifarouteisphysicallyremoved,oraneighborroutergoesdown,theroutingprotocolsearchesforanewroute.Routingprotocolscanevendynamicallychoosebetweenpossibleroutesbasedonvariablessuchasnetworkcongestionornetworkreliability.

Therearemanydifferentroutingprotocols,andtheyallusedifferentvariables,

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

37 of 60 10-12-2012 17:03

Page 38: Cisco Router Configuration Tutorial

knownas"metrics,"todecideuponappropriateroutes.Unfortunately,arouterneedstoberunningthesameroutingprotocolsasitsneighbors.Manyrouterscan,however,runmutlipleprotocols.Also,manyprotocolsaredesignedtobeabletopassroutinginformationtootherroutingprotocols.Thisiscalled"redistribution."

Routingprotocolsareacomplextopicandthis

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

38 of 60 10-12-2012 17:03

Page 39: Cisco Router Configuration Tutorial

documentcontainsonlythissuperficialdescriptionofthem.Thereismuchtolearnaboutthem,andtherearemanysourcesofinformationaboutthemavailable.AnexcelentsourceofinformationonthistopicisCisco'swebsite,http://www.cisco.com.

3.4IPv6configurationwithIOS

ThisisaseperatesectionbecauseIPv6isnewtomostpeople,and

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

39 of 60 10-12-2012 17:03

Page 40: Cisco Router Configuration Tutorial

theywillbelookingspecificallyforinformationaboutconfiguringIPv6.ExamplesofconfiguringIPv6areincludedthroughoutthedocument,however,alongsideIPv4.ThatisamoreaccuratereflectionofhowyouwillworkwithIPv6onaday-to-daybasis.OncethenewnessofIPv6passes,itwillbeonemorepieceinthefamiliarpuzzle.

Theimportant

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

40 of 60 10-12-2012 17:03

Page 41: Cisco Router Configuration Tutorial

concepttounderstandwhenconfiguringIPv6isthatIPv4andIPv6existinparrallel.Oneisnotareplacementfortheother,atleastnotinthewayitistreatedbytheoperatingsystem.Atermforthisisdualstack.AninterfacecanhaveanIPv4addressandnoIPv6address.OranIPv6addressand

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

41 of 60 10-12-2012 17:03

Page 42: Cisco Router Configuration Tutorial

noIPv4address.OrbothanIPv4addressandanIPv6address.Examples:

IPv4only

!interfaceFastEthernet0/0ipaddress192.168.1.138255.255.255.0!

IPv6only

!interfaceFastEthernet0/0ipv6addressfe80::230:1bff:fe80::/64ipv6enable!

IPv4andIPv6

!interfaceFastEthernet0/0ipaddress192.168.1.138255.255.255.0ipv6addressfe80::230:1bff:fe80::/64ipv6enable!

Noticethatthereareseperatebutsimiliarcommandsfor

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

42 of 60 10-12-2012 17:03

Page 43: Cisco Router Configuration Tutorial

IPv4andIPv6.ToassignanIPv4address,

ExampleName(config-if)#ipaddress192.168.1.138255.255.255.0

ToassignanIPv6address,

ExampleName(config-if)#ipv6addressfe80::230:1bff:fe80::/64

TherearesomebiggerdifferencesbetweenIPv4andIPv6IOScommands.Forexample,theIPv6equivilantofshowip

arp,isshowipv6

neighbors.

3.5SavingyourCiscoRouterconfiguration

Onceyou

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

43 of 60 10-12-2012 17:03

Page 44: Cisco Router Configuration Tutorial

haveconfiguredroutingontherouter,andyouhaveconfiguredindividualinterfaces,yourroutershouldbecapableofroutingtraffic.Giveitafewmomentstotalktoitsneighbors,thenissuethecommandsshowip

route

andshowip

arp.Thereshouldnowbeentriesinthesetableslearnedfromtheroutingprotocol.

Ifyouturnedthe

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

44 of 60 10-12-2012 17:03

Page 45: Cisco Router Configuration Tutorial

routeroffrightnow,andturneditonagain,youwouldhavetostartconfigurationoveragain.Yourrunningconfigurationisnotsavedtoanyperminentstoragemedia.Youcanseethisconfigurationwiththecommandshowrunning-

config.

ExampleName#showrunning-config

Youdowanttosaveyoursuccessfulrunningconfiguration.Issuethecommandcopyrunning-configstartup-

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

45 of 60 10-12-2012 17:03

Page 46: Cisco Router Configuration Tutorial

config.

ExampleName#copyrunning-configstartup-config

Yourconfigurationisnowsavedtonon-volatileRAM(NVRAM).Issuethecommandshowstartup-

config.

ExampleName#showstartup-config

Nowanytimeyouneedtoreturnyourroutertothatconfiguration,issuethecommandcopystartup-configrunning-

config.

ExampleName#copystartup-configrunning-config

3.6ExampleCiscoRouterconfiguration

Router>enable1.

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

46 of 60 10-12-2012 17:03

Page 47: Cisco Router Configuration Tutorial

Router#config2.Router(config)#hostnameN115-7206

3.

N115-7206(config)#interfaceserial1/1

4.

N115-7206(config-if)ipaddress192.168.155.2255.255.255.0

5.

N115-7206(config-if)ipv6addressfe80::230:1bff:fe80:b8ea/64

6.

N115-7206(config-if)ipv6enable

7.

N115-7206(config-if)noshutdown

8.

N115-7206(config-if)ctrl-z

9.

N115-7206#showinterfaceserial1/1

10.

N115-7206#config11.N115-7206(config)#interfaceethernet2/3

12.

N115-7206(config-if)#ipaddress192.168.150.90255.255.255.0

13.

N115-7206(config-if)#noshutdown

14.

N115-7206(config-if)#ctrl-z

15.

N115-7206#showinterfaceethernet2/3

16.

N115-7206#config17.N115-7206(config)#ipname-server172.16.0.10

18.

N115-7206(config)#ctrl-z19.N115-7206#pingarchie.au

20.

N115-7206#config21.N115-7206(config)#enablesecretpassword

22.

N115-7206(config)#ctrl-z23.N115-7206#copyrunning-config

24.

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

47 of 60 10-12-2012 17:03

Page 48: Cisco Router Configuration Tutorial

startup-configN115-7206#exit25.

4.TroubleshootingyourCiscorouter

Inevitably,therewillbeproblems.Usually,itwillcomeintheformofausernotifyingyouthattheycannotreachacertaindestination,oranydestinattionatall.Youwillneedtobeabletocheckhowtherouterisattemptingtoroute

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

48 of 60 10-12-2012 17:03

Page 49: Cisco Router Configuration Tutorial

traffic,andyoumustbeabletotrackdownthepointoffailure.

Youarealreadyfamiliarwiththeshow

commands,bothspecificcommandsandhowtolearnwhatothershow

commandsareavailable.Someofthemostbasic,mostusefulcommandsyouwillusefortroubleshootingare:

Router#showinterfacesRouter#showipprotocolsRouter#showipv6protocolsRouter#show

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

49 of 60 10-12-2012 17:03

Page 50: Cisco Router Configuration Tutorial

iprouteRouter#showipv6routeRouter#showiparpRouter#showipv6neighbors

4.1Testingconnectivity

Itisverypossiblethatthepointoffailureisnotinyourrouterconfiguration,oratyourrouteratall.Ifyouexamineyourrouter'sconfigurationandoperationandeverythinglooksgood,theproblemmightbebefartheruptheline.Infact,

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

50 of 60 10-12-2012 17:03

Page 51: Cisco Router Configuration Tutorial

itmaybethelineitself,oritcouldbeanotherrouter,whichmayormaynotbeunderyouradministration.

Oneextremelyusefulandsimplediagnostictoolistheping

command.PingisanimplementationoftheIPMessageControlProtocol(ICMP).PingsendsanICMPechorequesttoadestinationIPaddress.Ifthedestination

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

51 of 60 10-12-2012 17:03

Page 52: Cisco Router Configuration Tutorial

machinereceivestherequest,itrespondswithanICMPechoresponse.Thisisaverysimpleexchangethatconsistsof:

Hello,areyoualive?

Yes,Iam.

ExampleName#pingxx.xx.xx.xx

Ifthepingtestissuccessful,youknowthatthedestinationyouarehavingdifficultyreachingisaliveandphysicallyreachable.

Iftherearerouters

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

52 of 60 10-12-2012 17:03

Page 53: Cisco Router Configuration Tutorial

betweenyourrouterandthedestinationyouarehavingdifficultyreaching,theproblemmightbeatoneoftheotherrouters.Evenifyouping

arouteranditresponds,itmighthaveotherinterfacesthataredown,itsroutingtablemaybecorrupted,oranynumberofotherproblemsmayexist.

Toseewherepacketsthat

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

53 of 60 10-12-2012 17:03

Page 54: Cisco Router Configuration Tutorial

leaveyourrouterforaparticulardestinationgo,andhowfar,usethetrace

command.

ExampleName#tracexx.xx.xx.xx

Itmaytakeafewminutesforthisutilitytofinish,sogiveitsometime.Itwilldisplayalistofallthehopsitmakesonthewaytothedestination.

4.2debug

commands

There

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

54 of 60 10-12-2012 17:03

Page 55: Cisco Router Configuration Tutorial

areseveraldebug

commandsprovidedbytheIOS.Thesecommandsarenotcoveredhere.RefertotheCiscowebsiteformoreinformation.

4.3Hardwareandphysicalconnections

Donotoverlookthepossibilitythatthepointoffailureisahardwareorphysicalconnectionfailure.Anynumberofthingscangowrong,fromboardfailuresto

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

55 of 60 10-12-2012 17:03

Page 56: Cisco Router Configuration Tutorial

cutcablestopowerfailures.Thisdocumentwillnotdescribewtroubleshootingtheseproblems,exceptforthesesimplethings.

Checktoseethattherouteristurnedon.Alsomakesurethatnocablesarelooseordamaged.Finally,makesurecablesarepluggedintothecorrectports.Beyondthissimpleadviceyouwillneedtocheckother

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

56 of 60 10-12-2012 17:03

Page 57: Cisco Router Configuration Tutorial

sources.

4.4Outofyourcontrol

Ifthepointoffailureisfartheruptheline,theprolemmightliewithequipmentnotunderyouradministration.Youronlyoptionmightbetocontacttheequipment'sadministrator,notifythemofyourproblem,andaskthemforhelp.Itisinyourinteresttobecourtiousand

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

57 of 60 10-12-2012 17:03

Page 58: Cisco Router Configuration Tutorial

respectful.Theotheradministratorhastheirownproblems,theirownworkloadandtheirownpriorities.Theiragendamightevendirectlyconflictwithyours,suchastheirintentiontochangedynamicroutingprotocols,etc.Youmustworkwiththem,evenifthesituationisfrustrating.Alienatingsomeonewiththepowertoblockimportantroutestoyournetworkisnot

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

58 of 60 10-12-2012 17:03

Page 59: Cisco Router Configuration Tutorial

agoodidea.

5.References

Leinwand,PinskyandCulpepperCiscoRouterConfiguration.Indianapolis,Indiana:CiscoPress,1998.CiscoSystems,Inc.,http://www.cisco.com

6.Moreinformation

CiscoQuickTips

MytutorialonIPsubnetcalculations

CiscoT1LoadBalancing

PDFversionsofthisandotherdocumentsbyJoshGentry

Ads by Google Cisco Router Cisco Server Cisco About Cisco Connect

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

59 of 60 10-12-2012 17:03

Page 60: Cisco Router Configuration Tutorial

Web joshgentry.com

Authored by Josh Gentry

Top

Cisco Router Configuration Tutorial http://pages.swcp.com/~jgentry/topo/cisco.htm

60 of 60 10-12-2012 17:03