Default Routing in router

In this article I describe the term default routing in router related to networking. default routing in router is a process of packet transfer between different networks via a router. Default routing in router is a type of IP routing in router. When we access the internet or intranet the data packets transmitted and received by IP routing in router.

Every interface of router has a different network. Routers are also known as layer3 device. Various routing and routed protocols used for moving packets between different networks. Generally the IP routing in router is done by static routing, default routing and dynamic routing protocols. Before understanding the static route in a router it will be good to understands about IP routing in router.

Requirement of IP routing in router

The function of a router is to move the data packets from one interface to another interface or we can say between different networks. The movement of packets done at layer 3 which is known as network layer of the OSI reference model. Router keep the information of neighbour router and network in its routing table.

There may be many interfaces in a router which connect different networks. How the router moves the packet to its destination it depends on routing and routed protocol. Static route in a router is a set of protocols which allow the router to transfer the packet to its destination. To understand the IP routing in router it is necessary to know about the routing and routed protocol firstly.

Routing protocol for IP routing in router

Routing protocols helps router to build and maintain the routing table in routers. Routing protocols are one important part of default routing in router. Routing protocols inform the router about the networks connected at each interface. Routing protocols doesn’t carry or push the data packets in any way. Any change in the network required to be update in the routing tables of all routers. This task is carried out by the routing protocols. Routing protocols help the routers to select the best path to exit the data packets.

Example of routing protocols are RIP, RIPv2, IGRP,OSPF etc. Routing protocols further divided into distance vector, link state and hybrid protocols. These all routing protocols update the routing table of all routers in the network. You can see the routing protocols by “show ip route” command in privilege command mode of router. Routing protocols are not responsible for data packet flow in any way. Routing protocols spread the information of network hierarchy to all routers.

Routed protocol for IP routing in router

Routed protocol works with the data packets for default routing in router. Routed protocol sends the data packets within a router’s interfaces. Routing protocol decide the best path and routed protocol send the packets on these paths. Routed protocols are defined on interfaces of router. Routed protocols do not update or maintain the routing table in a router. Routed protocols are responsible for flow of data packets from one network to another network.

Routed protocols sends the data packets to correct exit interface of the router. Routed protocols are configured on interfaces of the router. Example of routed protocols are IP, IPv6, IPX and Appletalk. Routed protocols are basically addressing schema of the interfaces of router. Router identify the destination network of a data packet and send the data packet to correct exit interface. The concept of subnetting takes place in routed protocols.   

You may also like to read --  IP Routing in Router

Fundamentals of IP routing in router

We know that routers used to connect the different LAN and WAN. We required to connect the different network with a router physically firstly. After completion of physical connectivity next step is to configure the logical network addresses and routing protocols. Each LAN or WAN works in a fix network ID. In case of router I mention the network ID for each LAN. When we work in a LAN, I mention the IP address for each host. Each host assigned a gateway which is the interface of the router to out the packet from that LAN. Router do not forward the packet to host. Router transfer the packet for network ID.

The flow of packets between different LAN depends on destination address on the packet. All routers maintain the routing table to determine the best route to remote network. Routing protocol keep update the routing table in IOS of router. The routing table help to find the destination network of a packet. Basically multiple protocols works for IP routing in router to transfer the data between different networks.

Commands to check the routing table

We can see the routing table in privilege command mode of router. “show ip route” command can be use to check the routing table in a router. see the below command which show the routing table of the router.

Router>en
Router#show ip rou
Router#show ip route
Codes: C - connected, S - static, I - IGRP, 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
 
C 2.0.0.0/8 is directly connected, Loopback0
C 10.0.0.0/8 is directly connected, Serial0/0/0
C 11.0.0.0/8 is directly connected, Serial0/0/1
192.165.23.0/32 is subnetted, 1 subnets
O 192.165.23.1 [110/65] via 10.0.0.1, 00:00:02, Serial0/0/0
192.168.25.0/32 is subnetted, 1 subnets
O 192.168.25.1 [110/65] via 10.0.0.1, 00:00:02, Serial0/0/0
192.168.30.0/32 is subnetted, 1 subnets
O 192.168.30.1 [110/65] via 10.0.0.1, 00:00:02, Serial0/0/0
 
