Dans cet article, vous trouverez quelque ligne de commande bien utile pour les routeur Cisco
Activer/désactiver les notifications (par défaut en mode console)
R2#terminal monitor R2# R2#terminal no monitor R2#
Afficher les routes
R1#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B – BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E – EGP i - IS-IS, L1- IS-IS lev-1, L2 - IS-IS lev-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o – ODR P - periodic downloaded static route Gateway of last resort is not set 10.0.0.0/16 is subnetted, 1 subnets S 10.1.0.0 [1/0] via 192.168.2.1 C 192.168.1.0/24 is directly connected, FastEthernet0/1 C 192.168.2.0/24 is directly connected, FastEthernet0/2
Afficher les voisins
Afficher ses voisins en utilisant le protocole CDP (cisco discovery protocol). La commande suivante active le protocole cdp puis affiche les voisins.
R2(config)#cdp run
R2(config)#exit
R2#show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP, r - Repeater
Device ID Local Intrfce Holdtme Capability Platform Port ID
R1 Eth 1/0 125 R 7206VXR Eth 1/0
R2#
Il est aussi possible d’afficher les détails sur le voisin en filtrant sur un port ou sur le nom d’un voisin.
R2#show cdp neighbors ethernet 1/0 detail ------------------------- Device ID: R1 Entry address(es): IP address: 192.168.100.1 Platform: Cisco 7206VXR, Capabilities: Router Interface: Ethernet1/0, Port ID (outgoing port): Ethernet1/0 Holdtime : 124 sec Version : Cisco IOS Software, 7200 Software (C7200-IPBASEK9-M), Version 12.4(22)T, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2008 by Cisco Systems, Inc. Compiled Fri 10-Oct-08 10:10 by prod_rel_team advertisement version: 2 Duplex: half R2# R2# R2# R2#show cdp entry R1 ------------------------- Device ID: R1 Entry address(es): IP address: 192.168.100.1 Platform: Cisco 7206VXR, Capabilities: Router Interface: Ethernet1/0, Port ID (outgoing port): Ethernet1/0 Holdtime : 173 sec
Pour des raisons de sécurité, désactiver le protocole.
R1(config)#no cdp run R1(config)#end R1# R1#sh cdp neighbors % CDP is not enabled R1#
Fair un ping
R2#ping Protocol [ip]: Target IP address: 192.168.1.1 Repeat count [5]: Datagram size [100]: Timeout in seconds [2]: Extended commands [n]: Sweep range of sizes [n]: Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.100.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms R2#
Afficher l’inventaire du matériel
R1#show inventory
NAME: "Chassis", DESCR: "Cisco 7206VXR, 6-slot chassis"
PID: CISCO7206VXR , VID: , SN: 4279256517
NAME: "NPE400 0", DESCR: "Cisco 7200VXR Network Processing Engine NPE-400"
PID: NPE-400 , VID: , SN: 11111111
NAME: "module 0", DESCR: "I/O FastEthernet (TX-ISL)"
PID: C7200-IO-FE-MII/RJ45=, VID: , SN: 4294967295
Afficher l’utilisation de la mémoire et du processeur
R1#show processes memory Processor Pool Total: 150516196 Used: 23573320 Free: 126942876 I/O Pool Total: 16777216 Used: 2737120 Free: 14040096 Transient Pool Total: 16777216 Used: 21636 Free: 16755580 PID TTY Allocated Freed Holding Getbufs Retbufs Process 0 0 39544288 16210268 20763096 0 0 *Init* 0 0 12052 73028 12052 0 0 *Sched* 0 0 22660 317548 412 183104 183104 *Dead* R1# R1# R1#show processes cpu CPU utilization for five seconds: 1%/100%; one minute: 1%; five minutes: 1% PID Runtime(ms) Invoked uSecs 5Sec 1Min 5Min TTY Process 1 12 64 187 0.00% 0.00% 0.00% 0 Chunk Manager 2 0 240 0 0.00% 0.00% 0.00% 0 Load Meter 3 5280 445 11865 0.23% 0.25% 0.22% 0 Exec 4 0 1 0 0.00% 0.00% 0.00% 0 EDDRI_MAIN 5 800 145 5517 0.00% 0.06% 0.05% 0 Check heaps 6 0 1 0 0.00% 0.00% 0.00% 0 Pool Manager 7 0 2 0 0.00% 0.00% 0.00% 0 Timers
Afficher l’état des interfaces
R1#show interfaces FastEthernet0/0 is down, line protocol is down Hardware is DEC21140, address is ca03.0bc0.0000 (bia ca03.0bc0.0000) MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Half-duplex, 100Mb/s, 100BaseTX/FX
Il est possible d’afficher l’état d’une interface en particulier en faisant suivre la commande du numéro de l’interface (R1#show interfaces fa1/0).
Afficher les statistiques pour les interfaces
R1#show interfaces stats FastEthernet0/0 Switching path Pkts In Chars In Pkts Out Chars Out Processor 0 0 0 0 Route cache 0 0 0 0 Total 0 0 0 0 Ethernet1/0 Switching path Pkts In Chars In Pkts Out Chars Out Processor 39 9346 165 17188 Route cache 0 0 0 0 Total 39 9346 165 17188
Mise à zéro des compteurs pour les interfaces
R1#clear counters Clear "show interface" counters on all interfaces [confirm] R1#
Afficher la température et l’état des alimentations électriques
R1#show environment all Power Supplies: Power Supply 1 is AC Power Supply. Unit is on. Power Supply 2 is AC Power Supply. Unit is on. Temperature readings: I/O Cont Inlet measured at 22C/71F I/O Cont Outlet measured at 22C/71F NPE Inlet measured at 22C/71F NPE Outlet measured at 22C/71F
Fourniture d’un rapport complet sur le routeur (ça peut être long …)
R1#show tech-support
Afficher les statistiques IP
R1#sh ip traffic IP statistics: Rcvd: 14 total, 14 local destination 0 format errors, 0 checksum errors, 0 bad hop count 0 unknown protocol, 0 not a gateway 0 security failures, 0 bad options, 0 with options Opts: 0 end, 0 nop, 0 basic security, 0 loose source route
Afficher les protocoles configurés
R1#show protocols Global values: Internet Protocol routing is enabled FastEthernet0/0 is up, line protocol is up Internet address is 192.168.0.1/24 Serial0/0 is administratively down, line protocol is down FastEthernet0/1 is up, line protocol is up Internet address is 192.168.100.1/24 Serial0/1 is administratively down, line protocol is down
Afficher l’état des protocoles de routage actif
R1#sh ip protocols Routing Protocol is "ospf 100" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 172.16.0.1 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: 10.0.0.0 0.0.0.255 area 0 10.0.3.0 0.0.0.255 area 0 Reference bandwidth unit is 100 mbps Routing Information Sources: Gateway Distance Last Update 172.16.0.2 110 00:04:42 172.16.0.3 110 00:04:42 Distance: (default is 110) R1#
Afficher la configuration courante du routeur
R1#sh r