0% found this document useful (0 votes)
97 views43 pages

IP Routing Technology

This document discusses IP routing technology. It begins by explaining that routing is needed to allow communication between different IP network segments connected by layer 3 devices like routers. These devices use routing tables to forward data to the appropriate outgoing interface based on a packet's destination IP address, enabling inter-segment communication. The document then covers routing definitions, static routing configuration, and the routing process for both directly connected and non-directly connected networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views43 pages

IP Routing Technology

This document discusses IP routing technology. It begins by explaining that routing is needed to allow communication between different IP network segments connected by layer 3 devices like routers. These devices use routing tables to forward data to the appropriate outgoing interface based on a packet's destination IP address, enabling inter-segment communication. The document then covers routing definitions, static routing configuration, and the routing process for both directly connected and non-directly connected networks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

IP Routing Technology

Foreword

⚫ In our network, there are many different IP network segments, and data interaction between different
segments is required with the help of Layer 3 devices. These devices have routing capabilities and can
forward data to different network segments.
⚫ Routing is a fundamental element in data communication networks. Routing information is the path
information that guides the forwarding of messages, and the routing process is the process of message
forwarding.

Innovation • Simplicity • Experience


Objective

⚫ After taking this course, you will be able to:


➢ Understanding the definition of routing

➢ Understanding the classification of routing

➢ Mastering the use of static routing

Innovation • Simplicity • Experience


Contents

1. Routing Overview

2. Static Routing

3. Dynamic Routing

Innovation • Simplicity • Experience


Why Routing Is Needed

⚫ When the PC's NIC is transmiting data, the network layer will check whether the destination IP is in the same network
segment or not
➢ If belonging to a network segment, then ARP can be directly used to parse the MAC address of the destination IP directly
➢ If not belonging to a network segment, then ARP can be used to parse the MAC address of the gateway

⚫ Within a Layer 2 switched network (same broadcast domain/VLAN), hosts on different network segments cannot
communicate with each other directly
SW1 SW2

PC1 PC2 PC3 PC4


192.168.1.100/24 192.168.1.200/24 192.168.2.100/24 192.168.2.200/24

PC2 and PC3 are not in the same IP network segment


(192.168.1.0/24 and 192.168.2.0/24)

Innovation • Simplicity • Experience


Definition of Routing

⚫ The process of receiving a packet from an interface, orienting and forwarding it based on the packet's destination IP
address
⚫ The router selects the next-hop address/outgoing interface and forwards data based on the routing table, enabling
communication across IP segments

Broadcast Domain Broadcast Domain


LAN1 LAN2
Routing
Data Forwarding

Destination IP: Data


192.168.2.100
PC1 PC2 PC3 PC4
192.168.1.100/24 192.168.1.200/24 192.168.2.100/24 192.168.2.200/24

Innovation • Simplicity • Experience


Direct routing data communications-Host

⚫ Direct Routing: communication within the same IP network


⚫ If the network number of the destination address is the same as the network number of the host/next hop, the
destination is in the directly connected network segment.

Resolve destination
host hardware address
Y

The upper layer Encapsulated into a


Whether the destination frame, sent out by the
protocol requires
is directly connected corresponding interface
sending data packets

N
Resolve gateway/next hop
hardware address

10.1.1.1/8 172.16.1.1/16 192.168.1.1/24

10.2.1.1/8 172.16.2.1/16 192.168.2.1/24

Innovation • Simplicity • Experience


Direct routing data communications

⚫ The communication process between PC1 and PC2 in the same LAN: PC1>ping 192.168.1.200

PC1 PC2 PC3 PC4


1.Ping 192.168.1.200 192.168.1.100/24 192.168.1.200/24 192.168.2.100/24 192.168.2.200/24

2.Encapsulation 3. Broadcast ARP Request 4. Unicast ARP Reply


Data (ICMP) Data (ARP) Data (ARP)
SIP: 192.168.1.100 Sender MAC: MAC_PC1 Sender MAC: MAC_PC2
DIP:192.168.1.200 Sender IP:0.0.0.0 Sender IP:192.168.1.200
Target MAC:0000.0000.0000 Target MAC:MAC_PC1
SMAC:MAC_PC1
Target IP:192.168.1.200 Target IP:0.0.0.0
DMAC:?
SMAC:MAC_PC1 SMAC:MAC_PC2
DMAC:FFFF.FFFF.FFFF DMAC:MAC_PC1

