This browser is too old to run Achievable.

Update it, or open this page in a current version of Chrome, Safari, Firefox or Edge. On an iPhone or iPad, update iOS: every browser there runs on the version of Safari that comes with it.

Achievable logoAchievable logo
CCNA
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Resources
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. Introduction to networking
2. Administering Ethernet LANs
3. IP connectivity
3.1 Understanding IP addresses
3.2 Calculating networks and hosts (Subnetting)
3.3 Routers and IPv4 routing fundamentals
3.4 Static routing
3.5 Static vs. dynamic routing and OSPF fundamentals
3.6 Router redundancy in an Ethernet LAN using First Hop Redundancy Protocols (FHRPs)
3.7 Configuring Cisco Routers
3.7.1 Initial router configuration and static routes
3.7.2 How to configure OSPFv2 on Cisco routers
4. Network services
5. IPv6
6. Wireless networking
7. Network management and administering network devices
8. Network security fundamentals
9. Network automation and programmability
Wrapping up
Achievable logoAchievable logo
3.7.1 Initial router configuration and static routes
Achievable CCNA
3. IP connectivity
3.7. Configuring Cisco Routers
Our CCNA course is currently in development and is a work-in-progress.

Initial router configuration and static routes

12 min read
Font
Discuss
Share
Feedback

In this chapter, you’ll learn how to configure Cisco routers.

Typically, the LAN-facing interface on a router connects to an Ethernet switch. That switch connects all of the endpoints (PCs, servers, printers, IP phones, and so on). The router’s LAN interface is configured with an IP address in the LAN’s network, and the endpoints in that LAN use that IP address as their default gateway.

For the WAN-facing interface, the router typically connects to another router. This interface must be configured with an IP address on a network that both routers share so they can exchange packets. That shared link uses a separate IP network from the LAN.

R1 and R2 connect via Gi0/1 interfaces over WAN link 10.1.1.0/30, with R1 at 10.1.1.1 and R2 at 10.1.1.2. R1's Gi0/0 (.1) serves LAN 192.168.1.0/24, while R2's Gi0/0 (.1) serves LAN 192.168.4.0/24.
Two routers connecting separate LANs across a WAN
Achievable
 

Let’s walk through the configurations needed to get the routers operational. We’ll use the same configurations and protocols you learned throughout the IP connectivity section.

Initial router configuration

The initial configuration on a router is very similar to the initial configuration on an Ethernet switch (as covered in Chapter 2.6.1 Introduction to Cisco’s Internetworking Operating System (IOS)), because both devices run Cisco IOS.

When the router boots for the first time, it displays the Configuration Dialog prompt. You should cancel it by either typing the key combination “Ctrl+C” or typing “no” and pressing Enter.

After that, you’ll see the user EXEC prompt, which allows a limited set of show commands:

Router>

We need to enter privileged EXEC mode. Which command gets us there?

(spoiler)

enable

Once you’re in privileged EXEC mode, you’ll see the prompt:

Router#

You can run more show commands here, but to change settings (like the hostname) you need global configuration mode. How do you enter global configuration mode?

(spoiler)

configure terminal

Now that you’re in global configuration mode, which command changes the hostname to “R1”?

(spoiler)

hostname R1

Next, we’ll configure the LAN-facing interface. Router interfaces (unlike switchports) are assigned an IP address in the same LAN as the endpoints, and that IP address becomes the hosts’ default gateway.

In this topology, the LAN-facing interface on R1 is GigabitEthernet0/0. We need to assign it an IP address in the 192.168.1.0/24 network. A common convention is to reserve the first usable IP address for the default gateway, so we’ll use 192.168.1.1.

To configure an interface, you first enter interface configuration mode:

interface gigabitethernet0/0

The prompt changes to:

Router(config-if)#

That tells you you’re configuring the GigabitEthernet0/0 interface. Now assign the IP address:

ip address 192.168.1.1 255.255.255.0

Notice that you must include the Subnet Mask in Dotted Decimal Notation after the IP address. This is mandatory.

While you’re still in interface configuration mode, there’s one more router-specific step:

All router interfaces are shutdown by default.

So, when you configure an interface in its default state, you must enable it with:

no shutdown

Similarly, if you want to disable a router interface, enter:

shutdown

within interface configuration mode for that interface.

Now that the LAN-facing interface is configured, verify it by returning to privileged EXEC mode (Ctrl+Z) and running:

show ip interface brief

R1 show ip interface brief output: GigabitEthernet0/0 has IP 192.168.1.1, status up, protocol up; GigabitEthernet0/1, 0/2, and 0/3 are unassigned, administratively down, protocol down.
show ip interface brief output on R1
Achievable
 

