doc:appunti:hardware:cisco_router_2600
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:hardware:cisco_router_2600 [2013/06/14 12:09] – [NAT dinamico (SNAT classico)] niccolo | doc:appunti:hardware:cisco_router_2600 [2022/01/27 08:32] (current) – [Rimozione regola NAT in uso] niccolo | ||
|---|---|---|---|
| Line 35: | Line 35: | ||
| Per resettare completamente la configurazione del router ai valori di fabbrica e per impostare le password di accesso | Per resettare completamente la configurazione del router ai valori di fabbrica e per impostare le password di accesso | ||
| - | (rispettivamente la password per accesso da console, per la modalita' | + | (rispettivamente la password per accesso da console, per la modalità |
| < | < | ||
| Line 96: | Line 96: | ||
| ===== enable password ===== | ===== enable password ===== | ||
| + | |||
| + | Vedere anche il paragrafo [[# | ||
| Per impostare la password di //enable// (viene chiesta quando si usa tale comando per ottenere i permessi di amministratore): | Per impostare la password di //enable// (viene chiesta quando si usa tale comando per ottenere i permessi di amministratore): | ||
| Line 284: | Line 286: | ||
| < | < | ||
| Router# | Router# | ||
| - | Router(config)# | + | Router(config)# |
| Router(config)# | Router(config)# | ||
| Router(config)# | Router(config)# | ||
| Line 298: | Line 300: | ||
| </ | </ | ||
| - | FIXME La '' | + | Nel comando **'' |
| + | |||
| + | Nel caso in cui l'IP pubblico sia dinamico, si può utilizzare il **nome dell' | ||
| + | |||
| + | < | ||
| + | access-list 1 permit 10.11.12.0 0.0.0.255 | ||
| + | ip nat inside source list 1 interface Dialer1 overload | ||
| + | </ | ||
| Per rimuovere la configurazione: | Per rimuovere la configurazione: | ||
| Line 339: | Line 348: | ||
| </ | </ | ||
| + | ==== Doppio PVC DSL con destination routing e NAT ==== | ||
| + | |||
| + | Scenario: router ADSL con **due canali PVC** (connessione PPP), il primo usato come rotta predefinita, | ||
| + | |||
| + | Anzitutto la configurazione delle due interfacce dial-up: | ||
| + | |||
| + | < | ||
| + | interface Dialer1 | ||
| + | ip address negotiated | ||
| + | ip virtual-reassembly | ||
| + | | ||
| + | | ||
| + | no cdp enable | ||
| + | no ppp chap wait | ||
| + | ppp pap sent-username MyLogin password 0 MySecret | ||
| + | no ppp pap wait | ||
| + | ! | ||
| + | interface Dialer2 | ||
| + | | ||
| + | ip address negotiated | ||
| + | ip nat outside | ||
| + | ip virtual-reassembly | ||
| + | | ||
| + | | ||
| + | no cdp enable | ||
| + | no ppp chap wait | ||
| + | ppp pap sent-username MyLogin2 password 0 MySecret2 | ||
| + | ! | ||
| + | </ | ||
| + | |||
| + | Con le seguenti impostazioni si definisce il NAT quando la **destinazione** è il server VoIP (213.251.147.16) e l' | ||
| + | |||
| + | < | ||
| + | ip nat inside source route-map VOIP-MAP interface Dialer2 overload | ||
| + | access-list 100 permit ip any host 213.251.147.16 | ||
| + | |||
| + | route-map VOIP-MAP permit 10 | ||
| + | match ip address 100 | ||
| + | match interface Dialer2 | ||
| + | ! | ||
| + | </ | ||
| + | |||
| + | Infine con una semplice **regola di routing** si instrada opportunamente il traffico verso il server VoIP: | ||
| + | |||
| + | < | ||
| + | ip route 213.251.147.16 255.255.255.255 Dialer2 | ||
| + | </ | ||
| + | |||
| + | ===== Rimozione regola NAT in uso ===== | ||
| + | |||
| + | Non è possibile rimuovere una regola di NAT se questa è stata usata di recente, il router risponde **Static entry in use, cannot remove**. Si deve ripulire la lista delle // | ||
| + | |||
| + | < | ||
| + | router# confgure terminal | ||
| + | router(config)# | ||
| + | %Static entry in use, cannot remove | ||
| + | router(config)# | ||
| + | router# show ip nat translations | ||
| + | Pro Inside global | ||
| + | ... | ||
| + | tcp 185.21.72.66: | ||
| + | ... | ||
| + | router# clear ip nat translation forced | ||
| + | router# confgure terminal | ||
| + | router(config)# | ||
| + | router(config)# | ||
| + | router# write memory | ||
| + | </ | ||
| + | |||
| + | Dovrebbe essere possibile rimuovere selettivamente solo le regole interessate, | ||
| + | |||
| + | ===== Aggiornamento Sistema Operativo IOS ===== | ||
| + | |||
| + | Installare sul PC un server TFTP e abilitarlo in scrittura (la document root in Debian è **''/ | ||
| + | |||
| + | < | ||
| + | apt-get install tftpd-hpa | ||
| + | </ | ||
| + | |||
| + | Per abilitare il server TFTP in scrittura mettere in **''/ | ||
| + | |||
| + | < | ||
| + | TFTP_OPTIONS=" | ||
| + | </ | ||
| + | |||
| + | Il server sta in ascolto sulla porta **UDP/69**, ma il trasferimento di dati avviene su porte effimere. Bisogna essere sulla stessa rete oppure il firewall deve avere il connection tracking TFTP abilitato: | ||
| + | |||
| + | < | ||
| + | 10: | ||
| + | ... | ||
| + | 11: | ||
| + | 11: | ||
| + | </ | ||
| + | |||
| + | Salvare l' | ||
| + | |||
| + | < | ||
| + | Router#show flash: | ||
| + | |||
| + | System flash directory: | ||
| + | File Length | ||
| + | 1 | ||
| + | 2 | ||
| + | [5428444 bytes used, 27601700 available, 33030144 total] | ||
| + | 32768K bytes of processor board System flash (Read/ | ||
| + | |||
| + | router#copy flash: | ||
| + | </ | ||
| + | |||
| + | Con la vecchia versione 11.3 la sintassi è leggermente diversa: | ||
| + | |||
| + | < | ||
| + | Router#copy flash tftp | ||
| + | |||
| + | System flash directory: | ||
| + | File Length | ||
| + | 1 | ||
| + | [3119776 bytes used, 5268832 available, 8388608 total] | ||
| + | Address or name of remote host [255.255.255.255]? | ||
| + | Source file name? c2600-i-mz.113-10.T | ||
| + | Destination file name [c2600-i-mz.113-10.T]? | ||
| + | Verifying checksum for ' | ||
| + | Copy ' | ||
| + | as ' | ||
| + | </ | ||
| + | |||
| + | Quindi si fa spazio nella memoria flash per caricare la nuova versione: | ||
| + | |||
| + | < | ||
| + | Router# | ||
| + | </ | ||
| + | |||
| + | Infine è possibile caricare dal server TFTP la nuova immagine nella flash: | ||
| + | |||
| + | < | ||
| + | Router#copy tftp flash | ||
| + | |||
| + | System flash directory: | ||
| + | No files in System flash | ||
| + | [0 bytes used, 8388608 available, 8388608 total] | ||
| + | Address or name of remote host [192.168.7.46]? | ||
| + | Source file name? c2600-i-mz.122-12b.bin | ||
| + | Destination file name [c2600-i-mz.122-12b.bin]? | ||
| + | Accessing file ' | ||
| + | Loading c2600-i-mz.122-12b.bin from 192.168.7.46 (via Ethernet0/ | ||
| + | |||
| + | Erase flash device before writing? [confirm] | ||
| + | |||
| + | Copy ' | ||
| + | as ' | ||
| + | </ | ||
| + | |||
| + | Al reboot successivo il router parte con la prima immagine IOS che trova. | ||
| + | |||
| + | ===== Gestione password ===== | ||
| + | |||
| + | ==== Password su console ==== | ||
| + | |||
| + | < | ||
| + | line console 0 | ||
| + | login | ||
| + | password MySecret | ||
| + | </ | ||
| + | |||
| + | ==== Password su accesso telnet ==== | ||
| + | |||
| + | Con questa impostazione si attiva la richiesta di password per gli accessi telnet, si entra **senza privilegi di enable**: | ||
| + | |||
| + | < | ||
| + | line vty 0 4 | ||
| + | | ||
| + | | ||
| + | login | ||
| + | | ||
| + | </ | ||
| + | |||
| + | La password di enable è impostata con: | ||
| + | |||
| + | < | ||
| + | enable secret MyEnableSecret | ||
| + | </ | ||
| + | |||
| + | Con questa impostazione viene chiesto un **nome di login**, se i privilegi sono giusti si accede direttamente come **enable**, è richiesta la **password associata** al login, che va impostata a parte: | ||
| + | |||
| + | < | ||
| + | line vty 0 4 | ||
| + | | ||
| + | | ||
| + | login local | ||
| + | | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | username admin privilege 15 secret MyEnableSecret | ||
| + | </ | ||
doc/appunti/hardware/cisco_router_2600.1371204585.txt.gz · Last modified: by niccolo
