Routing technologies

8 minuti

Routing is how data finds its way from one IP subnet to another — the core job of every router on every network. The routing table is the router’s roadmap: routes can be configured statically by an administrator or learned dynamically using protocols such as OSPF, EIGRP, and BGP. Route selection relies on longest-prefix matching, administrative distance, and protocol-specific metrics. NAT and PAT extend IPv4’s limited address space by translating private RFC 1918 addresses to public ones. FHRP and VIPs provide redundant default gateways, and subinterfaces let a single physical link carry multiple VLANs. These notes follow Prof. Messer’s Network+ N10-009 videos: Static Routing, Dynamic Routing, Routing Technologies, and Network Address Translation.

⏱ Video — Static Routing (7:12): 0:02 the routing process · 1:23 the routing table · 1:48 network diagram example · 2:40 unknown destinations dropped · 3:28 static routing defined · 3:58 no overhead and stub networks · 4:41 challenges on large networks · 5:38 configuring static routes in cli ⏱ Video — Dynamic Routing (9:03): 0:02 static to dynamic routing · 1:38 eigrp update example · 3:06 behind the scenes routing updates · 4:24 choosing routing protocols · 5:28 eigrp · 6:35 osfp open shortest path first · 8:09 bgp border gateway protocol ⏱ Video — Routing Technologies (16:02): 0:02 job of a router · 1:16 reading a routing table · 2:46 route line breakdown · 4:19 longest prefix match · 7:07 administrative distance · 8:14 routing metrics · 10:57 default gateway limitation · 11:45 fhrp and vip · 13:50 subinterfaces ⏱ Video — Network Address Translation (6:53): 0:02 ipv4 exhaustion · 1:13 rfc 1918 private addresses · 2:24 nat translation example · 3:15 reverse translation · 4:29 nat overload pat · 5:14 example pat translation table

Static routing

  • The routing process: a router receives a packet, reads the destination IP address, and examines its routing table. If the destination is on a directly connected subnet, the router sends the packet there. Otherwise it picks the best next hop — the IP address of the next router along the path — and forwards the packet out the appropriate interface. That next router repeats the process until the packet reaches its final destination.
  • Unknown destinations: if no route exists, the router drops the packet. The routing table must be complete for all destinations the router needs to reach.
  • Static routing means an administrator manually configures each route, router by router. It is fast to set up on a small network, has no CPU or memory overhead compared to dynamic protocols, and is common on stub networks (remote sites with a single internet connection). Because no automatic updates occur, static routing is also considered relatively secure.
  • Challenges: on large networks (hundreds of routers) manual configuration is time-consuming. A misconfigured static route can cause a routing loop. Routes do not change automatically, so topology changes require manual intervention.
  • Configuring static routes (CLI example): to reach 10.10.20.0/24 behind router two, you add a static route on router one that sends matching traffic to next-hop 10.10.40.2. Similarly, to reach 10.10.30.0/24 behind router three, route through 10.10.50.2.

Dynamic routing

  • Dynamic routing automates the routing table: routers discover routes and update each other automatically. If a new router comes online, all neighbours learn about it; if one is removed, the route is withdrawn. This eliminates the manual overhead of static routing.
  • Behind the scenes: routers listen for routing updates on the local subnet (often delivered via multicast). When a router learns a new route it builds its routing table, then sends its own update to other nearby routers. Each router interprets the information and decides whether the new route is better than one it already has.
  • Convergence — the time it takes for all routers to agree on the best routes — varies by protocol. Some converge in seconds, others take minutes.
  • Vendor considerations: some protocols (BGP, OSPF) are open standards and run on any manufacturer’s equipment. Others (EIGRP) have Cisco-proprietary extensions, though basic EIGRP is available on some other vendors.

Routing protocols at a glance

ProtocolFull nameTypeScopeMetric
EIGRPEnhanced Interior Gateway Routing ProtocolDistance vector / hybridAS (autonomous system)Composite (bandwidth, delay, load, reliability)
OSPFOpen Shortest Path FirstLink-stateASCost (based on link throughput and state)
BGPBorder Gateway ProtocolPath vectorExternal (between ASes)Path attributes (AS path length, etc.)

