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.
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.
PC0 -- Fa0/1 \\ PC1 -- Fa0/2 \\ SWITCH Gi0/1 ===== Gi0/0 ROUTER PC2 -- Fa0/3 + Server-PT Fa0/4+
| Element | Value |
|---|---|
| Client VLAN | VLAN 10 — CLIENTS |
| IPv4 network | 192.168.10.0/24 |
| Gateway | 192.168.10.1 |
| Dynamic DHCP range | 192.168.10.100–192.168.10.199 |
| Subnet mask | 255.255.255.0 |
| Example DNS server | 1.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.
| Prompt | Mode | Purpose |
|---|---|---|
| Router> | User EXEC | Basic commands. |
| Router# | Privileged EXEC | Troubleshooting and show commands. |
| Router(config)# | Global configuration | General settings. |
| Router(config-if)# | Interface configuration | IP address, description, and activation. |
| Switch(config-vlan)# | VLAN configuration | VLAN name and settings. |
| Router(dhcp-config)# | DHCP pool configuration | Network, gateway, and DNS. |
| Switch(config-if-range)# | Interface range | Apply commands to multiple ports. |
Router> enable Router# configure terminal Router(config)# interface gigabitEthernet 0/0 Router(config-if)# exit Router(config)# end Router#
enable: enters privileged EXEC mode.configure terminal or conf t: global configuration mode.interface ...: selects an interface.exit: moves back one level.end or Ctrl+Z: returns to privileged EXEC mode.disable: returns to user EXEC mode.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.
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
| Command | What it displays |
|---|---|
| show version | Simulated device model and system information. |
| show ip interface brief | IP interfaces, addresses, and status. |
| show interfaces | Interface details, counters, and status. |
| show interfaces status | Switch port summary, if supported. |
| show running-config | Active configuration in memory. |
| show startup-config | Configuration saved for startup. |
| show vlan brief | VLANs and associated access ports. |
| show mac address-table | Learned MAC addresses and ports. |
administratively down: interface disabled by configuration; use no shutdown if appropriate.down/down: cable missing, remote port shut down, or a physical-layer issue.physical-layer link is up, but the line protocol is not operational.: physical-layer link is up, but the line protocol is not operational.up/up: interface and protocol are up; this does not guarantee that the IP, VLAN, gateway, or DHCP settings are correct.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.
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.
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.
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.
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.
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.
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.
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
| Command | Purpose |
|---|---|
| ip dhcp pool VLAN10 | Creates or selects the VLAN10 pool. |
| network 192.168.10.0 255.255.255.0 | Defines the subnet for address assignment. |
| default-router 192.168.10.1 | Provides the default gateway to clients. |
| dns-server 1.1.1.1 | Provides an example DNS server; it does not guarantee Internet access. |
| ip dhcp excluded-address início fim | Excludes addresses from dynamic assignment. |
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.
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.
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# 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# 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.
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.
| Symptom | What to Check |
|---|---|
| Interface administratively down | Select the correct interface and use no shutdown. |
| Interface down/down | Cable, remote port, and show interfaces. |
| VLAN does not appear | show vlan brief; confirm that the VLAN exists and ports are assigned. |
| PC does not receive a DHCP address | Link, VLAN, DHCP pool, exclusions, and active DHCP server. |
| PC has an IP address but cannot ping the gateway | IP address, subnet mask, VLAN, and router interface. |
| Duplicate IP address | Static IPs inside the DHCP range or two active DHCP servers. |
| Configuration is lost after reboot | copy running-config startup-config and save the project. |
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.
description.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.
| Task | Command |
|---|---|
| Privileged mode | enable |
| Global configuration | configure terminal |
| Select interface | interface gigabitEthernet 0/0 |
| Enable interface | no shutdown |
| Configure IPv4 | ip address IP_ADDRESS SUBNET_MASK |
| Create VLAN | vlan 10 |
| Access port | switchport mode access |
| Assign VLAN | switchport access vlan 10 |
| View IP interfaces | show ip interface brief |
| View VLANs | show vlan brief |
| View active configuration | show running-config |
| Save configuration | copy running-config startup-config |
| Create DHCP pool | ip dhcp pool POOL_NAME |
| Set DHCP network | network NETWORK SUBNET_MASK |
| Set DHCP gateway | default-router IP |
| View DHCP leases | show ip dhcp binding |
| Test connectivity | ping IP_ADDRESS |
| Term | Definition |
|---|---|
| CLI | Command-line interface. |
| IOS | Simulated Cisco network operating system. |
| VLAN | Logical Layer 2 segmentation. |
| Access port | A port assigned to a VLAN, typically for an end device. |
| Trunk | A link that carries multiple VLANs using tags. |
| Gateway | A router used to reach other networks. |
| DHCP | Protocol for dynamically assigning IP configuration. |
| Running-config | Active configuration. |
| Startup-config | Configuration saved for startup. |
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.