Open In App

What is Gateway of Last Resort in CCNA?

Last Updated : 15 Nov, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Pre-requisites: Ping, default route.

A gateway of last resort is used to forward packets whose destination address is not listed in the routing table. It is useful in networks where learning where the rest of the networks exist is not necessary. Whenever a packet hits the router’s interface and if the destination layer 3 information is not available in the routing table the packet is forwarded to the gateway of last resort. We can provide a gateway of last resort to a router using the command:

ip route 0.0.0.0 0.0.0.0 <next hop ip address>

Configuring Default Route:

Consider a topology:

Configuring default route

 

Configuring R1’s physical interface:

interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
no sh
interface GigabitEthernet0/0/1
ip address 192.168.2.2 255.255.255.0
no shutdown

Configuring R0’s physical interface:

interface GigabitEthernet0/0/0
ip address 192.168.2.1 255.255.255.0
no shutdown

Configuring R0’s loopback interface:

interface Loopback0
ip address 8.8.8.8 255.255.255.255

In this topology consider that PC0 wants to communicate with 8.8.8.8 and the router 1 does not have an entry for 8.8.8.8 in it’s routing table. When we try to ping 8.8.8.8 from PC1.

 

We get a Destination Host Unreachable error as Router1 doesn’t have an entry for 8.8.8.8 on it’s routing table.

 

To allow the networks to communicate we will provide a gateway of last resort to R1 and add 192.168.2.0/24 network in the R0’s routing table.

Now, we add the gateway of last resort on R1 with the command:-

ip route 0.0.0.0 0.0.0.0 192.168.2.1

and checking R1’s routing table

show ip route

 

And now adding 192.168.2.0/24 network in the R0’s routing table and checking its routing table.

ip route 192.168.1.0 255.255.255.0 192.168.2.2
do show ip route

 

Now we ping 8.8.8.8 using PC0.

 

Simulation:

 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads