User Tools

Site Tools


doc:appunti:hardware:cisco_router

This is an old revision of the document!


Router Cisco

Recuperare password persa

Annotare il configuration register

Prima di intervenire per recuperare una password dimenticata conviene annotare il valore corrente del configuration register, se si ha accesso al router dare il comando:

cisco>show version
Cisco Internetwork Operating System Software
IOS (tm) C837 Software (C837-K9O3Y6-M), Version 12.3(2)XC2, EARLY DEPLOYMENT RELEASE SOFTWARE (fc1)
...
Configuration register is 0x2102

Annotare il valore, in questo caso 0x2102. Normalmente si ha 0x2102 oppure 0x102.

Ottenere il prompt "enable"

  1. Spengere il router
  2. Collegare il cavetto console e avviare un programma terminale tipo minicom
  3. Accendere il router, inviare un Ctrl-Break (Ctrl-A-F in minicom, Ctrl-Break in Hyperterminal)
  4. La sequenza di boot si interrompe e presenta il prompt rommon 1 >

Per un Router Cisco 1700:

rommon 1 > confreg 0x142
You must reset or power cycle for new config to take effect
rommon 2 > reset

Per un Router Cisco 2500, Cisco 800 oppure Cisco SOHO:

rommon 1> confreg  0x2142
rommon 2> reset

Dopo questa procedura il router si avvia senza caricare la configurazione salvata nella memoria non volatile. Si salta la procedura di configurazione iniziale e si arriva al prompt.

Would you like to enter the initial configuration dialog? [yes/no]: no
Press RETURN to get started!
Router>

Si può quindi passare alla modalità superutente e visualizzare con show configuration la configurazione che risiede nella memoria non volatile:

Router>enable
Router#show configuration
Using 1629 out of 131072 bytes
!
version 12.3
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
...

Cosa si vede invece con show startup-config? Secondo me sono la stessa identica cosa.

Recuperare la vecchia configurazione eccetto la password

Si copia la configurazione dalla memoria non volatile alla memoria corrente, si cambia la password di enable e si abilitano tutte le interfacce che servono:

#copy startup-config running-config
#show ip interface brief
#configure terminal
(config)#enable secret <password>
(config)#interface ATM0
(config-if)#no shutdown
(config-if)#exit
(config)#interface ATM0.1
(config-subif)#no shutdown
(config-subif)#exit
(config)#interface Ethernet0
(config-if)#no shutdown
(config-if)#exit
...
(config)#exit

Potrebbe essere abilitato uno o più username con password di primo livello (password in chiaro o criptata, lo si vede dalla configurazione corrente). Per disabilitarlo:

#show running-config
...
username service password 0 ServiceSecret
username admin password 7 113A160D18210E0F162F3F
...
#configure terminal
(config)#no username service
(config)#no username admin

Infine si reimposta il valore del registro di configurazione, in modo che al prossimo boot parta dalla configurazione fatta e si salva la configurazione nella startup-config.

#configure terminal
(config)#config-register 0x2102
(config)#exit
#write

VPN IPSEC con Router Cisco Soho

Qui un file di configurazione di esempio.

Configurazione server DHCP

Vedere Configuring DHCP.

In questo esempio si configura un pool pari a tutta la ntework 192.168.2.0/24 ad eccezione del router stesso (che funziona da server DHCP e gateway) che ha indirizzo 192.168.2.1:

#configure terminal
(config)#ip dhcp excluded-address 192.168.2.1
(config)#ip dhcp pool CLIENT
(dhcp-config)#network 192.168.2.0 255.255.255.0
(dhcp-config)#default-router 192.168.2.1
(dhcp-config)#dns-server 151.99.125.3
(dhcp-config)#lease 0 2
(dhcp-config)#exit
(config)#exit
#write memory

Accesso telnet

Per consentire l'accesso alla console via telnet dalla rete locale (192.168.1.0/255.255.255.0), dalla DMZ (5.63.172.0/255.255.255.248) e da un indirizzo esterno (62.48.51.8) bisogna creare una ACL e aggiungerla alla linea vty:

access-list 90 permit 192.168.1.0 0.0.0.255
access-list 90 permit 5.63.172.0 0.0.0.7
access-list 90 permit 62.48.51.8

