Exam Center · Command Reference

Cisco IOS Command Reference

The commands you actually type, grouped by task and shown with the prompt at which they run. Use the mode column: > user EXEC, # privileged EXEC, (config)# global configuration, and interface/config sub-modes.

CCNA 200-301 v1.1 Reference Verified 2026-10-11

CLI modes & basic setup

The prompt tells you where you are. Move deeper with enable and configure terminal; return with exit or end.

TaskCommandMode
Enter privileged EXECenable>
Enter global configconfigure terminal#
Set hostnamehostname R1(config)#
Protect privileged modeenable secret StrongPass123(config)#
Encrypt plaintext passwordsservice password-encryption(config)#
Set minimum password lengthsecurity passwords min-length 10(config)#
Console password & loginline console 0 then password ..., login(config)#
Idle timeoutexec-timeout 5 0(config-line)#
Save configurationcopy running-config startup-config#
Disable DNS lookup (avoid typos hanging)no ip domain-lookup(config)#

Interfaces

TaskCommandMode
Select an interfaceinterface gi0/1(config)#
Describe an interfacedescription Link to R2(config-if)#
Assign IPv4 addressip address 10.0.0.1 255.255.255.0(config-if)#
Enable / disableno shutdown / shutdown(config-if)#
Set speed and duplexspeed 1000 then duplex full(config-if)#
Interface rangeinterface range fa0/1-10(config)#
Loopback interfaceinterface loopback 0 then ip address ...(config)#
Turn a switch port into a routed portno switchport(config-if)#

VLANs, trunks & voice

TaskCommandMode
Create / name a VLANvlan 20 then name SALES(config)#
Set an access portswitchport mode access(config-if)#
Assign access VLANswitchport access vlan 20(config-if)#
Set a trunkswitchport mode trunk(config-if)#
Restrict allowed VLANsswitchport trunk allowed vlan 10,20(config-if)#
Set native VLANswitchport trunk native vlan 99(config-if)#
Disable DTP negotiationswitchport nonegotiate(config-if)#
Voice VLANswitchport voice vlan 150(config-if)#
Management SVIinterface vlan 1 then ip address ..., no shutdown(config)#

Spanning Tree & EtherChannel

TaskCommandMode
Select STP modespanning-tree mode rapid-pvst(config)#
Become root for a VLANspanning-tree vlan 10 root primary(config)#
Set a port as PortFastspanning-tree portfast(config-if)#
Guard against rogue switchesspanning-tree bpduguard enable(config-if)#
Build an LACP channelchannel-group 1 mode active(config-if)#
Configure the port-channelinterface port-channel 1 then switchport mode trunk(config)#

Static routing

TaskCommandMode
Static route via next hopip route 192.168.2.0 255.255.255.0 10.0.0.2(config)#
Default routeip route 0.0.0.0 0.0.0.0 10.0.0.2(config)#
Floating static (backup)ip route 0.0.0.0 0.0.0.0 10.0.0.2 111(config)#
Enable IPv4 routingip routing(config)#
IPv6 static routeipv6 route ::/0 2001:db8::1(config)#
Enable IPv6 routingipv6 unicast-routing(config)#

OSPF

TaskCommandMode
Start OSPF processrouter ospf 1(config)#
Set router IDrouter-id 1.1.1.1(config-router)#
Advertise a networknetwork 10.1.1.0 0.0.0.255 area 0(config-router)#
Enable OSPF on an interfaceip ospf 1 area 0(config-if)#
Passive interfacepassive-interface gi0/0(config-router)#
Reset the processclear ip ospf process#
! Advertise two networks in area 0 using classic network statements
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 10.1.1.0 0.0.0.255 area 0
R1(config-router)# network 10.1.2.0 0.0.0.255 area 0

HSRP

TaskCommandMode
Set virtual IPstandby 1 ip 10.0.0.1(config-if)#
Set priority (higher wins)standby 1 priority 150(config-if)#
Enable preemptionstandby 1 preempt(config-if)#
Verify HSRPshow standby brief#

NAT & DHCP

TaskCommandMode
Mark inside / outsideip nat inside / ip nat outside(config-if)#
Source ACL for NATaccess-list 1 permit 10.0.0.0 0.0.0.255(config)#
Configure PATip nat inside source list 1 interface gi0/0 overload(config)#
Static one-to-one NATip nat inside source static 10.0.0.10 203.0.113.10(config)#
Exclude addressesip dhcp excluded-address 10.0.0.1 10.0.0.9(config)#
Create a DHCP poolip dhcp pool LAN(config)#
Pool network & gatewaynetwork 10.0.0.0 255.255.255.0, default-router 10.0.0.1, dns-server 8.8.8.8(config-dhcp)#
DHCP relayip helper-address 10.0.0.9(config-if)#

Access control lists

TaskCommandMode
Standard numbered ACLaccess-list 10 permit 10.0.0.0 0.0.0.255(config)#
Extended numbered ACLaccess-list 100 permit tcp any host 10.0.0.5 eq 80(config)#
Named ACLip access-list standard MGMT(config)#
Apply to an interfaceip access-group 10 in(config-if)#
VTY access controlaccess-class 10 in(config-line)#

NTP, SNMP, syslog, SSH

