Complete Cisco Packet Tracer CLI Manual

A practical guide in the style of classic technical documentation


Goal: learn to configure, verify, and troubleshoot networks from the command line while understanding each command.

Table of Contents

  1. How to Use This Manual
  2. Topology and Addressing Plan
  3. 1. IOS Modes and Navigation
  4. 2. Inspect the Device Before Configuring
  5. 3. Configure Router Interfaces and IPv4
  6. 4. Configure the Switch: VLANs and Ports
  7. 5. Configure DHCP Entirely from the Router CLI
  8. 6. Configure and Test PCs
  9. 7. Advanced Concept: Trunking and Router-on-a-Stick
  10. 8. Save and Remove Configurations
  11. 9. Troubleshooting: Diagnose Based on Evidence
  12. 10. Best Practices
  13. 11. Quick Reference
  14. 12. Practice Exercises

How to Use This Manual

This manual teaches you to configure Cisco devices through the IOS CLI in Packet Tracer, understand commands, verify results, and troubleshoot failures. It is organized like classic technical documentation, with a table of contents, chapters, examples, and a quick reference.

Important: Packet Tracer simulates a subset of Cisco features. Available commands depend on the device model. Use ? to check supported syntax. Type the commands yourself; do not type the prompt text, such as Router(config)#.

To practice DHCP entirely from the terminal, the Cisco router can act as a DHCP server. The DHCP service on the Server-PT device is configured through the simulator GUI; its terminal is not a full IOS or Linux shell.

Back to top


Topology and Addressing Plan

PC0 -- Fa0/1 \\
PC1 -- Fa0/2  \\       SWITCH Gi0/1 ===== Gi0/0 ROUTER
PC2 -- Fa0/3   +
Server-PT Fa0/4+
ElementValue
Client VLANVLAN 10 — CLIENTS
IPv4 network192.168.10.0/24
Gateway192.168.10.1
Dynamic DHCP range192.168.10.100–192.168.10.199
Subnet mask255.255.255.0
Example DNS server1.1.1.1

Port names are examples. Confirm the actual interfaces on your device. If the router is the DHCP server, Server-PT does not need to distribute addresses. Do not leave two DHCP servers active on the same VLAN unless that is intentional and planned.

Back to top


1. IOS Modes and Navigation

PromptModePurpose
Router>User EXECBasic commands.
Router#Privileged EXECTroubleshooting and show commands.
Router(config)#Global configurationGeneral settings.
Router(config-if)#Interface configurationIP address, description, and activation.
Switch(config-vlan)#VLAN configurationVLAN name and settings.
Router(dhcp-config)#DHCP pool configurationNetwork, gateway, and DNS.
Switch(config-if-range)#Interface rangeApply commands to multiple ports.
Router> enable
Router# configure terminal
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# exit
Router(config)# end
Router#

Context-Sensitive Help

Router# ?
Router# show ?
Router(config)# interface ?
Router(config-if)# ip address ?

The ? character lists valid commands or arguments in the current context. Use Tab to complete words and the arrow keys to navigate command history. Abbreviations work only when they are unambiguous.

Back to top


2. Inspect the Device Before Configuring

Router> enable
Router# show version
Router# show ip interface brief
Router# show interfaces
Router# show running-config
Switch# show interfaces status
Switch# show vlan brief
Switch# show mac address-table
CommandWhat it displays
show versionSimulated device model and system information.
show ip interface briefIP interfaces, addresses, and status.
show interfacesInterface details, counters, and status.
show interfaces statusSwitch port summary, if supported.
show running-configActive configuration in memory.
show startup-configConfiguration saved for startup.
show vlan briefVLANs and associated access ports.
show mac address-tableLearned MAC addresses and ports.

Interpreting Interface States

Back to top


3. Configure Router Interfaces and IPv4

Enable the Interface

Router# configure terminal
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# description Link to the switch
Router(config-if)# no shutdown
Router(config-if)# end
Router# show ip interface brief

interface gigabitEthernet 0/0 selects the port. description adds an administrative note. no shutdown removes the administrative shutdown; shutdown does the opposite.

Assign an IP Address and Subnet Mask