Innovation • Simplicity • Experience


Direct routing data communications

⚫ The communication process between PC1 and PC2 in the same LAN: PC1>ping 192.168.1.200

1.Ping 192.168.1.200 PC1 PC2 PC3 PC4


192.168.1.100/24 192.168.1.200/24 192.168.2.100/24 192.168.2.200/24
2.Encapsulation
Data (ICMP)
SIP: 192.168.1.100
DIP:192.168.1.200
SMAC:MAC_PC1
DMAC:MAC_PC2

Innovation • Simplicity • Experience


Router: forwards unicast IP packets

⚫ If the network number of the destination address is the same as the network number of any interface of
the router, the destination is located in the network segment directly connected to the corresponding
interface.
⚫ The router determines the address of the next hop router by looking up the routing information.

Whether the destination Y Submit native upper


Packet inbound
IP is native layer protocol to process

N Y
Whether the purpose IP
is directly connected

Resolve next hop Resolve the destination


router hardware address host hardware address

Encapsulated into a
frame, sent out by the
corresponding interface

Innovation • Simplicity • Experience


Non-direct connection routing of data communications

⚫ For example: PC2>ping 192.168.2.100 Router

PC2: G0/1 G0/2


1.Ping 192.168.2.100 SW1 SW2
2.Encapsulation
Data (ICMP)
SIP: 192.168.1.200
DIP:192.168.2.100
SMAC: MAC_PC1
DMAC: MAC_Gateway_G0/1
PC1 PC2 PC3 PC4
192.168.1.100/24 192.168.1.200/24 192.168.2.100/24 192.168.2.200/24
SW1:
3. Forward the ICMP message
according to the mac address table

Router: Data (ICMP)


4. Receives and decapsulates the IP SIP: 192.168.1.200
packet.Re-encapsulate the Ethernet DIP:192.168.2.100
frame according to IP routing table
SMAC: MAC_Router_G0/2
DMAC: MAC_PC3

Innovation • Simplicity • Experience


Routing Devices

Router Layer 3 Switches firewalls Export Gateway Servers with soft routing
capabilities
Routing
table

Control Build and maintain paths to different IP


Plane networks

Use the queried outgoing interface to


Forwarding Query the routing table based on the
re-encapsulate the data frame to the
Plane destination IP address of the packet
next-hop device

Innovation • Simplicity • Experience


Next Hop

⚫ The next-hop address is determined by the routing table, and the default next-hop address of the PC
client is usually called the "gateway"
➢ As shown in the figure, PC2 wants to communicate with PC3
Router and PC3 belong to the same
LAN2, no need for next hop, directly
forwarding packets to PC3

192.168.1.254/24 192.168.2.254/24
Broadcast Domain Broadcast Domain
LAN1 LAN2

The next hop of PC2


is 192.168.1.254
The address of the
Destination next hop when the
Data packet returns?
192.168.2.100
PC1 PC2 PC3 PC4
192.168.1.100/24 192.168.1.200/24 192.168.2.100/24 192.168.2.200/24
Gateway:192.168.1.254 Gateway:192.168.2.254

Innovation • Simplicity • Experience


Next Hop

⚫ The next-hop address is the best path chosen by the routing device based on the routing table
➢ As shown in the figure, PC2 wants to communicate with PC3
172.16.1.2/30 172.16.1.5/30

172.16.1.1/30 172.16.1.6/30
R2

10M Twisted Pair 192.168.2.254/24


Broadcast Domain 192.168.1.254/24 Broadcast Domain
LAN1 LAN2

The next hop of R2 is


R1 172.16.1.6 R3

the next hop of R1 is R3 and PC3 belong to


172.16.1.2 the same LAN2, no
need for the next hop,
Destination directly forwarding
Data
192.168.2.100 packets to PC3

The next hop of PC2


PC1 PC2 is 192.168.1.254 PC3 PC4
192.168.1.100/24 192.168.1.200/24 192.168.2.100/24 192.168.2.200/24
Gateway: 192.168.1.254 Gateway:192.168.2.254

Innovation • Simplicity • Experience


Routing Sources

⚫ Form a direct connection routing by configuring IP to the active interface


⚫ Direct connection routing indicates the network to which the router is
Direct
Connection directly connected
Routing

