From c2b697ca75674bb73a277c178c7b947363ae8016 Mon Sep 17 00:00:00 2001 From: mrsh Date: Wed, 29 Apr 2026 01:22:50 +0200 Subject: [PATCH] ajout 11. Routing Fundamentals --- 05. Ethernet LAN Switching (part 1).md | 3 +- 06. Ethernet LAN Switching (part 2).md | 3 +- 07. IPv4 Addressing (Part 1).md | 3 +- 08. IPv4 Addressing (Part 2).md | 3 +- 09. Switch Interfaces.md | 4 +- 10. IPv4 Header.md | 4 +- 11. Routing Fundamentals.md | 137 +++++++++++++++++++++++++ 7 files changed, 151 insertions(+), 6 deletions(-) create mode 100644 11. Routing Fundamentals.md diff --git a/05. Ethernet LAN Switching (part 1).md b/05. Ethernet LAN Switching (part 1).md index 92c0fa6..a586c8a 100644 --- a/05. Ethernet LAN Switching (part 1).md +++ b/05. Ethernet LAN Switching (part 1).md @@ -2,7 +2,8 @@ id: 1772845705-JEBL aliases: - Ethernet LAN Switching -tags: [] +tags: + - CCNA --- # Ethernet LAN Switching (part 1) diff --git a/06. Ethernet LAN Switching (part 2).md b/06. Ethernet LAN Switching (part 2).md index c6748d1..17650d9 100644 --- a/06. Ethernet LAN Switching (part 2).md +++ b/06. Ethernet LAN Switching (part 2).md @@ -1,7 +1,8 @@ --- id: 06. Ethernet LAN Switching (part 2) aliases: [] -tags: [] +tags: + - CCNA --- # Ethernet LAN Switching (part 2) diff --git a/07. IPv4 Addressing (Part 1).md b/07. IPv4 Addressing (Part 1).md index a3dcf77..c03ee61 100644 --- a/07. IPv4 Addressing (Part 1).md +++ b/07. IPv4 Addressing (Part 1).md @@ -1,7 +1,8 @@ --- id: 07. IPv4 Addressing (Part 1) aliases: [] -tags: [] +tags: + - CCNA --- # IPv4 Addressing (Part 1) diff --git a/08. IPv4 Addressing (Part 2).md b/08. IPv4 Addressing (Part 2).md index 47acc9e..1a26ac8 100644 --- a/08. IPv4 Addressing (Part 2).md +++ b/08. IPv4 Addressing (Part 2).md @@ -1,7 +1,8 @@ --- id: 08. IPv4 Addressing (Part 2) aliases: [] -tags: [] +tags: + - CCNA --- # IPv4 Addressing (Part 2) diff --git a/09. Switch Interfaces.md b/09. Switch Interfaces.md index 7c390d1..b7c44f4 100644 --- a/09. Switch Interfaces.md +++ b/09. Switch Interfaces.md @@ -2,7 +2,9 @@ id: 1777334914-ICRP aliases: - Switch Interfaces -tags: [] +tags: + - CCNA + - Switch --- # Switch Interfaces diff --git a/10. IPv4 Header.md b/10. IPv4 Header.md index bde2710..fb9765e 100644 --- a/10. IPv4 Header.md +++ b/10. IPv4 Header.md @@ -2,7 +2,9 @@ id: 1777370971-DYNV aliases: - IPv4 Header -tags: [] +tags: + - Cisco + - CCNA --- # IPv4 Header diff --git a/11. Routing Fundamentals.md b/11. Routing Fundamentals.md new file mode 100644 index 0000000..f78e138 --- /dev/null +++ b/11. Routing Fundamentals.md @@ -0,0 +1,137 @@ +--- +id: 11. Routing Fundamentals +aliases: [] +tags: + - Cisco + - routers +--- + +# Routing Fundamentals + +## What is routing ? + +- **Routing** is the process taht routers use to determine the path that IP packets +should take over a network to reach their destination. + - Routers store routes to all of their known destinations in a routing table + - When routers receive packets, they look in the **routing table** to find + the best route to forward that packet. + +There are two main rounting methods (methods that routers use to learn routes): +- **Dynamic Routing**: + - Routers use [[dynamic routing protocols]] (ie. [[OSPF]]) to share routing information + with each other automatically and build their routing tables. +- **Static Routing**: + - A network engineer/admin manually configures routes on the router. + +A route tells the router: to send a packet to destination X, you should send the +[[packet]] to next-hop Y. + next-hop= the next router in the path to the destination +- or if the destination is directly connected to the router, send the packet directly to the destination. +- or if the destination is the router/s own [[ip address]], receive the packet for yourself (don't forward it) + +[[WAN]] Wide Area Network = a network that extends over a large geographical area + +## Routing table +### R1 Pre-configuration (IP address) +[[08. IPv4 Addressing (Part 2)]] + +### Show routing table +On cisco router you can show routing table with this command + +```cisco +R1#show ip route +``` + +There are two main Output for this command: +- **Codes** +- **Routes** + +#### Codes + +The Codes legend in the output of show ip route lists the different protocols which +routers can use to learn routes. +- L - Local + - A route to the actual IP address configured on the interface. (with a /32 netmask) +- C - connected + - A route to the network the interface is connected to. (with the actual netmask configured on the interface) + +#### Routes + +When you configure an IP address on an interface and enable it with no shutdown, 2 routes +(per interface) will automatically be aded to the routing table + - a connected route + - a local route + +A connected route is a route to the network the interface is connected to + - R1 G0/2 IP = 192.168.1.1/24 + - network address = 192.168.1.0/24 + - It provides a route to all hosts in that network (192.168.1.2 -> 192.168.1.254) + - R1 knows "if i need to send a packet to any host in the 192.168.1.0/24 network, i should send it out of G0/2" + +A local route is a route to the exact IP address configured on the interface + - A /32 netmask is used to specify the exact IP address of the interface. + - /32 means all 32 bits are "fixed", they can't change. + - Even though R1's G02 is configured as 192.168.1.1/24 the connected route is to 192.168.1.1/32 + - R1 knows "if i receive a packet destined for this IP address, the message is for me" + +#### Clarification + +// bold part is fixed + +**192.168.1**.0/24 +**255.255.255**.0 + +192.168.1.0/24 matches 192.168.1.0 ~ 192.168.1.255 +- If R1 receives a packet with a destination in that range, it will send the packet out of G0/2 + +192.168.1.2 = match +-> Send packet out of G0/2 +192.168.1.56 = match +-> Send packet out of G0/2 +192.168.2.56 = no match +-> Send the packet using a different route, +-> or drop the packet there is no matching route + +a route matches a packet's destination if the packet's destination IP address is part +of the network specified in the route. + +// bold part is fixed + +**192.168.1.1**/32 +**255.255.255.255** + +192.168.1.1/32 matches Only 192.168.1.1 + +## Route Selection + +A packet destined for 192.168.1.1 is matched by both routes: +- 192.168.1.0/24 +- 192.168.1.1/32 + +it will choose the most **specific matching** route. +- the route to 192.168.1.0/24 includes 256 different IP addresses (192.168.1.0 - 192.168.1.255) +- the route to 192.168.1.1/32 includes only 1 IP addresses (192.168.1.1) + - This route is **more specific** + +*Most specific matching route = the matching route with the longest prefix length* + +### Cisco router lines + +```cisco +192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks +192.168.1.0/24 is directly connected, GigabitEthernet0.2 +192.168.1.1/32 is directly connected, GigabitEthernet0.2 +``` +these three lines are not routes, they mean the followong: +- 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks + - In the routing table, there are two routes to subnets that fit within the + 192.168.1.0.24 Class C network with two different netmask (24/32). + + +## Review + +- What is routing? +- The routing table on a Cisco [[router]] + - Connected and local Routes +- Routing fundamentals (route selection) +