Router#

Default Routing in router explained with example

Default routing in router is configured manually like static routing. Default routing allow all packets to forward on fix next hope. Generally in the last router default routing configured because there is only a single interface. Default routing protocol allow all packets to forward on a fix interface. Default routing in router is mostly configured when the router have only one exit interface. In other words we can use the default routing in router when the traffic need to be routed on fix next hope. Default routing used when no other router available for a packet to exit out.

Function of default routing in router

After receiving a packet router first check the destination IP address of packet. Router see the routing table for the entry of destination network of packet. If the destination network entry available in routing table the packet forwarded to next hop. If the routing table doesn’t have any entry for destination network, the packet dropped. Suppose we have a router with only one exit interface available. We want to forward all packets to send to next hope without checking the destination IP address. Default routing supports this condition to forward all packets to next hope. In default routing router forward all data packets to next hop.

You may also like to read --  The Role and function of Router in internetworking

Configuration of default routing in router

Default routing in a router describe the fix exit interface for all packets. We created a small network with two routers as shown in picture. There are three different networks with network ID 10.0.0.0/8, 192.168.1.1/24 and 10.10.10.0/24. We configure the default routes in both routers so network 10.0.0.0/8 and 10.10.10.0/24 can communicate with each other.

default routing in router, ccna, ccna tutorials

Configure the PC1 IP address 10.0.0.5/8 and gateway 10.0.0.1 similarly the PC2 IP address 10.10.10.5/24 and gateway 10.10.10.1.

Configuring the IP address of Router 1 interfaces

We need to enter in Global configuration mode to set the IP address of interfaces in any router. The interface Gigabitethernet0/0/0 relates to PC1 and require the IP address 10.0.0.1/8. The interface Gigabitethernet0/0/1 relates to Router 2 and require the IP address 192.168.1.1/28. Following commands are used for setup the IP address on both interfaces.

 Router1>enable
 Router1#
 Router1#configure terminal
 Enter configuration commands, one per line. End with CNTL/Z.
 Router1(config)#interface GigabitEthernet0/0/0
 Router1(config-if)#ip address 10.0.0.1 255.0.0.0
 Router1(config-if)#no shutdown
 Router1(config-if)#
   
 %LINK-5-CHANGED: Interface GigabitEthernet0/0/0, changed state to up
   
 %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to up
   
 Router1(config-if)#exit
 Router1(config)#interface GigabitEthernet0/0/1
 Router1(config-if)#ip address 192.168.1.1 255.255.255.240
 Router1(config-if)#no shutdown
 Router1(config-if)#
   
 %LINK-5-CHANGED: Interface GigabitEthernet0/0/1, changed state to up
   
 %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/1, changed state to up  

Configuring the IP address of Router 2 interfaces

We need to enter in Global configuration mode to set the IP address of interfaces in any router. The interface Gigabitethernet0/0/0 relates to Router1 and require the IP address 192.168.1.2/28. The interface Gigabitethernet0/0/1 relates to PC2 and require the IP address 10.10.10.1/24. Following commands are used for setup the IP address on both interfaces.

 Router2>enable
 Router2#
 Router2#configure terminal
 Enter configuration commands, one per line. End with CNTL/Z.
 Router2(config)#interface GigabitEthernet0/0/0
 Router2(config-if)#ip address 192.168.1.2 255.255.255.240
 Router2(config-if)#no shutdown
 Router2(config-if)#
   
 %LINK-5-CHANGED: Interface GigabitEthernet0/0/0, changed state to up
   
 %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/0, changed state to up
   
 Router2(config-if)#exit
 Router2(config)#interface GigabitEthernet0/0/1
 Router2(config-if)#ip address 10.10.10.1 255.255.255.0
 Router2(config-if)#no shutdown
 Router2(config-if)#
   
 %LINK-5-CHANGED: Interface GigabitEthernet0/0/1, changed state to up
   
 %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0/1, changed state to up  

After configuring both router’s interface try to ping the PC1 with PC2. You can see that PC1 is not pinging PC2. See the result below

 C:\>ping 10.10.10.5
   
 Pinging 10.10.10.5 with 32 bytes of data:
   
 Request timed out.
 Request timed out.
 Request timed out.
 Request timed out.
   
 Ping statistics for 10.10.10.5:
      Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),  