Router# configure terminal
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# ip address 192.168.10.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# end
Router# show ip interface brief

The address 192.168.10.1/24 will be the clients’ default gateway. The subnet mask 255.255.255.0 corresponds to /24. Use unique addresses; never configure the same IP on two devices.

Back to top


4. Configure the Switch: VLANs and Ports

Create VLAN 10

Switch> enable
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name CLIENTES
Switch(config-vlan)# exit
Switch(config)# end
Switch# show vlan brief

vlan 10 creates or selects VLAN 10. name CLIENTES sets a name. VLANs separate Layer 2 domains; creating a VLAN does not assign IP addresses or configure DHCP.

Assign an Access Port

Switch# configure terminal
Switch(config)# interface fastEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# no shutdown
Switch(config-if)# end
Switch# show vlan brief

switchport mode access configures an access port. switchport access vlan 10 assigns the port to VLAN 10.

Configure Multiple Ports

Switch# configure terminal
Switch(config)# interface range fastEthernet 0/1 - 3
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# no shutdown
Switch(config-if-range)# end

interface range applies commands to multiple compatible ports. If the syntax does not work on your model, configure each port individually. Confirm that Fa0/1–Fa0/3 are actually connected to the PCs.

Back to top


5. Configure DHCP Entirely from the Router CLI

This is the recommended option for practicing CLI-only configuration. The Cisco IOS router can distribute IP addresses. Server-PT, on the other hand, configures its DHCP service through the GUI.

Exclude Reserved Addresses