This command lists all router interfaces and the IP address assigned to each one.

  • If an interface has no IP address configured, it shows as “unassigned”.

  • The “Status” column tells you the administrative and physical state:

    • “up” means the interface is enabled (you entered “no shutdown”).
    • “administratively down” means the interface is disabled (default state or you entered “shutdown”).
    • “down” usually means there’s no physical link (for example, no cable connected).
  • The “Protocol” column shows whether the data-link layer is working:

    • “up” means the remote end is connected and the remote interface is also up, so the local router can receive Layer 2 frames.
    • “down” means the Layer 2 connection isn’t established (not receiving keepalive frames).

A Status/Protocol combination of “up/down” typically indicates that the cable is plugged in and the interface is enabled on the local router, but the cable is either not plugged in on the remote router or it’s interface is not enabled.

To see the subnet mask configured on an interface, use show ip interface [interface name]. This also shows the interface status and other IP-related settings:

show ip interface gigabitethernet0/0

Output of show ip interface gigabitethernet0/0 on R1, confirming the interface is up with line protocol up, Internet address 192.168.1.1/24, and broadcast address 255.255.255.255, along with various default interface settings.
show ip interface output for GigabitEthernet0/0 on R1
Achievable
 

Once the interface is configured and shows “up/up”, the router should install a directly connected route for that network in its routing table. Verify with:

show ip route

R1 show ip route output with gateway of last resort not set; 192.168.1.0/24 is variably subnetted into 2 subnets, showing C 192.168.1.0/24 directly connected and L 192.168.1.1/32 directly connected, both via GigabitEthernet0/0.
R1 routing table showing directly connected network 192.168.1.0/24
Achievable
 

This means R1 is directly connected to the 192.168.1.0/24 network. If R1 receives a packet destined for an IP address in that network, it forwards the packet out of its GigabitEthernet0/0 interface.

Configuring static routes

Routes to remote networks often travel over a WAN (though not always). One of the simplest ways to reach a remote network you’re not directly connected to is to configure a static route.

To configure a static route, you must be in global configuration mode. The command has this structure:

Command Destination Network Subnet Mask Next Hop IP Address Outgoing Interface (Optional)

R1 and R2 connect via Gi0/1 interfaces over WAN link 10.1.1.0/30, with R1 at 10.1.1.1 and R2 at 10.1.1.2. R1's Gi0/0 (.1) serves LAN 192.168.1.0/24, while R2's Gi0/0 (.1) serves LAN 192.168.4.0/24.
Two routers connecting separate LANs across a WAN
Achievable
 

For example, suppose you want to configure a static route on R1 to reach the 192.168.4.0/24 network. If the next hop is 10.1.1.2 (the IP address of the GigabitEthernet0/1 interface on R2), the configuration looks like this:

Command Destination Network Subnet Mask Next Hop IP Address Outgoing Interface (Optional)
ip route 192.168.4.0 255.255.255.0 10.1.1.2 GigabitEthernet0/1

You can optionally include the exit (outgoing) interface the router will use to send packets toward the destination (GigabitEthernet0/1 in this example). It’s not required. In our example, we’ll omit the outgoing interface:

ip route 192.168.4.0 255.255.255.0 10.1.1.2

Router CLI on R1 in global config mode, entering the command: ip route 192.168.4.0 255.255.255.0 10.1.1.2, which creates a static route to network 192.168.4.0/24 via next-hop 10.1.1.2.
Configuring a static route to 192.168.4.0/24 on R1
Achievable
 

After you configure the route, you can view it in R1’s routing table with ‘show ip route’:

R1 show ip route output: connected and local routes for 10.1.1.0/30 and 192.168.1.0/24 on GigabitEthernet0/1 and 0/0, plus a static route S 192.168.4.0/24 [1/0] via 10.1.1.2; gateway of last resort is not set.
Viewing R1's routing table
Achievable
Sidenote
Next Hop IP Address and/or Exit Interface

You can also configure a static route using the outgoing interface instead of the next hop IP address. For example, this is also valid:

ip route 192.168.4.0 255.255.255.0 gigabitethernet0/1

You must specify at least one of the following:

  • the next hop IP address
  • the outgoing interface used to reach the next hop router.

You can also specify both.

It is important to note that the next-hop to the static route must be reachable in order for the static route to show up in your routing table. The next hop for the static route could either be a Directly Connected route, or learned from another route, but you must have a route to the next-hop within your routing table.

Router topology basics

  • LAN-facing interface gets IP in LAN’s subnet; endpoints use it as default gateway
  • WAN-facing interface connects router-to-router; needs shared IP network distinct from LAN subnets
  • Routers and switches both run Cisco IOS, so initial setup commands are similar

