10.routing Basics - IP Route Selection Principles (Part I)
10.routing Basics - IP Route Selection Principles (Part I)
d Route Summarization
www.huawei.com
Route Summarization
Routing and Routes
IP header Data
GE 0/0/1
GE 0/0/0
192.168.10.0/24 172.16.1.0/24
Routing table
Destination Net Outbound Interfac
Protocol Next Hop
work/Mask e
192.168.10.0/24 Direct 192.168.10.254 GE 0/0/0
• Initially, the network segments known to a router are its directly connected network segments. The rout
er automatically adds the routes to these direct network segments to its routing table. These routes are
called direct routes, with Protocol being Direct in the routing table.
• Direct routes exist in the routing table only when the physical status and protocol status of the correspo
nding interface are both Up.
GE 0/0/1
192.168.12.0/24
GE 0/0/0
192.168.1.0/24
Destination Net
Protocol Next Hop Outbound Interface
work/Mask
192.168.10.2
192.168.1.0/24 Direct GE 0/0/0
54
192.168.12.0/24 Direct 192.168.12.1 GE 0/0/1
• Direct routes: generated through the network segments directly connected to interfaces
• Static routes: manually configured by the network administrator
• Dynamic routes: discovered by dynamic routing protocols
GE 0/0/0 GE 0/0/1
192.168.12.1/24 192.168.23.1/24
GE 0/0/0 GE 0/0/0
R1 192.168.12.2/24 R2 192.168.23.2/24 R3
GE 0/0/0
192.168.12.1/24 GE 0/0/1
192.168.23.1/24
GE 0/0/0 GE 0/0/0
R1 192.168.12.2/24 R2 192.168.23.2/24 R3
If the link connected to GE0/0/0 on R1 fails, the physical status of GE0/0/0 becomes D
own. As a result, the direct route on GE0/0/0 disappears in the routing table.
GE 0/0/0 GE 0/0/1
192.168.12.1/24 192.168.23.1/24
GE 0/0/0 GE 0/0/0
R1 192.168.12.2/24 R2 192.168.23.2/24 R3
Route Summarization
What Are Static Routes?
192.168.100.0/24
R2
GE 0/0/0
192.168.1.1/24 192.168.1.254 R1
Gateway: 192.168.1.254
192.168.200.0/24
/2 4
0 0.0
.1
68
9 2.1 192.168.100.0/24
1
to
th
Pa R2
GE 0/0/0
192.168.1.1/24 192.168.1.254 R1
Gateway: 192.168.1.254 Pa
th
to 192.168.200.0/24
19
2.1
68 R3
.20
0 .0
One simple solution is to config /2 4
ure static routes on R1 for pack
et forwarding.
Examples:
GE0/0/0 GE0/0/1
192.168.12.1/24 192.168.23.1/24
GE0/0/0 GE0/0/0
R1 192.168.12.2/24 R2 192.168.23.2/24 R3
Note:
•Communication requires round-trip routes.
•Packets are forwarded hop by hop. Each hop along the forwarding path must have a ro
ute to the destination.
GE 0/0/0 GE 0/0/1
192.168.12.1/24 192.168.23.1/24
GE 0/0/0 GE 0/0/0
R1 192.168.12.2/24 R2 192.168.23.2/24 R3
192.168.100.0/24
192.168.12.1 192.168.101.0/24
192.168.102.0/24
192.168.12.2
192.168.103.0/24
R1 R2 ...
192.168.100.0/24
192.168.12.1 192.168.101.0/24
192.168.102.0/24
192.168.12.2
192.168.103.0/24
R1 R2 ...
• A default route is a static route with the destination IP address/mask being 0.0.0.0/
0.0.0.0 or 0.0.0.0/0.
• This kind of route can match any IP addresses. The local device depends on the de
fault gateway or the next hop of the default route for packet forwarding.
• If the destination address of a packet matches a non-default route in the routing
table of a device, the device forwards the packet along the non-default route. If the
destination address does not match any non-default route, the device forwards the
packet along the default route. If the destination address does not match any non-
default route and no default route is available, the device discards the packet.
• Common commands:
• ping: used to test network connectivity
• tracert: used to test the reachability of each node along the path to a destination
node
• display ip routing-table: used to check the routing table
• display ip interface brief: used to check brief interface information
R1 GE 0/0/0 R2 GE 0/0/1 R3
192.168.12.1/24 192.168.23.2/24
GE 0/0/0 GE 0/0/0
192.168.12.2/24 192.168.23.3/24
Loopback0 Loopback0
1.1.1.1/24 2.2.2.2/24
• Loopback interfaces are logical. To create a loopback interface, run the interfac
e loopback loopback-number command in the system view. After the loopback
interface is created, you can configure an IP address for it.
• Loopback interfaces never go Down unless the shutdown command is run on t
hem. Therefore, they are highly stable.
• Loopback interfaces are commonly used:
• To simulate direct network segments for tests
• For device management, due to their high stability
• IP addresses used as router IDs of some protocols, such as OSPF, BGP, a
nd MPLS
• IP addresses used as source IP addresses of SNMP trap messages
• For various other purposes
R1 GE 0/0/0 R2 GE 0/0/1 R3
192.168.12.1/24 192.168.23.2/24
GE 0/0/0 GE 0/0/0
192.168.12.2/24 192.168.23.3/24
Loopback0 Loopback0
1.1.1.1/24 2.2.2.2/24
Interface configurations on R1
<Router> system-view
[Router] sysname R1
[R1] interface GigabitEthernet0/0/0
[R1-GigabitEthernet0/0/0] ip address 192.168.12.1 24
[R1-GigabitEthernet0/0/0] quit
[R1] interface loopback0
[R1-LoopBack0] ip address 1.1.1.1 24
[R1-LoopBack0] quit
[R1] ip route-static 192.168.23.0 24 192.168.12.2
[R1] ip route-static 2.2.2.0 24 192.168.12.2
R1 GE 0/0/0 R2 GE 0/0/1 R3
192.168.12.1/24 192.168.23.2/24
GE 0/0/0 GE 0/0/0
192.168.12.2/24 192.168.23.3/24
Loopback0 Loopback0
1.1.1.1/24 2.2.2.2/24
Interface configurations on R2
<Router> system-view
[Router] sysname R2
[R2] interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0] ip address 192.168.12.2 24
[R2-GigabitEthernet0/0/0] quit
[R2] interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] ip address 192.168.23.2 24
[R2-GigabitEthernet0/0/1] quit
[R2] ip route-static 1.1.1.0 24 192.168.12.1
[R2] ip route-static 2.2.2.0 24 192.168.23.3
R1 GE 0/0/0 R2 GE 0/0/1 R3
192.168.12.1/24 192.168.23.2/24
GE 0/0/0 GE 0/0/0
192.168.12.2/24 192.168.23.3/24
Loopback0 Loopback0
1.1.1.1/24 2.2.2.2/24
Interface configurations on R3
<Router> system-view
[Router] sysname R3
[R3] interface GigabitEthernet0/0/0
[R3-GigabitEthernet0/0/0] ip address 192.168.23.3 24
[R3-GigabitEthernet0/0/0] quit
[R3] interface loopback0
[R3-LoopBack0] ip address 2.2.2.2 24
[R3-LoopBack0] quit
[R3] ip route-static 192.168.12.0 24 192.168.23.2
[R3] ip route-static 1.1.1.0 24 192.168.23.2
--- 2.2.2.2 ping statistics --- By default, the source IP address of the IC
5 packet(s) transmitted MP packets is the IP address (192.168.12.1
5 packet(s) received ) of the outbound interface.
0.00% packet loss
round-trip min/avg/max = 20/20/20 ms
Ping 2.2.2.2 on R1, with 1.1.1.1 as the source IP address of ICMP packets.
--- 2.2.2.2 ping statistics --- In the ping -a command, you can speci
5 packet(s) transmitted fy a local IP address as the source IP a
5 packet(s) received ddress of ICMP packets.
0.00% packet loss
round-trip min/avg/max = 20/22/30 ms
R1 GE 0/0/0 R2 GE 0/0/1 R3
192.168.12.1/24 192.168.23.2/24
GE 0/0/0 GE 0/0/0
192.168.12.2/24 192.168.23.3/24
Loopback0 Loopback0
1.1.1.1/24 2.2.2.2/24
1 192.168.12.2 30 ms 10 ms 1 ms
2 192.168.23.3 10 ms 20 ms 10 ms
Route Summarization
Route Summarization
172.16.1.0/24
GE 0/0/1
192.168.12.1/24
172.16.2.0/24
GE 0/0/1
R1 192.168.12.2/24 R2
172.16.3.0/24
172.16.1.0/24
GE 0/0/1
192.168.12.1/24
172.16.2.0/24
GE 0/0/1
R1 192.168.12.2/24 R2
172.16.3.0/24
172 16 0 0
172.16.1.0/24 1 0 1 011 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
172.16.2.0/24 1 0 1 011 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
172.16.3.0/24 1 0 1 011 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0
…… /19
172.16.30.0/24 1 0 1 011 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0
172.16.31.0/24 1 0 1 011 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0