Router# configure terminal
Router(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.99

The .1–.99 range will not be assigned by the router’s DHCP service. It is reserved for thand gateway, servers, and devices with static addresses.

Create the DHCP Pool

Router(config)# ip dhcp pool VLAN10
Router(dhcp-config)# network 192.168.10.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.10.1
Router(dhcp-config)# dns-server 1.1.1.1
Router(dhcp-config)# exit
Router(config)# end
CommandPurpose
ip dhcp pool VLAN10Creates or selects the VLAN10 pool.
network 192.168.10.0 255.255.255.0Defines the subnet for address assignment.
default-router 192.168.10.1Provides the default gateway to clients.
dns-server 1.1.1.1Provides an example DNS server; it does not guarantee Internet access.
ip dhcp excluded-address início fimExcludes addresses from dynamic assignment.

Verify DHCP

Router# show ip dhcp pool
Router# show ip dhcp binding
Router# show ip dhcp server statistics
Router# show running-config

show ip dhcp pool displays the DHCP pools; show ip dhcp binding lists DHCP leases; show ip dhcp server statistics displays counters when supported. Before clients request addresses, the bindings list may be empty.

Do not also enable DHCP on Server-PT in the same segment unless planned. Two servers may offer different settings to clients.

Back to top


6. Configure and Test PCs

On a PC-PT, DHCP is typically selected under Desktop → IP Configuration → DHCP. The PC terminal simulates some host commands, but it is not a full IOS CLI.

PC> ipconfig
PC> ping 192.168.10.1

The client should receive an IP address 192.168.10.x, subnet mask 255.255.255.0 and gateway 192.168.10.1. An address 169.254.x.x usually indicates that the client did not obtain a DHCP lease.

The DHCP process is known as DORA: Discover (the client searches for a server), Offer (the server offers configuration), Request (the client requests the offer), and ACK (the server acknowledges it). Because the clients and router are on the same VLAN/subnet, DHCP relay is not required.

Back to top


7. Advanced Concept: Trunking and Router-on-a-Stick

In a single-VLAN lab, the switch-to-router link can be an access port in VLAN 10. If the same cable needs to carry multiple VLANs, you can use a trunk on the switch and 802.1Q subinterfaces on the router. This design is called router-on-a-stick. Do not apply this configuration without configuring both ends.

Switch Trunk — Example

Switch# configure terminal
Switch(config)# interface gigabitEthernet 0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan 10,20
Switch(config-if)# no shutdown
Switch(config-if)# end
Switch# show interfaces trunk

Router Subinterfaces — Example

Router# configure terminal
Router(config)# interface gigabitEthernet 0/0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# interface gigabitEthernet 0/0.10
Router(config-subif)# encapsulation dot1Q 10
Router(config-subif)# ip address 192.168.10.1 255.255.255.0
Router(config-subif)# exit
Router(config)# interface gigabitEthernet 0/0.20
Router(config-subif)# encapsulation dot1Q 20
Router(config-subif)# ip address 192.168.20.1 255.255.255.0
Router(config-subif)# end

VLANs 10 and 20 must use different subnets. For a DHCP server on another subnet, you may need to configure ip helper-address on the Layer 3 interface receiving DHCP broadcasts. This is not needed in the simple lab.

Back to top


8. Save and Remove Configurations

running-config is the active configuration in memory; startup-config is the configuration saved for startup. Save the devices and the Packet Tracer project file as well.

Router# copy running-config startup-config
Destination filename [startup-config]?
[Enter]
Router# show startup-config

Repeat the copy command on the switch. To remove an IP address from an interface, typically use no ip address in interface configuration mode. To remove a DHCP pool, use no ip dhcp pool VLAN10 in global configuration mode. Confirm the effect before removing configurations.

Back to top


9. Troubleshooting: Diagnose Based on Evidence

SymptomWhat to Check
Interface administratively downSelect the correct interface and use no shutdown.
Interface down/downCable, remote port, and show interfaces.
VLAN does not appearshow vlan brief; confirm that the VLAN exists and ports are assigned.
PC does not receive a DHCP addressLink, VLAN, DHCP pool, exclusions, and active DHCP server.
PC has an IP address but cannot ping the gatewayIP address, subnet mask, VLAN, and router interface.
Duplicate IP addressStatic IPs inside the DHCP range or two active DHCP servers.
Configuration is lost after rebootcopy running-config startup-config and save the project.

Recommended Troubleshooting Sequence

Switch# show interfaces status
Switch# show vlan brief
Switch# show mac address-table
Router# show ip interface brief
Router# show running-config
Router# show ip dhcp pool
Router# show ip dhcp binding

Troubleshoot from the bottom up: physical connection, port status, VLAN, IP address/subnet mask, gateway, and DHCP service. Change one thing at a time and repeat the test.

Back to top


10. Best Practices

This guide is for educational purposes and does not replace the platform’s official documentation. Authentication and security commands vary by IOS family and device model.

Back to top


11. Quick Reference

TaskCommand
Privileged modeenable
Global configurationconfigure terminal
Select interfaceinterface gigabitEthernet 0/0
Enable interfaceno shutdown
Configure IPv4ip address IP_ADDRESS SUBNET_MASK
Create VLANvlan 10
Access portswitchport mode access
Assign VLANswitchport access vlan 10
View IP interfacesshow ip interface brief
View VLANsshow vlan brief
View active configurationshow running-config
Save configurationcopy running-config startup-config
Create DHCP poolip dhcp pool POOL_NAME
Set DHCP networknetwork NETWORK SUBNET_MASK
Set DHCP gatewaydefault-router IP
View DHCP leasesshow ip dhcp binding
Test connectivityping IP_ADDRESS

Glossary

TermDefinition
CLICommand-line interface.
IOSSimulated Cisco network operating system.
VLANLogical Layer 2 segmentation.
Access portA port assigned to a VLAN, typically for an end device.
TrunkA link that carries multiple VLANs using tags.
GatewayA router used to reach other networks.
DHCPProtocol for dynamically assigning IP configuration.
Running-configActive configuration.
Startup-configConfiguration saved for startup.

Back to top


12. Practice Exercises

  1. Identify the router interfaces using show ip interface brief.
  2. Configure 192.168.10.1/24 on the interface connected to the switch.
  3. Create VLAN 10 and assign the three PC ports to it.
  4. Configure the router as a DHCP server, with exclusions and the VLAN10 pool.
  5. Request DHCP on the PCs and check show ip dhcp binding.
  6. In a copy of the project, introduce a fault (shut down a port or use the wrong VLAN) and diagnose it using show commands and ping.

Next challenge: create VLAN 20 with network 192.168.20.0/24. Decide whether to use a separate physical interface or a trunk with subinterfaces. Do not use the same subnet on two separate routed VLANs.

Back to top