0% found this document useful (0 votes)
126 views37 pages

10.routing Basics - IP Route Selection Principles (Part I)

The document discusses route selection rules, static routes, and route summarization. It describes the basic principles of IP routing and how routers forward data. It also explains concepts like static routes, direct routes, and how to configure static routes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views37 pages

10.routing Basics - IP Route Selection Principles (Part I)

The document discusses route selection rules, static routes, and route summarization. It describes the basic principles of IP routing and how routers forward data. It also explains concepts like static routes, direct routes, and how to configure static routes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 37

Route Selection Rules, Static Routes, an

d Route Summarization

www.huawei.com

Author/ Email: Zhu Shigeng (employee ID: 261992) /[email protected]


Version: V1.1

HUAWEI TECHNOLOGIES CO., LTD.


Objectives

• Upon completion of this course, you will be able to:


• Describe the basic principles of IP routing.
• Know the basic principles according to which routers forward data.
• Describe the concept of static routes and configure static routes.
• Understand the concept of route summarization.

HUAWEI TECHNOLOGIES CO., LTD. Page 2


Contents

Route Selection Rules

Concepts and Configurations of Static Routes

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

192.168.12.0/24 Direct 192.168.12.1 GE 0/0/1

192.168.13.0/24 Direct 192.168.13.1 GE 0/0/2

172.16.1.0/24 Static 192.168.12.2 GE 0/0/1

HUAWEI TECHNOLOGIES CO., LTD. Page 4


What Does a Router Do?

• Discovers routes to network segments.


• Selects the optimal route.
• Maintains routes in its routing table.
• Forwards data packets.

HUAWEI TECHNOLOGIES CO., LTD. Page 5


IP Routing Table

• 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

HUAWEI TECHNOLOGIES CO., LTD. Page 6


Checking the Routing Table Using the display ip routin
g-table Command
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 9 Routes : 9
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.0/24 Static 60 0 RD 10.1.12.2 GigabitEthernet0/0/0
10.1.12.0/24 Direct 0 0 D 10.1.12.1 GigabitEthernet0/0/0
10.1.12.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
10.1.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
22.22.22.22/32 OSPF 10 1 D 10.1.12.2 GigabitEthernet0/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
Route Prefix Protocol Priority Cost Flags Next Hop Outbound Interface

HUAWEI TECHNOLOGIES CO., LTD. Page 7


How Routes Are Obtained

• 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

HUAWEI TECHNOLOGIES CO., LTD. Page 8


Direct Routes

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

[R1] display ip routing-table


Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.12.0/24 Direct 0 0 D 192.168.12.1 GigabitEthernet0/0/0

A direct route is automatically generated through network segments


Direct route directly connected to an interface as long as the physical status and
protocol status of the interface are both Up. To check the physical st
atus and protocol status, run the display ip interface brief comman
d.

HUAWEI TECHNOLOGIES CO., LTD. Page 9


Direct Routes

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.

HUAWEI TECHNOLOGIES CO., LTD. Page 10


Direct Routes

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.12.2 is reachable to R1 beca


use R2 is reachable through a direct r
oute.

By default, R1 cannot communicate with R3 because R1 has n


o route to the 192.168.23.0/24 network segment. R3 also has
no route to R1.

HUAWEI TECHNOLOGIES CO., LTD. Page 11


Contents

Route Selection Rules

Concepts and Configurations of Static Routes

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

To access an external network, R3


the PC sends data to its gatewa
y (R1). However, R1 has routes
only to its directly connected net
work segments.

HUAWEI TECHNOLOGIES CO., LTD. Page 13


What Are Static Routes?

/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.

HUAWEI TECHNOLOGIES CO., LTD. Page 14


Configuring Static Routes
• To configure a static route with a next-hop IP address, run the following command:

[Router] ip route-static ip-address {mask | mask-length } { nexthop-address }


• To configure a static route with an outbound interface, run the following command:

[Router] ip route-static ip-address { mask | mask-length } interface-type interface-number


• To configure a static route with an outbound interface and a next-hop IP address, run the following command:
[Router] ip route-static ip-address { mask | mask-length } interface-type interface-number [ nexthop-address ]

Examples:

[R1] ip route-static 192.168.100.0 255.255.255.0 192.168.12.2


[R1] ip route-static 192.168.100.0 24 192.168.12.2

HUAWEI TECHNOLOGIES CO., LTD. Page 15


Static Route Configuration Example

[R1] ip route-static 192.168.23.0 24 192.168.12.2

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

[R3] ip route-static 192.168.12.0 24 192.168.23.1

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.

HUAWEI TECHNOLOGIES CO., LTD. Page 16


Static Route Configuration Example

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

[R1] display ip routing-table


Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.12.0/24 Direct 0 0 D 192.168.12.1 GigabitEthernet0/0/0
192.168.23.0/24 Static 60 0 RD 192.168.12.2 GigabitEthernet0/0/0

HUAWEI TECHNOLOGIES CO., LTD. Page 17


Default Route
The routing table on R1 contains a large
number of specific routes. R1 does not
need to know this many specific routes,
because it has only one outbound interface
to the external network.

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 ...

[R1] ip route-static 192.168.100.0 24 192.168.12.2