EIGRP (Enhanced Interior Gateway Routing Protocol)

  • Cisco-centric but available on some multi-vendor devices; aspects remain proprietary to Cisco.
  • Relatively easy to set up — enable EIGRP on the router, provide a few configuration options, and it runs.
  • Fast convergence when changes occur; can detect and prevent routing loops.
  • Sends updates with minimum network traffic, leaving bandwidth available for other applications.

OSPF (Open Shortest Path First)

  • Open standard available on devices from many manufacturers. The specification is downloadable and fully public.
  • A link-state protocol: it determines the best route based on the state and availability of the links between OSPF routers.
  • Costs are assigned to individual links based on throughput, link state (up or down), and traversal time. The lowest-cost path becomes the best route.
  • If two equal-cost paths exist, many implementations allow load balancing across both.

BGP (Border Gateway Protocol)

  • An external gateway protocol used between autonomous systems and on internet connections.
  • Designed to handle the scale of the global internet — dynamically updating routes across the entire internet.
  • Sometimes called the “three napkins protocol” because it was first sketched on napkins.
  • If your organisation has one or more internet connections and needs dynamic routing to those sites, you use BGP.

Route selection

  • Longest prefix match: when multiple routes match a destination IP address, the router picks the route with the longest prefix length (most specific subnet mask). Example: 192.168.1.6/32 is more specific than 192.168.1.0/24, which is more specific than 192.168.0.0/16.
  • Administrative distance (AD): when two different protocols know routes to the same destination, the router compares AD values. Lower is better. Typical default Cisco values:
    • 0 — directly connected
    • 1 — static route
    • 90 — EIGRP
    • 110 — OSPF
    • 120 — RIP (Routing Information Protocol)
  • Routing metrics: per-protocol internal values that break ties within the same protocol — you cannot compare metrics across different protocols. RIP uses hop count, EIGRP uses a composite metric (bandwidth, delay, load, reliability), and BGP uses its own set of path attributes.

NAT and PAT (Network Address Translation)

  • IPv4 exhaustion: IP version 4 supports 4.29 billion addresses; every IPv4 address has been allocated. NAT (Network Address Translation) extends IPv4’s usable life by mapping private RFC 1918 addresses to public ones.
  • RFC 1918 private address ranges (not routable on the public internet):
    • 10.0.0.0 – 10.255.255.255 (large enterprises)
    • 172.16.0.0 – 172.31.255.255
    • 192.168.0.0 – 192.168.255.255 (home networks)
  • NAT translation: a NAT-enabled router receives a packet from an internal device (e.g., 10.10.20.15), replaces the source IP with a public address (e.g., 94.1.1.1), and forwards it to the internet. Return traffic is reverse-translated back to the internal address.
  • PAT (Port Address Translation), also called NAT overload: translates both the IP address and the source port number, allowing many internal devices to share a single public IP. Each connection gets a unique port mapping in the NAT table.

FHRP (First Hop Redundancy Protocol)

  • A workstation has only one IP address for its default gateway. To provide router redundancy without reconfiguring every device, you create a VIP (Virtual IP address) shared between two or more routers.
  • One router is the active router (owns the VIP); the other is a standby or backup. If the active router fails, the standby detects the loss, takes over the VIP, and traffic continues without interruption — the user never knows a different router is in use.

Subinterfaces

  • A single physical router interface (e.g., ethernet 1/1) can be divided into multiple subinterfaces (ethernet 1/1.10, ethernet 1/1.20, ethernet 1/1.100). This is useful when a trunk connection carries multiple VLANs over one cable: each subinterface is assigned an IP address, subnet mask, and routing configuration for its VLAN.

Where attacks live — mental map (beyond the video)

Not from the video — why this matters for security.

  • Static routes are invisible to dynamic routing protocols — an attacker who compromises one router may not see all paths.
  • BGP hijacking remains a real threat: a rogue AS advertises prefixes it does not own, redirecting traffic. BGP relies on trust between peers.
  • NAT hides internal hosts from the internet, which offers a degree of privacy — but a misconfigured NAT rule (port forward) punches a hole through that protection.
  • PAT exhaustion: if internal devices create too many simultaneous connections, the NAT table fills and new connections fail — a denial of service vector from inside.
  • FHRP spoofing: on a local subnet, an attacker can try to impersonate the standby router and take over the VIP (HSRP/VRRP attacks).
  • Subinterfaces complicate ACL placement: if the rules do not account for every VLAN subinterface, traffic can leak between VLANs.