⚫ Administrators manually configured routing information


⚫ Unaware of network topology changes, requiring human adjustment
⚫ Suitable for small and simple networks
Static
Routing Routing
table

⚫ Routers use some kind of dynamic routing protocol to generate routing


information based on information passed to each other
⚫ Advantages: Ability to automatically adjust routing information when the
Dynamic
network topology changes
Routing
⚫ Disadvantages: Generates additional traffic in the link and imposes
additional CPU and memory overhead on the routing device

Innovation • Simplicity • Experience


Routing Table Entry

⚫ The routing table is the basis for the router's judgment in forwarding data messages.

172.16.1.2/30 172.16.1.5/30
F0/0 F0/1

172.16.1.6/30
172.16.1.1/30 F0/1
R2
F0/1 192.168.2.254/24
172.16.1.9/30 172.16.1.10/30 F0/0
192.168.1.254/24
F0/0 E0/0 10M Twisted Pair E0/0
F0/2
R1 R3 192.168.3.254/24
Routing table for R1
Routing Sources Destination Address/Mask next hop address Outlet interface Metric
Direct Connection Routing 10.13.1.0/24 192.168.1.254 F0/0 0
Direct Connection Routing 172.16.1.0/30 172.16.1.1 F0/1 0
Direct Connection Routing 172.16.1.8/30 172.16.1.9 E0/0 0
Dynamic Routing 192.168.2.0/24 172.16.1.2 F0/1 20
Dynamic Routing 172.16.1.4/30 172.16.1.2 F0/1 10
Static Routing 192.168.3.0/24 172.16.1.10 E0/0 0

Innovation • Simplicity • Experience


Metric

⚫ Metric: A parameter used by routing protocols to measure the merit of a path. Denoting the sum of the cost of reaching
the destination
⚫ Factors Affecting Metric: line bandwidth, number of hops, line latency, line utilization, line confidence, etc.
Routing Type Metric Reference Factors
Static Routing 0
Dynamic Routing Protocol OSPF Bandwidth
Dynamic Routing Protocol RIP Hop count

172.16.1.2/30 172.16.1.5/30
F0/0 F0/1

172.16.1.6/30
172.16.1.1/30 F0/1
R2
F0/1 192.168.2.254/24
For the target network: 192.168.2.0/24
172.16.1.9/30 172.16.1.10/30 F0/0
If the entire network uses OSPF 192.168.1.254/24
If the entire network uses RIP E0/0 10M Twisted Pair E0/0
F0/0
F0/2
R1 R3 192.168.3.254/24

Innovation • Simplicity • Experience


IP routing table

⚫ Command to display the routing table: R1#show ip route Source Notes

R1#show ip route C - connected Direct Connection Routing


Codes: C - connected,S – static, R – RIP, O- OSPF
IA - OSPF inter area,E1-OSPF external type 1 S – static Static Routing
E2 - OSPF external type 2,* - candidate default R – RIP Dynamic Routing Protocol RIP
Gateway of last resort is not set
O- OSPF Dynamic Routing Protocol OSPF
192.168.1.0/24 is subnetted, 1 subnets
172.16.1.0/30 is subnetted, 1 subnets
* - candidate default
172.16.1.8/30 is subnetted, 1 subnets
The routing entry with an asterisk is the default
C 192.168.1.0/24 is directly connected, fastethernet0/0
routing
C 172.16.1.0/30 is directly connected, fastethernet0/1
C 172.16.1.8/30 is directly connected, ethernet0/0 Gateway of last resort is not set
O 192.168.2.0/24 [110/20] via 172.16.1.2, 01:03:01, fastethernet0/1 Indicates the default routing address (no default
O 172.16.1.4/30 [110/10] via 172.16.1.2, 01:03:01, fastethernet0/1 routing here)
S 192.168.3.0/24 [1/0] via 172.16.1.10

Target Administrative
Source Network Next hop IP Local Export
distance/Metrics

Innovation • Simplicity • Experience


Administrative distance