[R1] ip route-static 192.168.101.0 24 192.168.12.2
[R1] ip route-static 192.168.102.0 24 192.168.12.2
[R1] ip route-static 192.168.103.0 24 192.168.12.2
...

HUAWEI TECHNOLOGIES CO., LTD. Page 18


Default Route

Configure a default route on R1.

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 ...

[R1] ip route-static 0.0.0.0 0.0.0.0 192.168.12.2


or
[R1] ip route-static 0.0.0.0 0 192.168.12.2

HUAWEI TECHNOLOGIES CO., LTD. Page 19


Default Route

• 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.

HUAWEI TECHNOLOGIES CO., LTD. Page 20


Troubleshooting and Information Query

• 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

HUAWEI TECHNOLOGIES CO., LTD. Page 21


Experiment

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

• Configure the three routers to allow 1.1.1.1 to access 2.2.2.2.


• 1.1.1.1/24 and 2.2.2.2/24 are IP addresses of loopback interfaces.

HUAWEI TECHNOLOGIES CO., LTD. Page 22


Loopback Interfaces

• 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

HUAWEI TECHNOLOGIES CO., LTD. Page 23


Configurations for the Experiment

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

HUAWEI TECHNOLOGIES CO., LTD. Page 24


Configurations for the Experiment

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

HUAWEI TECHNOLOGIES CO., LTD. Page 25


Configurations for the Experiment

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

HUAWEI TECHNOLOGIES CO., LTD. Page 26


Test and Verification

Ping 2.2.2.2 on R1.

[R1] ping 2.2.2.2


PING 2.2.2.2: 56 data bytes, press CTRL_C to break
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=254 time=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=254 time=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=254 time=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=254 time=20 ms

--- 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

HUAWEI TECHNOLOGIES CO., LTD. Page 27


Test and Verification

Ping 2.2.2.2 on R1, with 1.1.1.1 as the source IP address of ICMP packets.

[R1] ping -a 1.1.1.1 2.2.2.2


PING 2.2.2.2: 56 data bytes, press CTRL_C to break
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=254 time=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=254 time=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=254 time=20 ms

--- 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

HUAWEI TECHNOLOGIES CO., LTD. Page 28


Test and Verification

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

The tracert command tests the reachability of eac


Run the tracert 2.2.2.2 command on R1. h node along the path to a destination node. You
can check the packet forwarding path based on th
[R1] tracert 2.2.2.2 e command output.

traceroute to 2.2.2.2(2.2.2.2), max hops: 30 ,packet length: 40,press CTRL_C


to break

1 192.168.12.2 30 ms 10 ms 1 ms
2 192.168.23.3 10 ms 20 ms 10 ms

HUAWEI TECHNOLOGIES CO., LTD. Page 29


Contents

Route Selection Rules

Concepts and Configurations of Static Routes

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

Ip route-static 172.16.1.0 24 192.168.12.2


Ip route-static 172.16.2.0 24 192.168.12.2
Ip route-static 172.16.3.0 24 192.168.12.2

If a specific route is configured for each remote


network segment, the routing table may contain a
large number of routes, which increases the burden
on the device.

HUAWEI TECHNOLOGIES CO., LTD. Page 31


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

Ip route-static 172.16.1.0 24 192.168.12.2


Specific routes Ip route-static 172.16.2.0 24 192.168.12.2
Ip route-static 172.16.3.0 24 192.168.12.2

Summary route Ip route-static 172.16.0.0 16 192.168.12.2

HUAWEI TECHNOLOGIES CO., LTD. Page 32


Route Summarization

• Route summarization (also called route aggregation or route summary)


summarizes multiple routes with a specified characteristic or set of characteristics
into a single route. This reduces the size of the routing table and improves device
resource utilization.
• Route summarization optimizes networks, reduces route count, and facilitates netw
ork management. We need to take route summarization into consideration during n
etwork design and deployment.
• Route summarization applies to static and dynamic routes.

HUAWEI TECHNOLOGIES CO., LTD. Page 33


Summary Routes of Finer Granularity

Summary route: 172.16.0.0/16, w


ith R1 as the next hop
172.16.1.0/24 172.16.32.0/24
172.16.2.0/24 172.16.33.0/24
…… ……
172.16.31.0/24 R1 R2 R3 172.16.63.0/24

This summary route has a pretty coarse granularity because its


network segment also includes the network segments connected to
R3. As a result, packets destined for these network segments may
be forwarded to R1.

HUAWEI TECHNOLOGIES CO., LTD. Page 34


Summary Routes of Finer Granularity

Summary route: 172.16.0.0/19, wSummary route: 172.16.32.0/19,


ith R1 as the next hop with R3 as the next hop
172.16.1.0/24 172.16.32.0/24
172.16.2.0/24 172.16.33.0/24
…… 192.168.12.1 192.168.23.3 ……
172.16.31.0/24 R1 R2 R3 172.16.63.0/24

Ip route-static 172.16.0.0 19 192.168.12.1


Ip route-static 172.16.32.0 19 192.168.23.3

HUAWEI TECHNOLOGIES CO., LTD. Page 35


Calculation of the Summary Route of the Finest Granular
ity
• Specific routes: 172.16.1.0/24 to 172.16.31.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

HUAWEI TECHNOLOGIES CO., LTD. Page 36


Thank you
www.huawei.com

You might also like