Initial router configuration (CLI mode progression)

  • Boot prompt: cancel Configuration Dialog with Ctrl+C or typing “no”
  • Mode flow: User EXEC (Router>) → enable → Privileged EXEC (Router#) → configure terminal → Global Config
  • Set hostname: hostname R1
  • Enter interface mode: interface gigabitethernet0/0
  • Assign IP: ip address [ip] [subnet mask] — dotted decimal mask is mandatory
  • All router interfaces are shutdown by default — must run no shutdown to enable (or shutdown to disable)

Verifying interface status

  • show ip interface brief — quick view of IP addresses and interface states
    • “unassigned” = no IP configured
    • Status column: up / administratively down (default or shutdown) / down (no physical link)
    • Protocol column: up (Layer 2 working, receiving keepalives) / down (no L2 connection)
    • up/down combo = local interface enabled and cable connected, but remote side not connected/enabled
  • show ip interface [name] — shows IP address with subnet mask plus detailed interface settings
  • show ip route — confirms directly connected routes once interface is up/up

Configuring static routes

  • Syntax: ip route [destination network] [subnet mask] [next-hop IP and/or exit interface]
  • Must specify at least one of: next-hop IP address or outgoing interface (can include both)
  • Example: ip route 192.168.4.0 255.255.255.0 10.1.1.2
  • Critical requirement: next-hop must be reachable (via directly connected or learned route) for the static route to appear in the routing table
  • Verify with show ip route — static routes show with “S” code

Sign up for free to take 10 quiz questions on this topic

Previous
Next  | 3.7.2 How to configure OSPFv2 on Cisco routers
All rights reserved ©2016 - 2026 Achievable, Inc.

Initial router configuration and static routes

In this chapter, you’ll learn how to configure Cisco routers.

Typically, the LAN-facing interface on a router connects to an Ethernet switch. That switch connects all of the endpoints (PCs, servers, printers, IP phones, and so on). The router’s LAN interface is configured with an IP address in the LAN’s network, and the endpoints in that LAN use that IP address as their default gateway.

For the WAN-facing interface, the router typically connects to another router. This interface must be configured with an IP address on a network that both routers share so they can exchange packets. That shared link uses a separate IP network from the LAN.

 

Let’s walk through the configurations needed to get the routers operational. We’ll use the same configurations and protocols you learned throughout the IP connectivity section.

Initial router configuration

The initial configuration on a router is very similar to the initial configuration on an Ethernet switch (as covered in Chapter 2.6.1 Introduction to Cisco’s Internetworking Operating System (IOS)), because both devices run Cisco IOS.

When the router boots for the first time, it displays the Configuration Dialog prompt. You should cancel it by either typing the key combination “Ctrl+C” or typing “no” and pressing Enter.

After that, you’ll see the user EXEC prompt, which allows a limited set of show commands:

Router>

We need to enter privileged EXEC mode. Which command gets us there?

(spoiler)

enable

Once you’re in privileged EXEC mode, you’ll see the prompt:

Router#

You can run more show commands here, but to change settings (like the hostname) you need global configuration mode. How do you enter global configuration mode?

(spoiler)

configure terminal

Now that you’re in global configuration mode, which command changes the hostname to “R1”?

(spoiler)

hostname R1

Next, we’ll configure the LAN-facing interface. Router interfaces (unlike switchports) are assigned an IP address in the same LAN as the endpoints, and that IP address becomes the hosts’ default gateway.

In this topology, the LAN-facing interface on R1 is GigabitEthernet0/0. We need to assign it an IP address in the 192.168.1.0/24 network. A common convention is to reserve the first usable IP address for the default gateway, so we’ll use 192.168.1.1.

To configure an interface, you first enter interface configuration mode:

interface gigabitethernet0/0

The prompt changes to:

Router(config-if)#

That tells you you’re configuring the GigabitEthernet0/0 interface. Now assign the IP address:

ip address 192.168.1.1 255.255.255.0

Notice that you must include the Subnet Mask in Dotted Decimal Notation after the IP address. This is mandatory.

While you’re still in interface configuration mode, there’s one more router-specific step:

All router interfaces are shutdown by default.

So, when you configure an interface in its default state, you must enable it with:

no shutdown

Similarly, if you want to disable a router interface, enter:

shutdown

within interface configuration mode for that interface.

Now that the LAN-facing interface is configured, verify it by returning to privileged EXEC mode (Ctrl+Z) and running:

show ip interface brief

 

This command lists all router interfaces and the IP address assigned to each one.

  • If an interface has no IP address configured, it shows as “unassigned”.

  • The “Status” column tells you the administrative and physical state:

    • “up” means the interface is enabled (you entered “no shutdown”).
    • “administratively down” means the interface is disabled (default state or you entered “shutdown”).
    • “down” usually means there’s no physical link (for example, no cable connected).
  • The “Protocol” column shows whether the data-link layer is working:

    • “up” means the remote end is connected and the remote interface is also up, so the local router can receive Layer 2 frames.
    • “down” means the Layer 2 connection isn’t established (not receiving keepalive frames).

A Status/Protocol combination of “up/down” typically indicates that the cable is plugged in and the interface is enabled on the local router, but the cable is either not plugged in on the remote router or it’s interface is not enabled.

To see the subnet mask configured on an interface, use show ip interface [interface name]. This also shows the interface status and other IP-related settings:

show ip interface gigabitethernet0/0

 

Once the interface is configured and shows “up/up”, the router should install a directly connected route for that network in its routing table. Verify with:

show ip route

 

This means R1 is directly connected to the 192.168.1.0/24 network. If R1 receives a packet destined for an IP address in that network, it forwards the packet out of its GigabitEthernet0/0 interface.

Configuring static routes

Routes to remote networks often travel over a WAN (though not always). One of the simplest ways to reach a remote network you’re not directly connected to is to configure a static route.

To configure a static route, you must be in global configuration mode. The command has this structure:

Command Destination Network Subnet Mask Next Hop IP Address Outgoing Interface (Optional)

 

For example, suppose you want to configure a static route on R1 to reach the 192.168.4.0/24 network. If the next hop is 10.1.1.2 (the IP address of the GigabitEthernet0/1 interface on R2), the configuration looks like this:

Command Destination Network Subnet Mask Next Hop IP Address Outgoing Interface (Optional)
ip route 192.168.4.0 255.255.255.0 10.1.1.2 GigabitEthernet0/1

You can optionally include the exit (outgoing) interface the router will use to send packets toward the destination (GigabitEthernet0/1 in this example). It’s not required. In our example, we’ll omit the outgoing interface:

ip route 192.168.4.0 255.255.255.0 10.1.1.2

 

After you configure the route, you can view it in R1’s routing table with ‘show ip route’:

Sidenote
Next Hop IP Address and/or Exit Interface

You can also configure a static route using the outgoing interface instead of the next hop IP address. For example, this is also valid:

ip route 192.168.4.0 255.255.255.0 gigabitethernet0/1

You must specify at least one of the following:

  • the next hop IP address
  • the outgoing interface used to reach the next hop router.

You can also specify both.

It is important to note that the next-hop to the static route must be reachable in order for the static route to show up in your routing table. The next hop for the static route could either be a Directly Connected route, or learned from another route, but you must have a route to the next-hop within your routing table.

Key points

Router topology basics

  • LAN-facing interface gets IP in LAN’s subnet; endpoints use it as default gateway
  • WAN-facing interface connects router-to-router; needs shared IP network distinct from LAN subnets
  • Routers and switches both run Cisco IOS, so initial setup commands are similar

Initial router configuration (CLI mode progression)

  • Boot prompt: cancel Configuration Dialog with Ctrl+C or typing “no”
  • Mode flow: User EXEC (Router>) → enable → Privileged EXEC (Router#) → configure terminal → Global Config
  • Set hostname: hostname R1
  • Enter interface mode: interface gigabitethernet0/0
  • Assign IP: ip address [ip] [subnet mask] — dotted decimal mask is mandatory
  • All router interfaces are shutdown by default — must run no shutdown to enable (or shutdown to disable)

Verifying interface status

  • show ip interface brief — quick view of IP addresses and interface states
    • “unassigned” = no IP configured
    • Status column: up / administratively down (default or shutdown) / down (no physical link)
    • Protocol column: up (Layer 2 working, receiving keepalives) / down (no L2 connection)
    • up/down combo = local interface enabled and cable connected, but remote side not connected/enabled
  • show ip interface [name] — shows IP address with subnet mask plus detailed interface settings
  • show ip route — confirms directly connected routes once interface is up/up

Configuring static routes

  • Syntax: ip route [destination network] [subnet mask] [next-hop IP and/or exit interface]
  • Must specify at least one of: next-hop IP address or outgoing interface (can include both)
  • Example: ip route 192.168.4.0 255.255.255.0 10.1.1.2
  • Critical requirement: next-hop must be reachable (via directly connected or learned route) for the static route to appear in the routing table
  • Verify with show ip route — static routes show with “S” code

More from Configuring Cisco Routers

  • How to configure OSPFv2 on Cisco routers