by C. Casquatch
Space to dump notes for CCNA
End goal is to obtain a CCNA certificate from Cisco and maybe learn networking
A router’s routing table holds the best available path (or paths) to a destination network. It is used for forwarding traffic across the network. The table consists of directly connected networks, statically configured routes, and dynamically learned routes via routing protocols. Each entry in the routing table provides critical information that helps the router determine the most efficient path to forward packets.
Routing protocol codes identify the source of the route in the routing table. They indicate how the router learned about the path to the destination network. Common routing protocol codes include:
These codes help the router distinguish how a route was learned and its source.
The prefix is the network address or destination of a route. It represents the network portion of the IP address and is essential for identifying the route’s destination.
Example:
192.168.1.0 represents a network address for the route.
The prefix is commonly paired with the network mask (subnet mask) to specify the network and determine the valid IP addresses within the network range.
The network mask (or subnet mask) defines the range of IP addresses that belong to a particular route. It tells the router which portion of the IP address corresponds to the network and which portion corresponds to the host.
Example:
255.255.255.0 (or /24) is a typical subnet mask that signifies a network with up to 256 possible addresses (including network and broadcast addresses).The mask helps the router in identifying whether a destination IP address is part of the directly connected network or requires forwarding to another router.
The next hop is the IP address of the next router in the path that packets should be forwarded to. It serves as an intermediate router where the packet will be sent before continuing towards its final destination.
Example:
192.168.2.1, the router will forward the packet to this address for further processing.The next hop ensures that packets are directed correctly across the network towards their destination.
Administrative Distance (AD) is a value used to rank the trustworthiness of a route. The lower the AD, the more reliable the route is considered. Each routing protocol has a default AD that helps the router decide which route to prefer if multiple routes to the same destination exist.
Common AD values:
The AD helps the router determine which path to take when multiple protocols provide routes to the same destination.
A metric is a value that helps the router determine the cost of a route. The lower the metric, the more preferred the route is. Different routing protocols use different methods to calculate the metric.
The metric is used to evaluate the “cost” of a route, helping the router make the best choice for routing traffic.
The Gateway of Last Resort is used as a fallback route when no specific match is found in the routing table for a packet’s destination. This route is often configured as a default route and ensures that packets can still be forwarded to their destination, even if a more specific route is unavailable.
0.0.0.0/0::/0The Gateway of Last Resort is typically set up as a static route, or it can be learned through a dynamic routing protocol.
Here are some example entries you might find in a routing table:
C 192.168.1.0/24 is directly connected, GigabitEthernet0/1
192.168.1.0/24 is directly connected to the router through interface GigabitEthernet0/1.O 10.1.1.0/24 [110/2] via 192.168.2.1, 00:00:22, GigabitEthernet0/0
10.1.1.0/24 is learned via OSPF with an AD of 110. The metric is 2, and the next hop is 192.168.2.1. The route was last updated 22 seconds ago, and it is reachable via interface GigabitEthernet0/0.S* 0.0.0.0/0 [1/0] via 192.168.2.1
0.0.0.0/0). It points to the next hop 192.168.2.1, and has an AD of 1.These components of a routing table work together to help the router determine the best path to forward packets efficiently, taking into account network topology, trustworthiness of routes, and the cost of each route.
When a router receives a packet, it must determine the best path to the packet’s destination. This decision is made by consulting its routing table and evaluating various criteria in a specific order. The three primary factors that influence the forwarding decision are:
These factors are evaluated sequentially to identify the optimal path for forwarding the packet.
The longest prefix match is the first criterion a router uses to select the best route to a destination. It refers to the most specific route available in the routing table. The more bits in the subnet mask that match the destination IP address, the more specific the route is considered.
Example:
Given a destination IP address of 192.168.1.100, the routing table has the following entries:
Since 192.168.81.96/28 matches the most bits (28 bits), the router selects this as the best match for the packet’s destination.
If multiple routes share the same longest prefix, the router then compares their Administrative Distance (AD). The AD is a value that indicates the trustworthiness of a route based on how it was learned. Routes with a lower AD are considered more reliable and are preferred over those with a higher AD.
Example:
Consider two routes to the destination 10.1.1.0/24:
The router will select the EIGRP route because it has the lower AD value, making it more trustworthy.
If routes have the same prefix length and AD, the router will compare the metric of each route to determine the best path. The metric is a measure of the “cost” of reaching a destination. Each routing protocol uses different criteria to calculate this cost.
Example:
Consider two OSPF routes to the destination 192.168.10.0/24:
The router will select Route 2 because it has the lower metric, indicating that it is the less costly route.
By evaluating these factors in order, the router makes an informed decision on how to forward a packet towards its destination efficiently.
Open Shortest Path First (OSPF) is a link-state routing protocol commonly used within autonomous systems. Single-area OSPFv2 simplifies configuration and troubleshooting by operating entirely within Area 0, the backbone area.
OSPF routers form neighbor adjacencies to exchange routing information and maintain network topology consistency. Establishing these adjacencies involves several key steps:
show ip ospf neighbor
First Hop Redundancy Protocols (FHRPs) ensure uninterrupted network connectivity by providing default gateway redundancy. They protect against failures in the first-hop router by allowing multiple routers to function as a single logical gateway.
FHRPs operate by assigning specific roles to routers:
0000.0C07.ACxx (where xx is the group number in hexadecimal).0000.5E00.01xx (where xx is the group number in hexadecimal).| Protocol | Type | Roles | Load Sharing | Virtual MAC Address Format |
|---|---|---|---|---|
| HSRP | Cisco proprietary | Active, Standby | No | 0000.0C07.ACxx |
| VRRP | Open standard (RFC 5798) | Master, Backup | No | 0000.5E00.01xx |
| GLBP | Cisco proprietary | AVG, AVF | Yes | Unique virtual MAC for each router |