TaskCommandMode
NTP serverntp server 10.0.0.5(config)#
Time zoneclock timezone GMT 0(config)#
Syslog serverlogging host 192.168.1.50(config)#
Syslog trap levellogging trap warning(config)#
SNMP community (read-only)snmp-server community public RO(config)#
SNMP host for trapssnmp-server host 192.168.1.60 version 2c public(config)#
DNS clientip name-server 8.8.8.8(config)#
SSH: domain name firstip domain-name example.com(config)#
Generate RSA keyscrypto key generate rsa(config)#
Local userusername admin secret StrongPass123(config)#
SSH-only VTYline vty 0 4 then transport input ssh, login local(config)#

Port security & Layer 2 protection

TaskCommandMode
Enable port securityswitchport port-security(config-if)#
Max MAC addressesswitchport port-security maximum 2(config-if)#
Static MAC addressswitchport port-security mac-address 00aa.bbcc.ddee(config-if)#
Sticky learningswitchport port-security mac-address sticky(config-if)#
Violation modeswitchport port-security violation restrict(config-if)#
DHCP snooping (global)ip dhcp snooping(config)#
Trust an uplinkip dhcp snooping trust(config-if)#
Dynamic ARP Inspectionip arp inspection vlan 10(config)#
Disable unused portsshutdown on unused interfaces(config-if)#

Verification (show commands)

QuestionCommandMode
Interfaces up/down and IPsshow ip interface brief#
Routing tableshow ip route#
OSPF neighboursshow ip ospf neighbor#
OSPF databaseshow ip ospf database#
MAC address tableshow mac address-table#
VLANs and port membersshow vlan brief#
Trunk statusshow interfaces trunk#
EtherChannel summaryshow etherchannel summary#
Spanning treeshow spanning-tree#
CDP / LLDP neighboursshow cdp neighbors / show lldp neighbors#
NAT translationsshow ip nat translations#
Access listsshow access-lists#
Running configurationshow running-config#
Current time / NTPshow clock / show ntp status#

Self-test (10 questions)

Answer all ten; feedback and explanations appear immediately.

Command recall
  1. Which command saves the running configuration to NVRAM?

    • write memory /all
    • save config
    • copy running-config startup-config
    • commit

    copy running-config startup-config persists the running config to NVRAM. The older write memory also works on many IOS versions.

  2. Which command enters global configuration mode from privileged EXEC?

    • enable
    • configure terminal
    • interface gi0/0
    • show running-config

    configure terminal moves from # to (config)#. enable moves from user to privileged EXEC.

  3. Which command assigns VLAN 30 to the current access port?

    • switchport access vlan 30
    • switchport trunk allowed vlan 30
    • vlan 30 access
    • ip vlan 30

    switchport access vlan 30 sets the access VLAN. The allowed-VLAN command applies to trunks, not access ports.

  4. Which command builds an LACP EtherChannel on an interface?

    • channel-group 1 mode desirable
    • channel-group 1 mode on
    • channel-group 1 mode passive-only
    • channel-group 1 mode active

    mode active is LACP and negotiates. desirable is PAgP and on forces the bundle with no protocol.

  5. Which command configures a default route via next hop 10.0.0.2?

    • ip route 10.0.0.2 0.0.0.0
    • ip route 0.0.0.0 0.0.0.0 10.0.0.2
    • default-route 10.0.0.2
    • ip default 10.0.0.2

    A default route is ip route 0.0.0.0 0.0.0.0 NEXT-HOP. ip default-gateway exists but applies to a device acting as a host, not for routing.

  6. Which command advertises 10.1.1.0/24 in OSPF area 0?

    • network 10.1.1.0 255.255.255.0 area 0
    • ospf network 10.1.1.0 area 0
    • network 10.1.1.0 0.0.0.255 area 0
    • area 0 network 10.1.1.0/24

    OSPF network statements use a wildcard mask, not a subnet mask. The wildcard for /24 is 0.0.0.255.

  7. Which command configures PAT using interface Gi0/0 and ACL 1?

    • ip nat inside source list 1 interface gi0/0 overload
    • ip nat source list 1 overload
    • nat inside pat gi0/0
    • ip nat pool gi0/0 overload

    This exact command translates sources matched by ACL 1 to the Gi0/0 address with overload (PAT). Remember to mark the inside and outside interfaces.

  8. Which command restricts VTY lines to SSH and uses the local user database?

    • transport input telnet
    • login ssh
    • ip ssh enable-vty
    • transport input ssh and login local

    Under line vty 0 4, transport input ssh allows only SSH and login local forces local username/password authentication.

  9. Which command sets a port-security maximum of 3 MAC addresses?

    • port-security max-mac 3
    • switchport port-security maximum 3
    • switchport secure 3
    • mac-address limit 3

    After enabling switchport port-security, set the limit with switchport port-security maximum 3. The port must be an access or manually configured port.

  10. Which command lists the directly connected Cisco neighbours?

    • show ip route
    • show vlan brief
    • show cdp neighbors
    • show ntp status

    show cdp neighbors lists directly connected Cisco devices and their platforms and interfaces. LLDP is the open equivalent.

Sources & references

  1. Cisco. CCNA (200-301) Exam Topics, configuration and verification. cisco.com.
  2. Cisco. Cisco IOS Configuration Fundamentals Command Reference. cisco.com.
  3. Cisco. Cisco IOS IP Routing: OSPF Command Reference. cisco.com.
  4. IEEE. IEEE 802.1Q: Bridges and Bridged Networks. standards.ieee.org.

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.