Routing in both routers required to communicate PC1 with PC2. Now we configure the default route in both routers 1 and 2. A router itself identify the next hope IP address. For example, here router 2 connected with Gigabitethernet0/0/1 interface of router1. Router1 identify the IP address of router2 interface which is connected with it. Similarly, router 2 identify the ip address of router1 interface. The formula for default routing is following

default routing in router, ccna, ccna tutorials

Router(config)#ip route 0.0.0.0 0.0.0.0 [next hope]

Configuration of default route in router 1

Router 1 identify the two networks connected with it are 10.0.0.0/8 and 192.168.1.0/28. Router 1 do not know about the network 10.10.10.0/24. By configuring default route in router1, we set the path of all packets to forward on next hope 192.168.1.2 or router 2

 Router1>enable
 Router1#
 Router1#configure terminal
 Enter configuration commands, one per line. End with CNTL/Z.
 Router1(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2
 Router1(config)#  

Check the static routing in router 1 by running following command. In the result you can see the static route 10.10.10.0/24 via 192.168.1.2. other directly connected network also shown in the result of show ip route command

 Router1#sh ip route
 Codes: C - connected, S - static, I - IGRP, 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 192.168.1.2 to network 0.0.0.0
 
 
 C 10.0.0.0 is directly connected, GigabitEthernet0/0/0
 C 192.168.1.0/24 is directly connected, GigabitEthernet0/0/1
 
 
 Router1# 

You can see the result shown above Gateway of last resort in 192.168.1.2 to network 0.0.0.0 means the default route is set in router 1. In router 2 we configure static route and then check whether both PC communicate with each other or not?

You may also like to read --  Link State Routing Protocols

Configuration of static route in route 2

Router 2 identify the two networks connected with it are 192.168.1.0/28 and 10.10.10.0/24. Router 2 do not know about the network 10.0.0.0/8. By configuring static route in router2, we set the path of packets for destination 10.0.0.0/8. Run below commands to set the static route in router2.

 Router2>enable
 Router2#
 Router2#configure terminal
 Enter configuration commands, one per line. End with CNTL/Z.
 Router2(config)#ip route 10.0.0.0 255.0.0.0 192.168.1.1
 Router2(config)#  

Check the static routing in router 2 by running command show ip router in privilege mode. In the result you can see all directly connected network id and static route for 10.0.0.0/8 via 192.168.1.1. see the result below

 Router2>en
 Router2#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, 3 subnets, 3 masks
  S 10.0.0.0/8 [1/0] via 192.168.1.1
  C 10.10.10.0/24 is directly connected, GigabitEthernet0/0/1
  L 10.10.10.1/32 is directly connected, GigabitEthernet0/0/1
 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
  C 192.168.1.0/28 is directly connected, GigabitEthernet0/0/0
  L 192.168.1.2/32 is directly connected, GigabitEthernet0/0/0
   
 Router2#  

you can see in above result the gateway of last resort is not set means default route is not set here. After configuring the default route in router 1 and static route in router 2 try to ping PC1 with PC2. You will get the result as below

 C:\>ping 10.10.10.5
   
 Pinging 10.10.10.5 with 32 bytes of data:
   
 Reply from 10.10.10.5: bytes=32 time<1ms TTL=126
 Reply from 10.10.10.5: bytes=32 time<1ms TTL=126
 Reply from 10.10.10.5: bytes=32 time<1ms TTL=126
 Reply from 10.10.10.5: bytes=32 time<1ms TTL=126
   
 Ping statistics for 10.10.10.5:
 Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
 Approximate round trip times in milli-seconds:
 Minimum = 0ms, Maximum = 0ms, Average = 0ms  

I hope this article may be helpful to you to understand and configure the default routing in router. For any query or suggestion on this article you may contact us or drop a comment below. Your suggestions are always welcome by us.

Share this article in your social circle :)
,

2 thoughts on “Default Routing in router

  1. Very good article! We are linking to this particularly great content on our site. Keep up the great writing.

Leave a Reply

Your email address will not be published. Required fields are marked *