Basic Router Configuration
Initial Router Configuration
A Cisco router, fresh out of the box or reset to factory defaults, has no configuration at all. Bringing it into a working network follows the same basic sequence every time — set a hostname, secure access, configure interfaces, and save the configuration.
- Hostname: uniquely identifies the device on the network and in your documentation. Always set this first.
- Secure access: set passwords for privileged EXEC mode, console line, and VTY (remote/Telnet/SSH) lines.
- Banner: a legal warning message displayed before login (Message of the Day).
- Interfaces: assign IP addresses and enable each interface that will carry traffic.
- Save: copy the running configuration to NVRAM so it survives a reboot.
! Enter global configuration mode Router> enable Router# configure terminal ! Set the hostname Router(config)# hostname R1 ! Secure privileged EXEC mode R1(config)# enable secret Cisco12345 ! Secure the console line R1(config)# line console 0 R1(config-line)# password ConsolePass1 R1(config-line)# login R1(config-line)# exit ! Secure VTY lines (remote access — Telnet/SSH) R1(config)# line vty 0 4 R1(config-line)# password VtyPass1 R1(config-line)# login R1(config-line)# exit ! Encrypt all plaintext passwords in the running config R1(config)# service password-encryption ! Add a Message of the Day banner R1(config)# banner motd #Authorized access only# ! Save the configuration to NVRAM R1(config)# end R1# copy running-config startup-config
enable secret stores an MD5-hashed password and always takes priority if both are configured. enable password stores plaintext (unless service password-encryption is applied, which only weakly obfuscates it). Always use enable secret — never rely on enable password alone in a production network.Configure Router Interfaces
A router does nothing useful until its interfaces are configured and enabled. Each routed interface needs an IP address and subnet mask, and must be turned on with no shutdown — interfaces are administratively down by default.
Always add a short description to each interface. This is not just good practice — on a real network with dozens of interfaces, descriptions are often the only thing standing between fast troubleshooting and hours of guesswork.
! Configure GigabitEthernet0/0 — LAN-facing interface R1(config)# interface GigabitEthernet0/0 R1(config-if)# description LAN - Connects to SW1 R1(config-if)# ip address 192.168.1.1 255.255.255.0 R1(config-if)# ipv6 address 2001:db8:1::1/64 R1(config-if)# no shutdown R1(config-if)# exit ! Configure Serial0/0/0 — WAN-facing interface R1(config)# interface Serial0/0/0 R1(config-if)# description WAN link to ISP R1(config-if)# ip address 203.0.113.1 255.255.255.252 R1(config-if)# no shutdown R1(config-if)# exit
show ip interface brief should be the very first command you run.Verify Interface Configuration
After configuring interfaces, verification confirms everything is working as intended before moving on. Several show commands give different levels of detail — knowing which one to reach for saves time.
R1# show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 192.168.1.1 YES manual up up Serial0/0/0 203.0.113.1 YES manual up up GigabitEthernet0/1 unassigned YES unset administratively down down ! "up / up" = working correctly ! "administratively down / down" = interface is shut down (no shutdown not applied) ! "down / down" = Layer 1 problem (cable, port, no signal) ! "up / down" = Layer 2 problem (encapsulation mismatch, keepalives)
Configure the Default Gateway
A default gateway is the address a host or switch sends traffic to when the destination is on a different network. Without one, devices can only communicate within their own local subnet.
On an end device (PC, laptop, phone), the default gateway is normally the LAN-facing IP address of the local router — set manually or via DHCP. On a Layer 2 switch, the default gateway matters for management traffic only (Telnet/SSH/SNMP to the switch itself) — switches don't route user traffic, so this setting doesn't affect how frames are forwarded between hosts.
! Configure default gateway on a Layer 2 switch (management only) SW1(config)# ip default-gateway 192.168.1.1 ! Configure SVI (Switch Virtual Interface) for management access SW1(config)# interface vlan 1 SW1(config-if)# ip address 192.168.1.10 255.255.255.0 SW1(config-if)# no shutdown ! On a Windows host — set default gateway manually C:\> netsh interface ip set address "Ethernet" static 192.168.1.50 255.255.255.0 192.168.1.1 ! Verify on Windows C:\> ipconfig Default Gateway . . . . . . . . . : 192.168.1.1
Connect a Router to a LAN
Putting it all together: a small topology with one router connecting a LAN switch to a WAN link demonstrates the full configuration workflow in one place.
Default Gateway: 192.168.1.1
(no IP routing, just forwards frames)
R1 S0/0/0: 203.0.113.1/30 (WAN)
Step-by-step checklist for connecting a router to an existing LAN:
- 1. Cable the router's LAN interface to the switch using a straight-through Ethernet cable.
- 2. Configure the router's LAN interface with an IP address from the LAN subnet (e.g.
192.168.1.1/24) andno shutdown. - 3. Configure each host on the LAN with an IP in the same subnet, and set its default gateway to the router's LAN interface address.
- 4. Verify Layer 1/2 with
show ip interface brief— confirm up/up. - 5. Verify end-to-end with
pingfrom the host to the router, then from the host to a remote destination. - 6. Save the configuration with
copy running-config startup-config.
show ip interface brief on R1 and see:GigabitEthernet0/0 192.168.1.1 YES manual up upSerial0/0/0 203.0.113.1 YES manual administratively down downTask: Identify the problem and write the command(s) needed to fix it.
💡 Show hints & answer
- "administratively down" always means the interface was never enabled, or was manually shut down
- The fix: enter interface configuration mode for Serial0/0/0 and apply
no shutdown - Re-verify with
show ip interface brief— Status should change to "up" - If Protocol still shows down after that, check cabling and encapsulation settings on both ends of the WAN link