⚫ Administrative Distance, also called priority, is used to measure the trustworthiness of a routing source
⚫ The lower the administrative distance value, the higher the confidence level. Only the most trusted routings will be
added to the routing table
⚫ Administrative distance default value is vendor-defined Routing Sources
Default administrative
distance value
172.16.1.2/30 172.16.1.5/30
F0/0 F0/1 Direct Connection Routing 0
Static Routing 1
172.16.1.6/30
172.16.1.1/30 F0/1 Dynamic Routing OSPF 110
R2
F0/1 192.168.2.254/24
Dynamic Routing RIP 120
172.16.1.9/30 172.16.1.10/30 F0/0
192.168.1.254/24 Unreachable Routings 255
F0/0 E0/0 10M Twisted Pair E0/0
F0/2 1. Network-wide operation of RIP, new
R1 R3 192.168.3.254/24 RIP routing entries

Routing Table of R1 2. Network-wide re-operation of OSPF,


Destination Outlet administrative RIP routing entries are deleted and new
Routing Sources Next hop address Metric
Address/Mask interface distance
OSPF routing entries are added
Dynamic Routing
192.168.3.0/24 172.16.1.10 E0/0 1 120
RIP
Dynamic
192.168.3.0/24 172.16.1.2 F0/1 20 110
Routing OSPF

Innovation • Simplicity • Experience


Routing entry addition principles

⚫ Only the best path is added to the routing table, forming a routing entry

Compare Target
Networks • Put into routing table in different target networks

Compare
Administrative
• Manage the path with the lowest administrative distance into the
If equal
Distance routing table

Compare Metric
• The path with the lowest metric is placed in the routing
If equal table

Load • they are placed in the routing table, and


If equal Balancing traffic is shared equally between paths

Innovation • Simplicity • Experience


Longest subnet mask matching

⚫ The routing device looks up the routing table according to the longest subnet mask matching principle based on the
destination IP address of the packet
⚫ Forwarding based on query results
⚫ If the query is unsuccessful, the packet is dropped

When the destination IP of the packet is 172.16.1.1, it will be forwarded by the F0/1 interface

Partial routing table of R1 F0/1


172.16.1.0/24
Destination Address/Mask Outlet interface F0/0

172.16.1.0/24 F0/1

172.16.0.0/16 F0/2 172.16.0.0/16


F0/2
PC1 R1

When the destination IP of the packet is 172.16.2.1, it will be forwarded by the F0/2 interface

Innovation • Simplicity • Experience


Contents

1. Routing Overview

2. Static Routing

3. Dynamic Routing

Innovation • Simplicity • Experience


Static Routing

⚫ The routing information configured manually by the network administrator, when the network topology
changes, the administrator needs to manually modify the static routing information
⚫ Static routing information is locally valid and will not be passed on to other routers
⚫ Static routing is generally suitable for relatively simple network environments, large and complex network
environments are usually not suitable for static routing
⚫ The benefits of using static routings are high network security and confidentiality
⚫ Use the global configuration command ip route to configure a static routing
➢ The next hop address must be a reachable address on the directly connected network
➢ For point-to-point connections, the next-hop address can be replaced by the outgoing interface

R1(config)# ip route network net-mask {ip-address | interface} [distance]


Target Subnet Next hop Outlet Administrative
network mask address interface distance

Innovation • Simplicity • Experience


Example 1 - Basic Configuration

⚫ Configure static routings on 3 routers, so that Net 1 and Net 2 can communicate with each other
➢ Select 100M link with the path: Net1-R1-R2-R3-Net2
R2

G0/2 Gi0/0
172.16.1.2/30 172.16.1.5/30

