• Post author:Bhaskar Soni
  • Post published:
  • Post category:Networking
  • Post comments:0 Comments
  • Reading time:3 mins read

Routing is the process of choosing a path for traffic between networks. Every time you open a website, routers along the way read the destination IP address and decide where to send each packet next. They make that decision using a routing table, which they build in different ways. Those ways are the main types of routing: static, default and dynamic.

This guide explains how routing works and compares the three types, with Cisco configuration examples.

types of routing

How routing works

  1. A packet arrives on a router interface.
  2. The router reads the destination IP address.
  3. It looks for the most specific matching route in its routing table (the longest prefix match).
  4. It forwards the packet to the next hop or out of the right interface.
  5. If no route matches and there is no default route, it drops the packet and may send an ICMP “destination unreachable” message.

On Cisco devices, show ip route displays the table. Each entry shows the source, such as C for connected, S for static or O for OSPF.

1. Static routing

An administrator enters routes manually.

ip route 192.168.20.0 255.255.255.0 10.0.0.2

This tells the router to reach 192.168.20.0/24 through the next hop 10.0.0.2.

Advantages:

  • no protocol overhead on links or CPU;
  • predictable paths;
  • more secure, because routers do not accept routes from neighbours.

Disadvantages:

  • does not adapt to failures by itself;
  • hard to manage in large networks;
  • easy to make typing mistakes.

Use it for: small networks, stub sites with one exit, and specific paths you want to control.

2. Default routing

A default route is a special static route that matches any destination not found elsewhere in the table. It is often called the gateway of last resort.

ip route 0.0.0.0 0.0.0.0 203.0.113.1

Use it for: branch offices and edge routers that send all unknown traffic towards the ISP or headquarters. In fact, most home routers rely entirely on a default route.

3. Dynamic routing

Routers run a routing protocol to share information and update routes automatically when the network changes.

router ospf 1
 network 10.0.0.0 0.255.255.255 area 0

Advantages:

  • adapts to link failures and new networks automatically;
  • scales to large networks;
  • supports load balancing over several paths.

Disadvantages:

  • uses bandwidth, CPU and memory;
  • needs careful design and security, such as neighbour authentication.

Types of dynamic routing protocols

CategoryHow it worksExamples
Distance vectorShares routes and distances with neighboursRIP
Advanced distance vectorDistance vector with fast, loop-free updatesEIGRP
Link stateEvery router builds a full map of the areaOSPF, IS-IS
Path vectorShares paths between autonomous systemsBGP

Read more in our guides to OSPF, EIGRP and RIP.

Choosing the right type

SituationBest choice
Small office with one internet linkDefault route
A few fixed paths to partner networksStatic routes
Campus or multi-site enterprise networkDynamic routing, usually OSPF
Internet edge with several ISPsBGP
Backup path for a dynamic routeFloating static route

Most real networks combine all three. For example, a branch might use OSPF internally, a static route to a partner and a default route to the internet.

When several routes compete

If a router learns the same prefix from different sources, it prefers the one with the lowest administrative distance. Learn how in our guide to administrative distance and routing metrics.

Sources

Need help with network security? We test routers, firewalls, ACLs and segmentation as part of our VAPT services and hardening audits. Contact us for a quote.

Post author avatar

Bhaskar Soni

Bhaskar Soni is a Security Engineer and the founder of Youngster Company, based in Ahmedabad, Gujarat. He works hands-on with Linux server hardening, vulnerability assessment and penetration testing (VAPT), ISO 27001 compliance and OSINT investigations. He writes practical, tested guides for IT professionals and Indian businesses, and every article on this site is written or reviewed by him.

Leave a Reply