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.

How routing works
- A packet arrives on a router interface.
- The router reads the destination IP address.
- It looks for the most specific matching route in its routing table (the longest prefix match).
- It forwards the packet to the next hop or out of the right interface.
- 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.2This 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.1Use 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 0Advantages:
- 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
| Category | How it works | Examples |
|---|---|---|
| Distance vector | Shares routes and distances with neighbours | RIP |
| Advanced distance vector | Distance vector with fast, loop-free updates | EIGRP |
| Link state | Every router builds a full map of the area | OSPF, IS-IS |
| Path vector | Shares paths between autonomous systems | BGP |
Read more in our guides to OSPF, EIGRP and RIP.
Choosing the right type
| Situation | Best choice |
|---|---|
| Small office with one internet link | Default route |
| A few fixed paths to partner networks | Static routes |
| Campus or multi-site enterprise network | Dynamic routing, usually OSPF |
| Internet edge with several ISPs | BGP |
| Backup path for a dynamic route | Floating 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.
