Achievable logoAchievable logo
CCNA
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
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
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

7 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.

(Image 166)

Image Title - Two Routers connected to a WAN and their respective LANs with endpoints

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.5.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

(Image 167)

Image Title - Show ip interface brief command on R1

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.

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

(Image 168)

Image Title - Show ip interface command on R1 showing the IP address and Subnet Mask configured on 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

(Image 169)

Image Title - Routing table on R1 showing directly connected route to 192.168.1.0/24

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)

(Image 170)

Image Title - Two Routers connected to a WAN and their respective LANs

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

(Image 171)

Image Title - Configuring a Static Route to the 192.168.4.0/24 network on R1

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

(Image 172)

Image Title - Viewing the contents of the R1’s Routing Table

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-to-LAN/WAN topology

  • LAN interface IP = endpoints’ default gateway
  • WAN interface connects router-to-router, uses separate IP network from LAN
  • LAN switch aggregates endpoints; WAN link shares network between two routers

Initial router configuration

  • Cancel Setup dialog: Ctrl+C or “no”
  • Mode progression: user EXEC (Router>) → enable → privileged EXEC (Router#) → configure terminal → global config
  • hostname R1 sets device name
  • Interface config mode: interface gigabitethernet0/0 → prompt Router(config-if)#

Configuring interfaces

  • Assign IP: ip address [IP] [subnet mask] (dotted decimal mask mandatory)
  • All router interfaces disabled by default — must run no shutdown to enable
    • shutdown disables an interface
  • Return to privileged EXEC with Ctrl+Z

Verifying interfaces

  • show ip interface brief: lists interfaces, IP addresses, Status, Protocol
    • “unassigned” = no IP configured
    • Status: up / administratively down (shutdown) / down (no physical link)
    • Protocol: up = Layer 2 working; down = no L2 connection
  • show ip interface [interface]: shows subnet mask and detailed IP settings
  • show ip route: confirms directly connected route once interface is up/up
    • Directly connected network routes traffic out that interface

Configuring static routes

  • Used to reach remote networks (often across WAN, but not always)
  • Must be in global configuration mode
  • Syntax: ip route [destination network] [subnet mask] [next-hop IP] [outgoing interface]
    • Must specify next-hop IP and/or outgoing interface (at least one, can include both)
  • Example: ip route 192.168.4.0 255.255.255.0 10.1.1.2
  • Static route only appears in routing table if next-hop is reachable (directly connected or learned via another route)
  • Verify with show ip route

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.

(Image 166)

Image Title - Two Routers connected to a WAN and their respective LANs with endpoints

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.5.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

(Image 167)

Image Title - Show ip interface brief command on R1

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.

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

(Image 168)

Image Title - Show ip interface command on R1 showing the IP address and Subnet Mask configured on 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

(Image 169)

Image Title - Routing table on R1 showing directly connected route to 192.168.1.0/24

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)

(Image 170)

Image Title - Two Routers connected to a WAN and their respective LANs

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

(Image 171)

Image Title - Configuring a Static Route to the 192.168.4.0/24 network on R1

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

(Image 172)

Image Title - Viewing the contents of the R1’s Routing Table

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-to-LAN/WAN topology

  • LAN interface IP = endpoints’ default gateway
  • WAN interface connects router-to-router, uses separate IP network from LAN
  • LAN switch aggregates endpoints; WAN link shares network between two routers

Initial router configuration

  • Cancel Setup dialog: Ctrl+C or “no”
  • Mode progression: user EXEC (Router>) → {`enable`} → privileged EXEC (Router#) → {`configure terminal`} → global config
  • {`hostname R1`} sets device name
  • Interface config mode: {`interface gigabitethernet0/0`} → prompt Router(config-if)#

Configuring interfaces

  • Assign IP: ip address [IP] [subnet mask] (dotted decimal mask mandatory)
  • All router interfaces disabled by default — must run {`no shutdown`} to enable
    • {`shutdown`} disables an interface
  • Return to privileged EXEC with Ctrl+Z

Verifying interfaces

  • {`show ip interface brief`}: lists interfaces, IP addresses, Status, Protocol
    • “unassigned” = no IP configured
    • Status: up / administratively down (shutdown) / down (no physical link)
    • Protocol: up = Layer 2 working; down = no L2 connection
  • {`show ip interface [interface]`}: shows subnet mask and detailed IP settings
  • {`show ip route`}: confirms directly connected route once interface is up/up
    • Directly connected network routes traffic out that interface

Configuring static routes

  • Used to reach remote networks (often across WAN, but not always)
  • Must be in global configuration mode
  • Syntax: ip route [destination network] [subnet mask] [next-hop IP] [outgoing interface]
    • Must specify next-hop IP and/or outgoing interface (at least one, can include both)
  • Example: {`ip route 192.168.4.0 255.255.255.0 10.1.1.2`}
  • Static route only appears in routing table if next-hop is reachable (directly connected or learned via another route)
  • Verify with {`show ip route`}

More from Configuring Cisco Routers

  • How to configure OSPFv2 on Cisco routers