Difference between revisions of "Cisco basic configuration"

From Teknologisk videncenter
Jump to: navigation, search
m (Kopier og indsæt i din Router i config mode)
m (Kopier og indsæt i din Router i config mode)
 
Line 257: Line 257:
 
logging synchronous
 
logging synchronous
 
exit</input>
 
exit</input>
 +
</source>
 
=Links=
 
=Links=
 
*[https://packetpushers.net/a-cisco-ios-template-with-commands-explanations-expecting-the-same-result/ IOS Configuration template]
 
*[https://packetpushers.net/a-cisco-ios-template-with-commands-explanations-expecting-the-same-result/ IOS Configuration template]
</source>
+
 
 
{{Source cli}}
 
{{Source cli}}
 
[[Category:Cisco]][[Category:CCNA]][[Category:IOS]][[Category:Network]]
 
[[Category:Cisco]][[Category:CCNA]][[Category:IOS]][[Category:Network]]

Latest revision as of 07:04, 3 June 2016




Grundkonfiguration af Cisco router

I dette eksempel konfigureres en Cisco 2621XM router fra grunden.

Konfigurationsoversigt

En Cisco 2621XM har to FastEthernet interfaces. FastEthernet 0/0 og FastEthernet 0/1.

  • hostnavn konfigurers til Viborg1
  • FastEthernet 0/0 konfigures med ip adressen 192.168.22.1 og subnetmasken 255.255.255.0
  • FastEthernet 0/1 konfigures med ip adressen 172.16.0.1 og subnetmasken 255.255.0.0
  • loopback 0 interfacet som er et virtuelt interface får ip adressen 10.10.10.1 og subnetmasken 255.255.255.255
  • RIP version 2 konfigureres til at inkludere alle tre subnet (FastEthernet porte og loopback porten)

Forbind routerens port markeret med blåt console og en PC's COM port med et cisco roolover kabel.

  • Se billede 1 af et roolover kabel og billede 2 af routerens console port.

Start en terminalemulator på PC'en. Jeg vil anbefale terminalemulatoren putty

Start Putty and udfyld konfigurationsbilledet som markeret med de røde ringe i billede 3. (Min COM port er på COM6. Din er måske på en anden. Forsøg dig frem eller se det i Windows enhedshåndtering)

Start routeren og du bør kunne se på Putty at routeren er ved at boote. Når routeren er bootet er det måske nødvendigt at fjerne en eventuel eksisterende konfiguration. Følg anvisningerne herunder.

Billede 1: Cisco Rollover kabel
Billede 2: Cisco 2621Xm porte
Billede 3: Putty seriel kommunikation med 9600 bits per sekund

Undersøg om der er en eksisterende konfiguration

Hvis routeren efter den har bootet viser System Configuration Dialog som vist i dialogbilledet nedenunder, har routeren ingen konfiguration liggende og du kan fortsætte til Konfiguration trin 1. Hvis routeren skriver en række fejlbeskeder på skærmen er det nødvendigt at Slette den eksisterende konfiguration

         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:

Slet eksisterende konfiguration

For at slette den eksiterende konfiguration skal man først logge ind på routeren. Vi bruger altid passwordet cisco, class eller Cisco her på skolen. Du bør således kunne logge ind som vist herunder. Hvis du mod forventning ikke kan logge ind er det nødvendigt at udføre proceduren password recovery procedure.

R5><input>enable</input>
Password:
R5#

Efter du er logget ind på routeren kan du slette konfigurationen som ligger i en fil som hedder startup-config og genstarte routeren. erase startup-config slettet konfigurationen og reload genstarter routeren. Vist herunder.

R5#<input>erase startup-config</input>
Erasing the nvram filesystem will remove all configuration files! Continue?<input><ENTER></input>
[OK]
Erase of nvram: complete
R5#<input>reload</input>

Routeren booter nu uden konfiguration, og er parat til at blive konfigureret.

Konfiguration trin 1

I eksemplet nedenunder er det vist med hvid hvad der skal tastes. det med grøn tekst er det som routeren skriver i vinduet.

         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]: <input>yes</input>

At any point you may enter a question mark '?' for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets '[]'.

Basic management setup configures only enough connectivity
for management of the system, extended setup will ask you
to configure each interface on the system

Would you like to enter basic management setup? [yes/no]: <input>yes</input>
Configuring global parameters:

  Enter host name [Router]: <input>Viborg1</input>

  The enable secret is a password used to protect access to
  privileged EXEC and configuration modes. This password, after
  entered, becomes encrypted in the configuration.
  Enter enable secret: <input>cisco</input>

  The enable password is used when you do not specify an
  enable secret password, with some older software versions, and
  some boot images.
  Enter enable password: <input>class</input>

  The virtual terminal password is used to protect
  access to the router over a network interface.
  Enter virtual terminal password: <input>cisco</input>
  Configure SNMP Network Management? [yes]: <input>no</input>

Current interface summary


Any interface listed with OK? value "NO" does not have a valid configuration

Interface                  IP-Address      OK? Method Status        Protocol
FastEthernet0/0            unassigned      NO  unset  up            down
FastEthernet0/1            unassigned      NO  unset  up            down

Enter interface name used to connect to the
management network from the above interface summary: <input>FastEthernet0/0</input>

Configuring interface FastEthernet0/0:
  Use the 100 Base-TX (RJ-45) connector? [yes]: <input>yes</input>
  Operate in full-duplex mode? [no]: <input>yes</input>
  Configure IP on this interface? [yes]: <input>yes</input>
    IP address for this interface: <input>192.168.22.1</input>
    Subnet mask for this interface [255.255.255.0] : <input>255.255.255.0</input>
    Class C network is 192.168.22.0, 24 subnet bits; mask is /24

The following configuration command script was created:

hostname Viborg1
enable secret 5 $1$Q0eK$BS6PyvYOB0dfDILGrDYLc.
enable password class
line vty 0 4
password cisco
no snmp-server
!
no ip routing

!
interface FastEthernet0/0
no shutdown
media-type 100BaseX
full-duplex
ip address 192.168.22.1 255.255.255.0
no mop enabled
!
interface FastEthernet0/1
shutdown
no ip address
!
end


[0] Go to the IOS command prompt without saving this config.
[1] Return back to the setup without saving this config.
[2] Save this configuration to nvram and exit.

Enter your selection [2]:<input>2</input>

Konfiguration trin 2

FastEthernet 0/1

Konfiguration af fastethernet0/1 interfacet.

Viborg1#<input>configure terminal</input>
Enter configuration commands, one per line.  End with CNTL/Z.
Viborg1(config)#<input>interface FastEthernet0/1</input>
Viborg1(config-if)#<input>ip address 172.16.0.1 255.255.0.0</input>
Viborg1(config-if)#<input>no shutdown</input>
Viborg1(config-if)#<input><CTRL-Z></input>


Loopback 0

Konfiguration af loopback0 interfacet.

Viborg1#<input>configure terminal</input>
Viborg1(config)#<input>interface loopback 0</input>
Viborg1(config-if)#<input>ip address 10.10.10.1 255.255.255.255</input>
Viborg1(config-if)#<input>no shutdown</input>
Viborg1(config-if)#<input><CTRL-Z></input>

konfigurere statisk routing

Viborg1#<input>configure terminal</input>
Viborg1(config)#<input>ip routing</input>
Viborg1(config)#<input>ip route 10.0.0.0 255.255.255.0 192.168.1.1</input>

konfigurere default routing

Default gateway or gateway of last resort.

Viborg1#<input>configure terminal</input>
Viborg1(config)#<input>ip route 0.0.0.0 0.0.0.0 192.168.1.1</input>

Starte og konfigurere RIP

Viborg1#<input>configure terminal</input>
Viborg1(config)#<input>ip routing</input>
Viborg1(config)#<input>router rip</input>
Viborg1(config-router)#<input>version 2</input>
Viborg1(config-router)#<input>no auto-summary</input>
Viborg1(config-router)#<input>network 192.168.22.0</input>
Viborg1(config-router)#<input>network 172.16.0.0</input>
Viborg1(config-router)#<input>network 10.0.0.0</input>
Viborg1(config-router)#<input><CTRL-Z></input>

Gem konfigurationen

Sidst men ikke mindst er det vigtigt at gemme konfigurationen i NVRAM.

Viborg1#<input>copy running-config startup-config</input>
Destination filename [startup-config]?<input><ENTER></input>
Building configuration...
[OK]

Ekstra konfiguration

Lang ventetid ved stavefejl

Slå DNS opslag fra, hvis du har problemer med stavefejl i kommandoer og det tager lang tid før du igen kan taste kommanoder. Husk at gemme til nvram.

Viborg1#<input>configure terminal</input>
Viborg1(config)#<input>no ip domain-lookup</input>

Irriterende beskeder efter boot

Hvis der sidder aktive kabler i portene vil routeren måske prøve at hente en konfiguration fra netværket med tftp. Det kan være ret irreterende når man sidder på Console porten. Se herunder hvordan det slås fra. Husk at gemme til nvram.

Viborg1#<input>configure terminal</input>
Viborg1(config)#<input>no service config</input>

Du kan også slå alle fejlbeskeder fra til Console terminalen. Det er kun slået fra indtil der logges ud.

Viborg1#<input>terminal no monitor</input>

Du kan også få terminalen til intelligent at hoppe en linie ned når fejlbeskeder kommer.

Viborg1(config)#<input>line con 0</input>
Viborg1(config-line)#<input>logging synchronous</input>
Viborg1(config)#<input>line vty 0 4</input>
Viborg1(config-line)#<input>logging synchronous</input>

Undlad at logge in ved telnet

Viborg1(config)#<input>line vty 0 4</input>
Viborg1(config-line)#<input>no login</input>

Idle telnet sessioner lukkes

Hvis du er træt af at blive smidt af efter få minutter af inaktivitet.

Viborg1(config)#<input>line vty 0 4</input>
Viborg1(config-line)#<input>exec-timeout 0 0</input>

Kopier og indsæt i din Router i config mode

<input>
no ip domain-lookup
no service config
line con 0
logging synchronous
line vty 0 4
logging synchronous
exit</input>

Links