G0/2 Gi0/0
172.16.1.1/30 172.16.1.6/30
R1(config)#ip route 192.168.2.0 255.255.255.0 172.16.1.2
10M Twisted Pair
R1 R3 R2(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.1
Gi0/1 Gi0/1
172.16.1.9/30 172.16.1.10/30
R2(config)#ip route 192.168.2.0 255.255.255.0 172.16.1.6
G0/5 G0/5
192.168.1.254/24 192.168.2.254/24 R3(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.5

Net 1 Net 2
10.13.1.0/24 192.168.2.0/24

Innovation • Simplicity • Experience


Example 1 - Viewing Static Routes

⚫ Display IP routing table in privileged user mode


➢ ruijie#show ip route

⚫ View the routing table of R1, R2 and R3


R1#show ip route
C 192.168.1.0/24 is directly connected, GigabitEthernet 0/5
C 172.16.1.0/30 is directly connected, GigabitEthernet 0/2
C 172.16.1.8/30 is directly connected, GigabitEthernet 0/1
S 192.168.2.0/24 [1/0] via 172.16.1.2

R2#show ip route
C 172.16.1.0/30 is directly connected, GigabitEthernet 0/2
C 172.16.1.4/30 is directly connected, GigabitEthernet 0/0
S 192.168.1.0/24 [1/0] via 172.16.1.1
S 192.168.2.0/24 [1/0] via 172.16.1.6

R3#show ip route
C 172.16.1.4/30 is directly connected, GigabitEthernet 0/0
C 192.168.2.0/24 is directly connected, GigabitEthernet 0/5
C 172.16.1.8/30 is directly connected, GigabitEthernet 0/1
S 192.168.1.0/24 [1/0] via 172.16.1.5

Innovation • Simplicity • Experience


Example 2 - Default Routing

⚫ The default static routing is a special static routing that has a destination network and subnet mask of 0.0.0.0 (it is
possible that the default routing is a dynamic routing)
⚫ Configure the default routing on R1 and R3 so that a 10M link can be used when the 100M link between R1 and R3
fails
R2

G0/2 Gi0/0 R1(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.10


172.16.1.2/30 172.16.1.5/30 R3(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.9
G0/2 Gi0/0
172.16.1.1/30 172.16.1.6/30 R1#show ip route
10M Twisted Pair C 192.168.1.0/24 is directly connected, GigabitEthernet 0/5
R1 R3 C 172.16.1.0/30 is directly connected, GigabitEthernet 0/2
Gi0/1 Gi0/1 C 172.16.1.8/30 is directly connected, GigabitEthernet 0/1
172.16.1.9/30 172.16.1.10/30 G0/5
G0/5 S* 0.0.0.0/0 [1/0] via 172.16.1.10
192.168.1.254/24 192.168.2.254/24

R3#show ip route
C 172.16.1.4/30 is directly connected, GigabitEthernet 0/0
Net 1 Net 2
10.13.1.0/24 192.168.2.0/24
C 192.168.2.0/24 is directly connected, GigabitEthernet 0/5
C 172.16.1.8/30 is directly connected, GigabitEthernet 0/1
S* 0.0.0.0/0 [1/0] via 172.16.1.9

Innovation • Simplicity • Experience


Example 3 - Floating Static Routing

⚫ Floating routing is based on the static routing, plus the administrative distance parameter, the smaller the
administrative distance, the higher the trustworthiness
⚫ Multiple floating routings are configured, and only the one with the highest confidence (smallest administrative
distance) will be added to the routing table
⚫ When the highest confidence float routing fails, the float with the next highest confidence is added to the routing table
⚫ The normal path is: Net1-R1-R2-R3-Net2, the backup path switches is: Net1-R1-R3-Net2
R2

G0/2 Gi0/0
172.16.1.2/30 172.16.1.5/30

G0/2 Gi0/0
172.16.1.6/30 R1(config)#ip route 192.168.2.0 255.255.255.0 172.16.1.2 10
172.16.1.1/30
R1(config)#ip route 192.168.2.0 255.255.255.0 172.16.1.10 100
10M Twisted Pair
R1 R3
Gi0/1 Gi0/1 R3(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.5 10
G0/5 172.16.1.9/30 172.16.1.10/30 G0/5 R3(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.9 100
192.168.1.254/24 192.168.2.254/24

Net 1 Net 2
10.13.1.0/24 192.168.2.0/24

Innovation • Simplicity • Experience


Example 3 - Viewing a Floating Static Routing

⚫ View the routing table of R1 and R3 after the configuration is complete


R1#show ip route
C 192.168.1.0/24 is directly connected, GigabitEthernet 0/5
C 172.16.1.0/30 is directly connected, GigabitEthernet 0/2
C 172.16.1.8/30 is directly connected, GigabitEthernet 0/1
S 192.168.2.0 /24 [10/0] via 172.16.1.2

R3#show ip route
C 172.16.1.4/30 is directly connected, GigabitEthernet 0/0
C 192.168.2.0/24 is directly connected, GigabitEthernet 0/5
C 172.16.1.8/30 is directly connected, GigabitEthernet 0/1
S 192.168.1.0 /24 [10/0] via 172.16.1.5
⚫ After disconnecting R1 from R2 and R3 from R2, check the routing table of R1 and R3
R1#show ip route
C 192.168.1.0/24 is directly connected, GigabitEthernet 0/5
C 172.16.1.8/30 is directly connected, GigabitEthernet 0/1
S 192.168.2.0 /24 [100/0] via 172.16.1.10

R3#show ip route
C 192.168.2.0/24 is directly connected, GigabitEthernet 0/5
C 172.16.1.8/30 is directly connected, GigabitEthernet 0/1
S 192.168.1.0 /24 [100/0] via 172.16.1.9

Innovation • Simplicity • Experience


Example 4 - Configuring Static Routing on a Layer 3 Switch

⚫ Layer 3 switches have routing capabilities to enable inter-VLAN communication


⚫ Interconnection between Layer 3 switches.
➢ Option 1: Using trunk, add an IP address to the SVI (switch virtual interface) port as a Layer 3 interface
➢ Option 2: Using Layer 3 routing interfaces

⚫ Configure static routings on two Layer 3 switches


G0/5 G0/5
Layer 3 Switches Layer 3 Switches
SW1 SW2

Vlan 10 Vlan 20 Vlan 30 Vlan 40


Layer 2 Switches Layer 2 Switches
SW3 SW4

PC1 PC2 PC3 PC4


192.168.1.100/24 192.168.2.200/24 192.168.3.100/24 192.168.4.200/24
Default gateway: 192.168.1.254 Default gateway:192.168.2.254 Default gateway: 192.168.3.254 Default gateway: 192.168.4.254

Innovation • Simplicity • Experience


Example 4 - Configuring Static Routing on a Layer 3 Switch

⚫ SVI and static routing configuration of SW1 and SW2


➢ Make the switch have multiple virtual routing ports by configuring IP addresses for VLANs 10, 20, 30, 40, 800 and no shutdown,
making the switch have multiple virtual routing ports.
➢ The SVI addresses of VLANs 10, 20, 30, and 40 can be used as the default gateway for the PCs in the corresponding VLANs,
respectively
➢ (Option 1) The SVI address of VLAN 800 can be used as the routing address for direct connection between SW1 and SW2
➢ Configure static routings so that PCs in different VLANs and between different IP networks can communicate with each other

SW1(config)#interface vlan 10 SW2(config)#interface vlan 30


SW1(config-if)#ip address 192.168.1.254 255.255.255.0 SW2(config-if)#ip address 192.168.3.254 255.255.255.0
SW1(config)#interface vlan 20 SW2(config)#interface vlan 40
SW1(config-if)#ip address 192.168.2.254 255.255.255.0 SW2(config-if)#ip address 192.168.4.254 255.255.255.0
SW1(config)#vlan 800 SW2(config)#vlan 800
SW1(config)#interface vlan 800 SW2(config)#interface vlan 800
SW1(config-if)#ip address 10.0.0.1 255.255.255.252 SW2(config-if)#ip address 10.0.0.2 255.255.255.252
SW1(config)#ip route 192.168.3.0 255.255.255.0 10.0.0.2 SW2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.1
SW1(config)#ip route 192.168.4.0 255.255.255.0 10.0.0.2 SW2(config)#ip route 192.168.2.0 255.255.255.0 10.0.0.1

Innovation • Simplicity • Experience


Example 4 - Configuring Static Routing on a Layer 3 Switch

⚫ SVI and static routing configuration of SW1 and SW2


➢ Make the switch have multiple virtual routing ports by configuring IP addresses for VLANs 10, 20, 30, 40, 800 and no shutdown,
making the switch have multiple virtual routing ports.
➢ The SVI addresses of VLANs 10, 20, 30, and 40 can be used as the default gateway for the PCs in the corresponding VLANs,
respectively
➢ (Option 2) The G0/5 interface of SW1 and SW2 can be converted into a Layer 3 routing interface as an interconnection address
➢ Configure static routings so that PCs in different VLANs and between different IP networks can communicate with each other

SW1(config)#interface vlan 10 SW2(config)#interface vlan 30


SW1(config-if)#ip address 192.168.1.254 255.255.255.0 SW2(config-if)#ip address 192.168.3.254 255.255.255.0
SW1(config)#interface vlan 20 SW2(config)#interface vlan 40
SW1(config-if)#ip address 192.168.2.254 255.255.255.0 SW2(config-if)#ip address 192.168.4.254 255.255.255.0
SW1(config)#interface GigabitEthernet 0/5 SW2(config)#interface GigabitEthernet 0/5
SW1(config-if)#no switchport SW2(config-if)#no switchport
SW1(config-if)# ip address 10.0.0.1 255.255.255.252 SW2(config-if)# ip address 10.0.0.2 255.255.255.252
SW1(config)#ip route 192.168.3.0 255.255.255.0 10.0.0.2 SW2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.1
SW1(config)#ip route 192.168.4.0 255.255.255.0 10.0.0.2 SW2(config)#ip route 192.168.2.0 255.255.255.0 10.0.0.1

Innovation • Simplicity • Experience


Example 5 - Routing Aggregation

⚫ Definition of routing aggregation: aggregating multiple contiguous routing entries into a single routing entry
⚫ The role of routing summary: shrink the routing table, reduce the burden on the router, improve the efficiency of the
router forwarding
⚫ Configure only one static routing (no default routing) on R1 and R2 respectively, so that all PCs can communicate with
each other

Gi0/1 172.16.12.0/24

10.0.0.1/30
G0/2 172.16.13.0/24
Gi0/0 Gi0/1
192.168.1.0/24
Gi0/0
10.0.0.2/30
G0/3 172.16.14.0/24
R1
R2

G0/4 172.16.15.0/24

Innovation • Simplicity • Experience


Example 5 - Routing Aggregation

⚫ Configuring the R1 Router


⚫ Summarize 172.16.12.0/24, 172.16.13.0/24, 172.16.14.0/24, 172.16.15.0/24 into 172.16.12.0/22
R1(config)#ip route 172.16.12.0 255.255.255.0 10.0.0.2
R1(config)#ip route 172.16.13.0 255.255.255.0 10.0.0.2
R1(config)#ip route 172.16.12.0 255.255.252.0 10.0.0.2
R1(config)#ip route 172.16.14.0 255.255.255.0 10.0.0.2
R1(config)#ip route 172.16.15.0 255.255.255.0 10.0.0.2

⚫ View the routing table for R1.


R1#show ip route
C 192.168.1.0/24 is directly connected, GigabitEthernet 0/0
C 10.0.0.0/30 is directly connected, GigabitEthernet 0/1 R1#show ip route
S 172.16.12.0/24 [1/0] via 10.0.0.2 C 192.168.1.0/24 is directly connected, GigabitEthernet 0/0
S 172.16.13.0/24 [1/0] via 10.0.0.2 C 10.0.0.0/30 is directly connected, GigabitEthernet 0/1
S 172.16.14.0/24 [1/0] via 10.0.0.2 S 172.16.12.0/22 [1/0] via 10.0.0.2
S 172.16.15.0/24 [1/0] via 10.0.0.2

Innovation • Simplicity • Experience


Example 5 - Restrictions on Routing Aggregation

⚫ Routing aggregation can only be implemented in specific scenarios


➢ Routing aggregation cannot be done on R2 in the following scenarios

The segment summary on R2 for both sides is 172.16.12.0/22

Left? Right?
172.16.12.0/22 172.16.12.0/22

10.0.0.1/30 10.0.0.2/30 10.0.0.5/30 10.0.0.6/30


172.16.12.0/24 F0/0 F0/1 F0/0 F0/1 F0/0 F0/1 172.16.13.0/24

172.16.14.0/24 172.16.15.0/24
R1 R2 F0/2 R3
Destination IP: 172.16.12.1
PC
192.168.1.100/24
Default gateway: 192.168.1.254

Innovation • Simplicity • Experience


Contents

1. Routing Overview

2. Static Routing

3. Dynamic Routing

Innovation • Simplicity • Experience


Dynamic Routing Protocol

⚫ The main routing protocols in the current network project are: RIP, OSPF, ISIS, BGP
⚫ This is a protocol used by routers to calculate and maintain network routing information, usually with certain algorithms,
and works at the transmitter or application layer BGP RIP OSPF
➢ RIP based on UDP, port number 520 TCP UDP

➢ OSPF based on IP, protocol number 89 IP


Link Layer
➢ BGP based on TCP, port number 179
Physical Layer

⚫ Four main steps in the working mechanism of the routing protocol are:
➢ Neighbor Discovery: Routers discover neighbors in the network by sending broadcast or multicast messages, and establish
neighbor relationships based on specific parameters.
➢ Routing Exchange: Each router sends its own known routing-related information to neighboring routers.
➢ Routing Calculation: Each router runs some algorithm to calculate the final routing table.
➢ Routing Maintenance: Routers maintain neighbor information by periodically sending protocol messages to each other.

Innovation • Simplicity • Experience


Basic Concepts of Dynamic Routing

⚫ Key Metrics for Measuring Routing Protocols


➢ Correctness of Protocol Calculation: The protocol uses algorithms that can calculate the optimal routing and are correct without self-
loop.
➢ Routing Convergence Speed: When the topology of the network has changed, it can quickly sense and update the corresponding
routing information in time.
➢ Protocol Occupied System Overhead: the resource overhead (memory, CPU, network bandwidth) occupied by the protocol itself.
➢ Security of the Protocol itself: The protocol itself is not vulnerable to attacks and has security mechanisms.
➢ Protocol Applicable Network Size: The topology and size of the network in which the protocol can be applied.

Static Routing PK Dynamic Routing Protocol


Advantages: no overhead, simple configuration
Static Routing
Disadvantages: unable to sense topology changes, requires manual maintenance, suitable for networks with simple topology
Advantages: no manual maintenance needed, automatic routing discovery and calculation, suitable for networks with complex
Dynamic Routing
topology
Protocol
Disadvantages: high device resource overhead, difficult to command

Innovation • Simplicity • Experience


Classification of Dynamic Routing Protocol

⚫ Classification According to Management Scope


➢ IGP (Interior Gateway Protocol): RIP, EIGRP, OSPF, IS-IS (common protocols for campus networks)
➢ EGP (External Gateway Protocol): BGP (mainly used in finance, government networks, carrier networks)

⚫ Classification by Algorithm
➢ Distance vector routing protocols: RIP, BGP
➢ Link state routing protocols: OSPF, IS-IS

Autonomous System: AS10 Autonomous System: AS20


EGP:BGP

IGP:RIP、OSPF、IS-IS IGP:RIP、OSPF、IS-IS

Innovation • Simplicity • Experience


Distance Vector Routing Protocol

⚫ Routing is announced as a vector (distance, direction)


⚫ Distance vectoring protocols transmit their respective routing table information directly
➢ Each router obtains routing information directly from neighboring routers and sends this routing information, along with its own local
routing information, to its other neighbors
➢ This is passed hop by hop to reach the whole network synchronization. Each router does not understand the entire network
topology
➢ They only know about the networks directly connected to them and update their own routes based on the routing information they
get from their neighbors
Distance = how far?
Vector = in which direction?

routing table routing table


routing table

Innovation • Simplicity • Experience


Link State Routing Protocol

⚫ Shortest Path First (SPF) algorithm based on Dijkstra's algorithm, which is more complex than distance vector routing
protocols
⚫ The router does not pass "routing table entries" directly to the neighbors, but informs them of the link state
⚫ Link state information includes: interface IP address and mask, network type, link overhead, and all neighboring
routers on the link
⚫ Working Process:
➢ Find neighbors running the same protocol and form a neighbor table
➢ Collect link state information of all routers in the region and form a database
➢ Generate network topology based on state information and SPF algorithm
➢ Each router calculates the route based on the topology

SPF algorithm

Topology Shortest Path Priority Tree Routing


Database Table

Innovation • Simplicity • Experience


Summary

⚫ The function of routing: path information to guide network devices for IP message delivery
⚫ The routing table entry contains: routing source, destination address/mask, next hop address, outgoing
interface, metric
⚫ Routing sources: static routings and dynamic routings. Dynamic routing including: RIP, OSPF, ISIS and
BGP.
⚫ Dynamic routing protocols are usually divided into distance vector type routing protocols and link state
type routing protocols according to their algorithms

Innovation • Simplicity • Experience


Ruijie Technical Support Portal:
https://www.ruijienetworks.com/support

Online Technical Support (Rita):


Ruijie Online https://www.ruijienetworks.com/rita

Service Channel Community:


https://community.ruijienetworks.com

Facebook (Ruijie Tech Support):


https://www.facebook.com/ruijietac

YouTube (Ruijie Technical Support):


https://www.youtube.com/c/RuijieTechnicalSupport
THANKS

You might also like