line vty 0 4
 access-class 90 in
 privilege level 15
 password 7 103A0C6124234107
 login local
 transport input telnet

Notare che nell'access list la netmask va scritta negata (operazione NOT).

Qualità connessione DSL

Come valutare la qualità del segnale ADSL su un Cisco 877:

Router#show dsl interface ATM 0
ATM0
Alcatel 20190 chipset information
                ATU-R (DS)                      ATU-C (US)
Modem Status:    Showtime (DMTDSL_SHOWTIME)
DSL Mode:        ITU G.992.1 (G.DMT) Annex A
ITU STD NUM:     0x01                            0x1 
Vendor ID:       'STMI'                          'TSTC'
Vendor Specific: 0x0000                          0x0000
Vendor Country:  0x0F                            0xB5
Chip ID:         C196 (0)
DFE BOM:         DFE3.0 Annex A (1)
Capacity Used:   100%                            100%
Noise Margin:    11.5 dB                         13.0 dB
Output Power:    20.0 dBm                        12.5 dBm
Attenuation:     41.0 dB                         23.5 dB
Defect Status:   None                            None                        
Last Fail Code:  None
Watchdog Counter: 0xE0
Watchdog Resets: 0
Selftest Result: 0x00
Subfunction:     0x00 
Interrupts:      8254 (0 spurious)
PHY Access Err:  0
Activations:     1
LED Status:      ON
LED On Time:     100
LED Off Time:    100
Init FW:         init_AMR-3.0.014_no_bist.bin
Operation FW:    AMR-3.0.014.bin
FW Source:       embedded
FW Version:      3.0.14

                 Interleave             Fast    Interleave              Fast
Speed (kbps):          5888                0           736                 0
Cells:               383635                0         23443                 0
Reed-Solomon EC:          8                0             0                 0
CRC Errors:               0                0             0                 0
Header Errors:            0                0             0                 0
Total BER:                0E-0           0E-0
Leakage Average BER:      0E-0           0E-0
                        ATU-R (DS)      ATU-C (US)
Bitswap:               enabled            enabled
Bitswap success:          0                   0
Bitswap failure:          0                   0

LOM Monitoring : Disabled

Si vedono i parametri downstream (download) e upstram (upload), il valore di Noise Margin (detto anche rapporto segnale/rumore) è il fattore più importante.

Questa una tabella esplicativa del rapporto segnale/rumore (SNR), dove un numero maggiore è meglio:

SNR Signal/Noise Ratio (Noise Margin)
6dB or below Noise margin is bad, it will experience no synch or intermittent synch problems
7dB-10dB Fair but does not leave much room for variances in conditions
11dB-20dB Good with little or no synch problems (if no large variation)
20dB-28dB Excellent
29dB or above Outstanding

L'attenuazione aumenta di solito con la distanza percorsa dal segnale, un valore minore è meglio:

Attenuation
20-30 Excellent
30-40 Very Good
40-60 Average

La velocità di allineamento della portante è indicata da Speed (kbps) Interleave, nell'esempio sopra abbiamo 5888 kbit in download e 736 kbit in upload.

Altro comando per verificare la velocità di allineamento in download:

Router#show interfaces ATM 0
ATM0 is up, line protocol is up 
  Hardware is MPC ATMSAR (with Alcatel ADSL Module)
  MTU 4470 bytes, sub MTU 4470, BW 736 Kbit, DLY 500 usec, 
     reliability 255/255, txload 1/255, rxload 8/255
  Encapsulation ATM, loopback not set
  Encapsulation(s): AAL5  AAL2, PVC mode
  10 maximum active VCs, 1024 VCs per VP, 2 current VCCs
  VC Auto Creation Disabled.
  VC idle disconnect time: 300 seconds
  Last input never, output 00:00:01, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/224/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: Per VC Queueing
  5 minute input rate 24000 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     43749 packets input, 41209447 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     28917 packets output, 2283137 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 output buffer failures, 0 output buffers swapped out

Il valore BW 736 Kbit indica che la portante si è allineata a 736 kbit (upload).

doc/appunti/hardware/cisco_router.1358418978.txt.gz · Last modified: 2013/01/17 11:36 by niccolo