Default routing is used to send packets to the next-hop router for an unknown remote destination network that is not in the routing table. Default routing should only be used in stub networks, which are the only way out of the network.
As you can see in the above picture, while R1 and R3 can be used defective routing. Because R2 is not effective to use the default routing.
Router(config) #ip route 0.0.0.0 0.0.0.0 10.0.0.1
The above command means to send all unknown packets to output 10.0.0.1, wherever they come from.
R1(config) #ip route 0.0.0.0 0.0.0.0 10.0.0.1
R1(config) #ip classless
R3(config) #ip route 0.0.0.0 0.0.0.0 18.104.22.168
R3(config) #ip classless
All Cisco routers are classful routers. That is, they expect the router to have the default subnet mask on every interface. If the router receives a packet for a destination subnet that is not in the routing table, this packet will be discarded by default. If you use default routing, the IP classless command should be used, as it will be possible to not have remote subnets in the routing table.
12.4 In the IOS version, IP classless command is active by default. However, for reliability, always run the IP classless command when you use default routing.
Another command you can use to configure a gateway of last resort is the IP default-network command.
The three commands used for ISP to add a gateway of last resort to the gateway router are as follows (they all provide the same solution)
GatewayRouter(config) #ip route 0.0.0.0 0.0.0.0 22.214.171.124
GatewayRouter(config) #ip route 0.0.0.0 0.0.0.0 s0/0
GatewayRouter(config) #ip default-network 126.96.36.199
These three commands are the same, but there are some differences between them. First, the 2nd command, the output interface solution, is considered more than the other two, since it has 0 Advertisement distance. The 3rd command (IP default-network) broadcasts the default network when you configure an IGP (like RIP). Therefore, other routers in your network community will automatically receive this route by default.
I hope it was a useful article.