Cisco Connected and Local Routes Tutorial

Cisco Connected and Local Routes Tutorial

In this Cisco CCNA training tutorial, you’ll learn about connected and local routes, which are the first type of routes that you’re going to have on your router. Scroll down for the video and text tutorial.

Cisco Connected and Local Routes Video Tutorial

YouTube video

Alfred Hacopian

Alfred Hacopian

Your course definitely deserves a 5 star rating . I have taken similar courses in the past and always struggled with subnetting, but after finishing your course I am able to answer all subnetting questions correctly.
Thanks again and please carry on doing an amazing job.

Alfred Hacopian

Router Functions

A router has got two main functions:

  • To determine the best path to available networks
  • To forward actual production traffic to those networks

Cisco Connected and Local Routes Tutorial

The Routing Table

The best available path or paths to a destination network are listed in a router's routing table and will be used for forwarding traffic. A router may learn lots of different routes, but it's only actually the best routes that are going to make it into the routing table and be used.

A routing table is what the router uses to make its forwarding decisions. It consists of :

  • Directly connected networks
  • Routes configured statically by the administrator
  • Routes dynamically learned through a routing protocol

Connected and Local Routes

For our connected and local routes, one of the first things you're going to do on the router is configure IP addresses on its interfaces.

The router in the example below has three interfaces.

  • On the first interface, FastEthernet0/0, we configure IP address 10.0.0.1 and subnet mask 255.255.255.0R1(config)# interface FastEthernet0/0
    R1(config-if)# ip address 10.0.0.1 255.255.255.0

  • On the second interface, the commands would be interface FastEthernet1/0, and then IP address 10.0.1.1, 255.255.255.0 for the subnet mask.

R1(config)# interface FastEthernet1/0
R1(config-if)# ip address 10.0.1.1 255.255.255.0

  • And finally, we've got FastEthernet2/0 with IP address 10.0.2.1 with a subnet mask of 255.255.255.0

R1(config)# interface FastEthernet2/0
R1(config-if)# ip address 10.0.2.1 255.255.255.0

That’s it, you already know how to configure IP addresses on the interfaces of a router.

show ip route – Connected Routes

Now when you do configure IP addresses on the router’s interfaces, it will automatically add routes corresponding to those into the routing table.

First off, it's going to add connected routes into the routing table. Because you configured those IP addresses on those interfaces, the router knows that it is connected to 10.0.0.0/24 network on interface FastEthernet0/0. You can figure out an IP address and that subnet on the interface.

It also knows it is directly connected to the 10.0.1.0/24 network on FastEthernet1/0, and finally, it knows it's connected to the 10.0.2.0/24 network on interface FastEthernet2/0. Those routes will be added to the routing table as connected routes.

The command to view the routing table on a router is show ip route. You can see in the example below that after we configured those IP addresses, those directly connected routes will show up in the routing table.

If any traffic for the 10.0.0.0/24 network is now received on another interface on the router, it will forward it out interface FastEthernet0/0, because it knows that it is directly connected to that network.

If on another interface, a router receives traffic for the 10.0.1.0/24 network, it would send it out interface FastEthernet1/0, and obviously, if the traffic came in for 10.0.2.0/24 network, that would be sent out interface FastEthernet2/0.

So, as soon as you've configured IP addresses on your router interfaces, it can automatically route traffic between those directly connected networks.

show ip route – Local Routes

Another type of route that is going to show up in your routing table after you've configured IP addresses on your interfaces is local routes. Now, these are only going to show up from iOS version 15. Earlier versions did not show these.

Local routes always have a /32 subnet mask, and what they're there for is to show the IP address that is configured on the interface.

If you did a show ip route on the router, you would see the subnets that were available on each interface. However, you wouldn't actually know the IP address that was configured on the router, like interface FastEthernet0/0, from a show ip route command.

It could have IP address 10.0.0.1 on there, or it could have 10.0.0.254, or it could have anything. We don't actually know from the show ip output.

To find out the IP address on the interface, we'd have to do a show ip interface brief or another similar command to find out that information.

show ip route – Complete Output

For iOS 15, it tells you the subnets that are available on each interface. It also tells you the actual IP address that is configured on the interface as well. So, it makes it a bit more convenient for you, the administrator, that you can get all that information with just the one command.

The show ip route will show us the connected routes, and we will see even local routes in the same output from the same show ip route command.

In our example, we'll also see three local routes:

  • 10.0.0.1/32 on FastEthernet0/0
  • 10.0.1.1/32 on FastEthernet1/0
  • 10.0.2.1/32 on FastEthernet2/0

Local routes always show up as a /32 no matter what subnet was actually configured on the interface, and it shows you the IP address that is configured on that interface.

Cisco Connected and Local Routes Tutorial Configuration Example

This configuration example is taken from my free ‘Cisco CCNA Lab Guide’ which includes over 350 pages of lab exercises and full instructions to set up the lab for free on your laptop.

Click here to download your free Cisco CCNA Lab Guide.

YouTube video

  1. Say no when asked if you would like to enter the initial configuration dialog on each router.

Would you like to enter the initial configuration dialog? [yes/no]: no

2. Configure hostnames on the routers according to the Lab Topology diagram.

On R1:

Router(config)# hostname R1

Repeat to configure the correct hostname on the other routers.

3. Configure IP addresses on R1 according to the Lab Topology diagram

R1(config)#int f0/0

R1(config-if)#ip address 10.0.0.1 255.255.255.0

R1(config-if)#no shut

R1(config-if)#int f0/1

R1(config-if)#ip address 10.0.1.1 255.255.255.0

R1(config-if)#no shut

R1(config-if)#int f1/0

R1(config-if)#ip address 10.0.2.1 255.255.255.0

R1(config-if)#no shut

R1(config-if)#int f1/1

R1(config-if)#ip address 10.0.3.1 255.255.255.0

R1(config-if)#no shut

4. Verify routes have been automatically added for the connected and local networks (note that local routes only appear from IOS 15)

Router#show ip route

Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks

C 10.0.1.0/24 is directly connected, FastEthernet0/1

L 10.0.1.1/32 is directly connected, FastEthernet0/1

C 10.0.2.0/24 is directly connected, FastEthernet1/0

L 10.0.2.1/32 is directly connected, FastEthernet1/0

5. Do you see routes for all networks that R1 is directly connected to? Why or why not?

You cannot see routes for the links connected to R2 and R5 (10.0.0.0/24 and 10.0.3.0/24). The interfaces on R2 and R5 are shutdown by default so the links are down. Both sides of the link must be up for it to be live. A router will not insert routes in its routing table which use links which are down.

You can see routes for the links which are connected to the switches SW1 and SW2 (10.0.1.0/24 and 10.0.2.0/24). Switch ports are not shutdown by default so those links are up.

6. Should you be able to ping from PC1 to PC2? Verify this.

(Click on PC1 then ‘Desktop’ and ‘Command Prompt’ to access its command line interface.)

Ping from PC1 to PC2 should be successful as both PCs are in networks which R1 is directly connected to.

C:\>ping 10.0.2.10

Pinging 10.0.2.10 with 32 bytes of data:

Reply from 10.0.2.10: bytes=32 time<1ms TTL=127

Reply from 10.0.2.10: bytes=32 time<1ms TTL=127

Reply from 10.0.2.10: bytes=32 time<1ms TTL=127

Reply from 10.0.2.10: bytes=32 time=1ms TTL=127

Ping statistics for 10.0.2.10:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 1ms, Average = 0ms

7. Verify the traffic path from PC1 to PC2. Use the ‘tracert’ command.

The ping went via R1 at 10.0.1.1

C:\>tracert 10.0.2.10

Tracing route to 10.0.2.10 over a maximum of 30 hops:

1 0 ms 0 ms 0 ms 10.0.1.1

2 0 ms 0 ms 0 ms 10.0.2.10

Trace complete.

8. Should you be able to ping from PC1 to PC3? Verify this.

Ping from PC1 to PC3 should fail as R1 does not have a route to the 10.1.2.0 network.

C:\>ping 10.1.2.10

Pinging 10.1.2.10 with 32 bytes of data:

Reply from 10.0.1.1: Destination host unreachable.

Request timed out.

Reply from 10.0.1.1: Destination host unreachable.

Reply from 10.0.1.1: Destination host unreachable.

Ping statistics for 10.1.2.10:

Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)

Additional Resources

Routing Concepts: https://www.ciscopress.com/articles/article.asp?p=2756479&seqNum=6

Connected, static & dynamic routes: https://study-ccna.com/connected-static-dynamic-routes/

Want to practice Cisco CCNA technologies on your laptop? Download my complete 350-page Cisco CCNA Lab Guide for free.

Click Here to get my Cisco CCNA Gold Bootcamp, the highest rated CCNA course online with a 4.8 star rating from over 20,000 public reviews.

Libby Teofilo

Text by Libby Teofilo, Technical Writer at www.flackbox.com

With a mission to spread network awareness through writing, Libby consistently immerses herself into the unrelenting process of knowledge acquisition and dissemination. If not engrossed in technology, you might see her with a book in one hand and a coffee in the other.