Cheat sheet de Cisco IOS

Referencia de Cisco IOS/IOS-XE con búsqueda: interfaces, VLAN, enrutamiento, listas de acceso, port security, STP, EtherChannel, SNMP y NAT, con cada parámetro explicado.

Se ejecuta en tu navegador · no se envía nadaNuevo

41 comandos

Modes & navigation

enable configure terminal interface <name> exit / endThe core mode hierarchy: user EXEC (>) -> privileged EXEC (#, via "enable") -> global configuration (config)# -> a sub-mode like interface config (config-if)#.

"exit" moves up one level; "end" jumps straight back to privileged EXEC from any configuration sub-mode. Ctrl+Z does the same as "end".

Ejemplo

enable
configure terminal
interface GigabitEthernet0/1
 ip address 192.168.1.1 255.255.255.0
 no shutdown
end
? (question mark)Press ? at any point to list available commands or keywords at the current position, and Tab to auto-complete a partially typed command.

Works mid-command too, for example "show ip ?" lists every keyword that can follow "show ip".

<show-command> | include <pattern> <show-command> | section <pattern>Filter show command output to matching lines, or a matching configuration section.

Ejemplo

show running-config | section interface GigabitEthernet0/1

Opciones

| include <pattern>Keep only lines containing the pattern.
| exclude <pattern>Remove lines containing the pattern.
| section <pattern>Keep whole config sections whose header line matches the pattern.
| begin <pattern>Show output starting from the first matching line onward.

System & info

show versionShow the IOS version, uptime, hardware model, memory, and the configuration register value.

The configuration register controls boot behavior; a value other than the normal 0x2102 is worth investigating if a device is not booting as expected.

show running-configShow the active configuration currently running in RAM. This is what the device is actually doing right now.

Changes made in configuration mode take effect immediately in the running-config, but are lost on reboot unless saved to startup-config.

show startup-configShow the configuration stored in NVRAM, which is what the device loads on the next boot.

Compare against "show running-config" to see exactly which changes have not been saved yet.

copy running-config startup-configSave the current running configuration to NVRAM so it survives a reboot.

The older shorthand "write memory" (or just "write"/"wr") does the same thing on most IOS versions and is still widely used, though "copy running-config startup-config" is the documented form.

Cuidado: Without this step, any configuration change is lost on reload. Always save after verifying a change works as intended.
reloadReboot the device.

Opciones

reload in <minutes>Schedule a reload after a delay; useful as a safety net before a risky change (cancel with "reload cancel" if the change works).
Cuidado: If the running configuration has not been saved to startup-config, reloading discards all unsaved changes.
show ip interface briefShow a compact one-line-per-interface summary: IP address, and the interface's administrative and line protocol status.

"administratively down" means someone configured "shutdown" on it; "down" (line protocol) with "up" (admin) usually means a physical/Layer 1 or Layer 2 problem.

Interfaces & VLANs

interface <type><number> ip address <ip> <mask> no shutdownConfigure an interface: assign an IPv4 address and subnet mask, and bring the interface up.

Ejemplo

interface GigabitEthernet0/1
 ip address 192.168.10.1 255.255.255.0
 no shutdown

Opciones

no shutdownAdministratively enable the interface. Interfaces on routers are shutdown by default out of the box; switch ports typically are not.
shutdownAdministratively disable the interface.
description <text>Free-text label, shown in "show interfaces" and "show ip interface brief" with some output formats; purely documentation, no functional effect.
interface <name> switchport mode access switchport access vlan <id>Put a switch port into access mode and assign it to a single VLAN, the standard config for a port connecting to an end device.

Ejemplo

interface GigabitEthernet0/5
 switchport mode access
 switchport access vlan 20
interface <name> switchport mode trunk switchport trunk allowed vlan <list>Put a switch port into trunk mode, carrying tagged traffic for multiple VLANs, typically used between switches.

Opciones

switchport trunk allowed vlan <list>Restrict which VLANs are carried on the trunk, for example "10,20,30" or "10-30". Without this, a trunk carries all VLANs by default.
switchport trunk native vlan <id>VLAN carried untagged on the trunk. Must match on both ends or traffic leaks between VLANs.
vlan <id> name <label>Create a VLAN and give it a descriptive name.

Ejemplo

vlan 20
 name Guest-WiFi
interface vlan <id> ip address <ip> <mask> no shutdownCreate a switch virtual interface (SVI), giving a VLAN a routable IP address, typically the default gateway for devices in that VLAN.

Requires IP routing enabled ("ip routing" in global config) on a Layer 3 switch to actually route between VLANs.

Routing

ip route <destination-network> <mask> <next-hop-or-interface>Add a static route.

A destination of 0.0.0.0 with mask 0.0.0.0 is a default route, matching any traffic that has no more specific route.

Ejemplo

ip route 0.0.0.0 0.0.0.0 203.0.113.1
show ip routeShow the full routing table, with each route's source (connected, static, or a routing protocol code like O for OSPF, D for EIGRP).

A code letter before a route line explains why it is there: C for directly connected, S for static, O for OSPF-learned, D for EIGRP-learned, B for BGP-learned.

router ospf <process-id> network <network> <wildcard-mask> area <area-id>Enable OSPF and advertise a network into a given area.

OSPF uses a wildcard mask (inverse of a subnet mask), not a regular subnet mask, when specifying the network.

Ejemplo

router ospf 1
 network 192.168.10.0 0.0.0.255 area 0
show ip ospf neighborShow OSPF neighbor adjacencies and their state. A healthy adjacency should show state FULL.

A neighbor stuck in 2WAY (on a broadcast network, normal for non-DR/BDR routers) or stuck in INIT/EXSTART usually points at an MTU mismatch, area mismatch, or an authentication/timer mismatch.

Access control lists

ip access-list standard <name> permit <network> <wildcard-mask> deny anyA standard ACL filters only on source IP address, typically used to restrict management access (VTY lines) rather than general traffic filtering.

There is an implicit "deny any" at the end of every ACL even without writing it explicitly; writing it out makes the intent visible and is good practice.

Ejemplo

ip access-list standard MGMT-ACCESS
 permit 192.168.1.0 0.0.0.255
 deny any
ip access-list extended <name> permit <protocol> <source> <source-wildcard> <destination> <destination-wildcard> [eq <port>]An extended ACL can filter on source and destination address, protocol, and port, used for general traffic filtering on an interface.

ACL entries are evaluated top to bottom; the first match wins, and nothing after a match is checked, so order matters as much as the rules themselves.

Ejemplo

ip access-list extended BLOCK-TELNET
 deny tcp any any eq 23
 permit ip any any
Cuidado: Forgetting a final "permit" statement after specific deny rules means every other packet gets implicitly denied, since every ACL ends with an implicit deny any.
interface <name> ip access-group <acl-name> <in|out>Apply an ACL to an interface, in a specific direction.

Opciones

inFilter traffic entering the router through this interface.
outFilter traffic leaving the router through this interface.
show access-listsShow all configured ACLs and, for each entry, a running match counter since the last clear.

The match counters are the fastest way to confirm whether a specific ACL line is actually being hit by real traffic.

Diagnose

show interfaces <name>Show detailed interface statistics: errors, drops, collisions, utilization, duplex/speed.

Check "input errors", "CRC", "collisions" and duplex mismatches here first when troubleshooting a slow or flapping link.

ping <ip-or-host> traceroute <ip-or-host>Test reachability and trace the path to a destination from the device itself.

Opciones

ping <ip> source <interface-or-ip>Source the ping from a specific local interface/IP instead of the default outgoing one.
debug <feature> undebug all / no debug allEnable live debug output for a specific feature or protocol, for example "debug ip ospf adj" or "debug ip packet".

"terminal monitor" is needed in an SSH/Telnet session to actually see debug output there (console sessions see it by default).

Cuidado: Debug output on a busy device, especially packet-level debugs, can consume significant CPU and even cause an outage. Always run "undebug all" when finished, and avoid broad debugs on production hardware during peak hours.
show loggingShow the device's internal log buffer: interface up/down events, configuration changes, and system messages.

The buffer is limited and wraps; for persistent logging across reboots, configure a remote syslog server with "logging host <ip>".

show cdp neighbors detailShow directly connected Cisco devices discovered via CDP: device ID, IP address, platform, and local/remote port.

Useful for mapping an unfamiliar topology without needing prior documentation. LLDP ("show lldp neighbors detail") is the vendor-neutral equivalent for mixed-vendor networks.

Port security & STP

interface <name> switchport port-security switchport port-security maximum <n> switchport port-security violation <mode>Limit how many source MAC addresses are allowed on an access port, and what happens when that limit is exceeded.

Ejemplo

interface GigabitEthernet0/5
 switchport mode access
 switchport port-security
 switchport port-security maximum 2
 switchport port-security violation restrict

Opciones

switchport port-security maximum <n>Maximum number of learned MAC addresses allowed on the port. Default is 1.
switchport port-security violation protectSilently drop frames from addresses beyond the maximum, no log, port stays up.
switchport port-security violation restrictDrop frames from addresses beyond the maximum and log/count the violation, port stays up.
switchport port-security violation shutdownDefault: put the port into err-disabled state on a violation. Requires a manual "shutdown" / "no shutdown" or errdisable auto-recovery to bring it back.
switchport port-security mac-address stickyDynamically learn allowed addresses and keep them across a reboot (saved into the running config once learned).
Cuidado: The default violation mode is shutdown, which takes the port completely offline on a violation. On a port expected to see more than one device (for example behind an unmanaged switch or IP phone), raise the maximum or switch to restrict before enabling this.
show port-security interface <name>Show the port security configuration and current learned MAC address count for an interface.

Shows whether the port is currently in a security-violation shutdown state, and lists the actual learned MAC addresses to compare against what is expected to be plugged in.

errdisable recovery cause <cause> errdisable recovery interval <seconds>Automatically bring a port back from err-disabled state after a delay, instead of requiring a manual shutdown/no shutdown.

Without this, an err-disabled port (from a port-security violation, BPDU Guard, or other causes) stays down until an administrator intervenes.

Ejemplo

errdisable recovery cause psecure-violation
errdisable recovery interval 300
interface <name> spanning-tree portfast spanning-tree bpduguard enablePortFast skips the normal STP listening/learning delay on an access port so it forwards traffic immediately after coming up. BPDU Guard protects that assumption by disabling the port if it ever receives a BPDU.

PortFast is meant only for ports connecting to a single end host, never to another switch. BPDU Guard enforces that: if a switch (or a loop) is connected to a PortFast port by mistake, the port is immediately err-disabled instead of participating in (and potentially breaking) spanning tree.

Cuidado: Enabling PortFast on a port that is later connected to another switch, without BPDU Guard, can create a bridging loop that PortFast's skipped STP checks would otherwise have caught.
show spanning-treeShow spanning tree state per VLAN: root bridge, port roles (root/designated/blocking) and costs.

Unexpected topology changes (high "Topology Change" counters) or a port stuck in a blocking state that should be forwarding are the usual signs of an STP problem.

Opciones

show spanning-tree vlan <id>Limit the output to one VLAN.
show spanning-tree summaryA condensed overview of the STP mode and port states across all VLANs.

EtherChannel

interface range <name1> - <name2> channel-group <n> mode <mode>Bundle multiple physical links into a single logical EtherChannel (port-channel) for more bandwidth and link redundancy.

Ejemplo

interface range GigabitEthernet0/1 - 2
 channel-group 1 mode active

Opciones

mode activeLACP (IEEE 802.3ad), actively initiates negotiation. Recommended for interoperability with non-Cisco gear.
mode passiveLACP, only responds to negotiation; both ends cannot be passive or the channel never forms.
mode onStatic EtherChannel, no negotiation protocol at all. Both ends must be manually and identically configured, and mismatches are not detected automatically.
mode desirable / autoCisco-proprietary PAgP, mainly seen on older equipment; LACP is preferred for new configurations.
Cuidado: Every port in the channel must have matching speed, duplex, trunk/access mode, and allowed VLANs before joining, or the switch will refuse to add it (or the channel will behave inconsistently).
show etherchannel summaryShow configured port-channels and the state of each bundled physical port.

A port shown as "(I)" (individual) or "(D)" (down) instead of "(P)" (bundled) is not actually part of the channel yet, usually due to a configuration mismatch with the other member ports.

SNMP & management

snmp-server community <string> <RO|RW>Configure SNMPv2c read-only or read-write access using a community string.

Ejemplo

snmp-server community M0n1t0r-Only RO
Cuidado: SNMPv2c sends the community string in plain text and offers no real authentication; treat it like a weak, shared password. Prefer SNMPv3 for anything beyond an isolated management network, and never leave default community strings like "public" or "private" configured.
snmp-server group <group> v3 priv snmp-server user <user> <group> v3 auth sha <auth-pass> priv aes 128 <priv-pass>Configure SNMPv3 with authentication and encryption, the secure alternative to a plain community string.

Opciones

auth sha <pass>Authentication algorithm and password, verifies the sender's identity.
priv aes 128 <pass>Encryption algorithm and password, encrypts the message content.
ntp server <ip>Synchronize the device clock to an NTP server.

Accurate time matters beyond convenience: syslog timestamps, certificate validity checks and AAA/Kerberos-adjacent features all depend on it.

logging host <ip> logging trap <level>Send system log messages to a remote syslog server, and set the minimum severity level to send.

The local log buffer ("show logging") wraps and is lost on reboot; a remote syslog server is what actually gives you log retention.

Opciones

logging trap <level>Minimum severity to forward: emergencies, alerts, critical, errors, warnings, notifications, informational, debugging (from most to least severe).

NAT & PAT

ip nat inside source list <acl> interface <outside-if> overloadConfigure dynamic NAT with port translation (PAT/"NAT overload"): many inside hosts share the single outside interface IP, distinguished by source port.

Also requires "ip nat inside" and "ip nat outside" configured on the respective interfaces; NAT only translates traffic crossing between an inside- and an outside-marked interface.

Ejemplo

access-list 1 permit 192.168.1.0 0.0.0.255
interface GigabitEthernet0/0
 ip nat outside
interface GigabitEthernet0/1
 ip nat inside
ip nat inside source list 1 interface GigabitEthernet0/0 overload

Opciones

overloadEnables PAT so many inside addresses can share one outside address. Without it, the pool/interface would need one outside address per simultaneous inside host.
ip nat inside source static <inside-ip> <outside-ip>Create a permanent one-to-one NAT mapping, typically used to expose an internal server on a public address.

Ejemplo

ip nat inside source static 192.168.1.10 203.0.113.10
show ip nat translationsShow the current NAT translation table: inside/outside local and global address pairs.

Opciones

show ip nat statisticsSummary counters: active translations, hits/misses, and which interfaces are marked inside/outside.

Las descripciones de esta referencia están por ahora en inglés.

Explicación

Busca o filtra por grupo y copia un comando con un clic. Abre un comando para ver qué hace, un ejemplo y cada parámetro que acepta, con avisos para todo lo que pueda bloquear tráfico o dejarte sin acceso de administración.

🔒 Tu entrada se queda en tu navegador y no se envía a ningún sitio.

Preguntas frecuentes

¿Por qué desaparecen mis cambios de configuración tras un reinicio?

Los cambios en modo de configuración solo viven en la running-config (RAM) hasta que se guardan. Ejecuta "copy running-config startup-config" (o el más antiguo "write memory") para guardarlos en la NVRAM.

¿Qué pasa cuando ocurre una violación de port-security?

Por defecto el puerto pasa a estado err-disabled (violation shutdown) y queda totalmente fuera de servicio hasta que se restablece manualmente o errdisable recovery lo recupera tras un tiempo. Los modos restrict y protect descartan el tráfico adicional en su lugar, sin desactivar el puerto.

Qué hacer después

Más en esta sección

  • Cheat sheet de FortiGate (FortiOS)Referencia de comandos CLI de FortiGate con búsqueda: sistema, red, política de firewall, VPN y diagnóstico, con cada parámetro explicado.
  • Cheat sheet de NmapReferencia de comandos de Nmap con búsqueda: descubrimiento de hosts, tipos de escaneo, detección de servicio/SO, scripts NSE y temporización, con cada opción explicada.
  • Cheat sheet de Palo Alto (PAN-OS)Referencia de comandos CLI de PAN-OS con búsqueda: política de seguridad, NAT, VPN y diagnóstico, con cada parámetro explicado.

También útil

  • Comparador de reglas de firewallCompara dos configuraciones ACL estilo Cisco (antes/después, o dos dispositivos) para ver exactamente qué reglas se añadieron, eliminaron o cambiaron.
  • Mapeador de reglas de firewallPega reglas ACL estilo Cisco para encontrar reglas ensombrecidas, redundantes y duplicadas, reglas abiertas a internet, y puertos sensibles expuestos.
  • Puertos de red habitualesLista con búsqueda de puertos TCP y UDP conocidos: SSH, HTTP, HTTPS, RDP, SMB, DNS, bases de datos y más.

¿Has encontrado un problema o tienes una sugerencia? Cuéntanoslo