Every command earns its place here by being used in a lab — typed by hand, never pasted. Each one lists what it does and the moment I reach for it. This page grows with every lab.
| Command | What it does | When I reach for it |
|---|---|---|
ping <ip> | Tests reachability to another host | First command in almost every problem |
ipconfig /all | Shows the PC's IP, mask, gateway, DNS, MAC | "Can't connect" — check what the machine actually has |
tracert <ip> | Shows every router hop toward a destination | Ping fails — find where the path dies |
nslookup <name> | Tests DNS name resolution | Sites won't load by name but ping-by-IP works |
arp -a | Shows learned IP→MAC mappings | Checking if the PC ever heard from the gateway |
| Command | What it does | When I reach for it |
|---|---|---|
show mac address-table | Shows which MAC the switch learned on which port | Finding where a device physically lives |
show interfaces status | Port up/down, speed, duplex, VLAN per port | First check for any "no link" problem |
vlan 10 + name HR | Creates a VLAN and names it | Segmenting departments |
switchport mode access | Makes a port carry exactly one VLAN | Every end-device port |
switchport access vlan 10 | Assigns the port's VLAN | Putting a PC in the right department |
show vlan brief | All VLANs and their assigned ports | "PC can't reach its own department" — check assignment |
switchport mode trunk | Makes a link carry all VLANs with 802.1Q tags | Every switch-to-switch (and router-on-a-stick) link |
show interfaces trunk | Which links are trunking and which VLANs they allow | "Works on same switch, fails across switches" → here first |
| Command | What it does | When I reach for it |
|---|---|---|
enable / configure terminal | Enter privileged then global config mode | The doorway to everything |
hostname SW1 | Names the device | First line of every device setup |
show running-config | The live configuration | Reading what's actually configured, not assumed |
copy running-config startup-config | Saves config so it survives reload | After every change — learned this the hard way |
show ip interface brief | Every interface, its IP and up/down state | The fastest overview command on any device |
show version | IOS version, uptime, hardware | Inventory and "did it just reboot?" |
| Command | What it does | When I reach for it |
|---|---|---|
interface gi0/0.10 + encapsulation dot1Q 10 | Subinterface tagged for VLAN 10 (router-on-a-stick) | Inter-VLAN routing on one physical port |
ip route <net> <mask> <next-hop> | Static route | Manually teaching a router a path |
ip route 0.0.0.0 0.0.0.0 <next-hop> | Default route (gateway of last resort) | Sending unknown traffic toward the edge/ISP |
show ip route | The routing table — C/S/S*/O codes | The single most important command in routing |
ip dhcp pool HR + network / default-router / dns-server | DHCP scope on a router | Automatic addressing per VLAN |
show ip dhcp binding | Which client got which address | "Did the client actually get a lease?" |
router ospf 1 + network <net> <wildcard> area 0 | Enables OSPF on matching interfaces | Dynamic routing setup |
show ip ospf neighbor | Adjacency states with other routers | OSPF problem? This is always command #1 |