Upload
pumaruna
View
216
Download
0
Embed Size (px)
Citation preview
8/17/2019 IP Routing Volume Organization
1/11
IP Routing Volume Organization
Manual Version
6W100-20090626
Product Version
Release 1102
Organization
The IP Routing Volume is organized as follows:
Features Description
IP Routing Overview
This document describes:
Introduction to IP routing and routing table
Routing protocol overview
Static Routing
A static route is manually configured by the administrator. The properconfiguration and usage of static routes can improve networkperformance and ensure bandwidth for important network applications.This document describes:
Static route configuration
Detecting Reachability of the Static Route’s Nexthop
8/17/2019 IP Routing Volume Organization
2/11
i
Table of Contents
1 IP Routing Overview··································································································································1-1
IP Routing and Routing Table·················································································································1-1
Routing ············································································································································1-1
Routing Table ··································································································································1-1
Displaying and Maintaining a Routing Table···························································································1-3
8/17/2019 IP Routing Volume Organization
3/11
1-1
1 IP Routing Overview
Go to these sections for information you are interested in:
IP Routing and Routing Table
Displaying and Maintaining a Routing Table
The term “router” in this document refers to a router in a generic sense or a Layer 3 switch.
IP Routing and Routing Table
Routing
Routing in the Internet is achieved through routers. Upon receiving a packet, a router finds an optimal
route based on the destination address and forwards the packet to the next router in the path until the
packet reaches the last router, which forwards the packet to the intended destination host.
Routing Table
Routing table
Routing tables play a key role in routing. Each router maintains a routing table, and each entry in the
table specifies which physical interface a packet destined for a certain destination should go out to
reach the next hop (the next router) or the directly connected destination.
Routes in a routing table can be divided into three categories by origin:
Direct routes: Routes discovered by data link protocols, also known as interface routes.
Static routes: Routes that are manually configured.
Dynamic routes: Routes that are discovered dynamically by routing protocols.
Contents of a routing table
A routing table includes the following key items:
Destination address: Destination IP address or destination network.
Network mask: Specifies, in company with the destination address, the address of the destination
network. A logical AND operation between the destination address and the network mask yields
the address of the destination network. For example, if the destination address is 129.102.8.10 and
the mask 255.255.0.0, the address of the destination network is 129.102.0.0. A network mask is
8/17/2019 IP Routing Volume Organization
4/11
1-2
made of a certain number of consecutive 1s. It can be expressed in dotted decimal format or by the
number of the 1s.
Outbound interface: Specifies the interface through which the IP packets are to be forwarded.
IP address of the next hop: Specifies the address of the next router on the path. If only the
outbound interface is configured, its address will be the IP address of the next hop.
Priority for the route. Routes to the same destination but having different nexthops may have
different priorities and be found by various routing protocols or manually configured. The optimalroute is the one with the highest priority (with the smallest metric).
Routes can be divided into two categories by destination:
Subnet routes: The destination is a subnet.
Host routes: The destination is a host.
Based on whether the destination is directly connected to a given router, routes can be divided into:
Direct routes: The destination is directly connected to the router.
Indirect routes: The destination is not directly connected to the router.
To prevent the routing table from getting too large, you can configure a default route. All packets without
matching any entry in the routing table will be forwarded through the default route.
In Figure 1-1, the IP address on each cloud represents the address of the network. Router G is
connected to three networks and therefore has three IP addresses for its three physical interfaces. Its
routing table is shown under the network topology.
Figure 1-1 A sample routing table
Router A
Router B
Router H
Router E
16.0.0.2
17.0.0.3
15.0.0.0 12.0.0.0
17.0.0.0
11.0.0.016.0.0.0
13.0.0.0
14.0.0.0
Router C
Router D
Router F
Router G
11.0.0.1
12.0.0.1
12.0.0.215.0.0.1
15.0.0.2
17.0.0.1
16.0.0.1
13.0.0.1
13.0.0.2
14.0.0.1
14.0.0.2
14.0.0.3
14.0.0.4
17.0.0.2
11.0.0.2
13.0.0.3
Destination Network Nexthop Interface11.0.0.0 11.0.0.1 212.0.0.0 12.0.0.1 113.0.0.0 12.0.0.2 114.0.0.0 14.0.0.4 3
15.0.0.0 14.0.0.2 316.0.0.0 14.0.0.2 317.0.0.0 11.0.0.2 2
8/17/2019 IP Routing Volume Organization
5/11
1-3
Displaying and Maintaining a Routing Table
To do… Use the command… Remarks
Display brief information aboutthe active routes in the routingtable
display ip routing-table [ verbose | | { begin | exclude | include }regular-expression ]
Available in any view
Display information aboutroutes to the specifieddestination
display ip routing-table ip-address [ mask-length | mask ][ longer-match ] [ verbose ]
Available in any view
Display information aboutroutes with destinationaddresses in the specifiedrange
display ip routing-table ip-address1 { mask-length | mask } ip-address2 { mask-length | mask } [ verbose ]
Available in any view
Display information aboutroutes permitted by an IPv4basic ACL
display ip routing-table acl acl-number [ verbose ]
Available in any view
Display routing information
permitted by an IPv4 prefix list
display ip routing-table ip-prefix
ip-prefix-name [ verbose ] Available in any view
Display routes of a routingprotocol
display ip routing-table protocolprotocol [ inactive | verbose ]
Available in any view
Display statistics about therouting table
display ip routing-table statistics Available in any view
Clear statistics for the routingtable
reset ip routing-table statisti csprotocol { all | protocol }
Available in user view
8/17/2019 IP Routing Volume Organization
6/11
i
Table of Contents
1 Static Routing Configuration ····················································································································1-1
Introduction ·············································································································································1-1
Static Route ·····································································································································1-1
Default Route···································································································································1-1
Application Environment of Static Routing ······················································································1-2
Configuring a Static Route······················································································································1-2
Configuration Prerequisites ·············································································································1-2
Configuration Procedure··················································································································1-2
Displaying and Maintaining Static Routes·······························································································1-3
Static Route Configuration Example·······································································································1-3
Basic Static Route Configuration Example······················································································1-3
8/17/2019 IP Routing Volume Organization
7/11
1-1
1 Static Routing Configuration
When configuring a static route, go to these sections for information you are interested in:
Introduction
Configuring a Static Route
Displaying and Maintaining Static Routes
Static Route Configuration Example
The term “router” in this document refers to a router in a generic sense or a Layer 3 switch.
Introduction
Static Route
A static route is a manually configured. If a network’s topology is simple, you only need to configure
static routes for the network to work normally. The proper configuration and usage of static routes can
improve network performance and ensure bandwidth for important network applications.
The disadvantage of using static routes is that they cannot adapt to network topology changes. If a fault
or a topological change occurs in the network, the routes will be unreachable and the network breaks. In
this case, the network administrator has to modify the static routes manually.
Default Route
If the destination address of a packet fails to match any entry in the routing table, the packet will be
discarded.
After a default route is configured on a router, any packet whose destination IP address matches noentry in the routing table can be forwarded to a designated upstream router.
A router selects the default route only when it cannot find any matching entry in the routing table.
If the destination address of a packet fails to match any entry in the routing table, the router selects
the default route to forward the packet.
If there is no default route and the destination address of the packet fails to match any entry in the
routing table, the packet will be discarded and an ICMP packet will be sent to the source to report
that the destination or the network is unreachable.
The network administrator can configure a default route with both destination and mask being 0.0.0.0.
The router forwards any packet whose destination address fails to match any entry in the routing tableto the next hop of the default static route.
8/17/2019 IP Routing Volume Organization
8/11
1-2
Appl ication Environment of Stat ic Routing
Before configuring a static route, you need to know the following concepts:
1) Destination address and mask
In the ip route-static command, an IPv4 address is in dotted decimal format and a mask can be either
in dotted decimal format or in the form of mask length (the digits of consecutive 1s in the mask).
2) Output interface and next hop address
While configuring a static route, you can specify either the output interface or the next hop address
depending on the specific occasion. The next hop address can not be a local interface IP address;
otherwise, the route configuration will not succeed.
In fact, all the route entries must have a next hop address. When forwarding a packet, a router first
searches the routing table for the route to the destination address of the packet. The system can find the
corresponding link layer address and forward the packet only after the next hop address is specified.
When specifying the output interface, note that:
If the output interface is a Null 0, there is no need to configure the next hop address. If the output interface is a VLAN interface or a management Ethernet port (M-GigabitEthernet), you
must specify the corresponding next hop for the output interface.
3) Other attributes
You can configure different preferences for different static routes so that route management policies can
be applied more flexibly. For example, specifying the same preference for different routes to the same
destination enables load sharing, while specifying different preferences for these routes enables route
backup.
Configuring a Static RouteConfiguration Prerequisites
Before configuring a static route, you need to finish the following tasks:
Configure the physical parameters for related interfaces
Configure the link-layer attributes for related interfaces
Configure the IP addresses for related interfaces
Configuration Procedure
Follow these steps to configure a static route:
To do… Use the command… Remarks
Enter system view system-view —
Configure a staticroute
ip route-static dest-address { mask | mask-length }{ next-hop-address | interface-type interface-numbernext-hop-address } track track-entry-number[ preference preference-value ] [ descriptiondescription-text ]
Required
By default,preference forstatic routes is 60, and no descriptioninformation isconfigured.
Configure the defaultpreference for staticroutes
ip route-static default-preference default-preference-value
Optional
60 by default
8/17/2019 IP Routing Volume Organization
9/11
1-3
When configuring a static route, the static route does not take effect if you specify the next hop
address first and then configure it as the IP address of a local interface, such as VLAN interface.
If you do not specify the preference when configuring a static route, the default preference will beused. Reconfiguring the default preference applies only to newly created static routes.
If the destination IP address and mask are both configured as 0.0.0.0 with the ip route-static
command, the route is the default route.
For detailed information about track, refer to Track Configuration in the System Volume.
Displaying and Maintaining Static Routes
To do… Use the command… Remarks
Display the currentconfiguration information
display current-configuration
Display the brief information ofthe IP routing table
display ip rou ting-table
Display the detailedinformation of the IP routingtable
display ip routing-table verbose
View information of staticroutes
display ip routing-table protocol static [ inactive | verbose ]
Available in anyview
Delete all the static routes delete static-routes all Available Insystem view
Static Route Configuration Example
Basic Static Route Configuration Example
Network requirements
The IP addresses and masks of the switches and hosts are shown in the following figure. Static routes
are required for interconnection between any two hosts.
8/17/2019 IP Routing Volume Organization
10/11
1-4
Figure 1-1 Network diagram for static route configuration
Configuration procedure
1) Configuring IP addresses for interfaces (omitted)2) Configuring static routes
# Configure a default route on Switch A.
sys t em- vi ew
[ Swi t chA] i p rout e- st at i c 0. 0. 0. 0 0. 0. 0. 0 1. 1. 4. 2
# Configure two static routes on Switch B.
sys t em- vi ew
[ Swi t chB] i p r out e- st at i c 1. 1. 2. 0 255. 255. 255. 0 1. 1. 4. 1
[ Swi t chB] i p r out e- st at i c 1. 1. 3. 0 255. 255. 255. 0 1. 1. 5. 6
# Configure a default route on Switch C
sys t em- vi ew
[ Swi t chC] i p rout e- st at i c 0. 0. 0. 0 0. 0. 0. 0 1. 1. 5. 5
3) Configure the hosts.
The default gateways for the three hosts A, B and C are 1.1.2.3, 1.1.6.1 and 1.1.3.1 respectively. The
configuration procedure is omitted.
4) Display the configuration.
# Display the IP routing table of Switch A.
[ Swi t chA] di spl ay i p r out i ng- t abl e
Rout i ng Tabl es: Publ i c
Desti nati ons : 7 Rout es : 7
Dest i nat i on/ Mask Proto Pre Cost Next Hop I nter f ace
0. 0. 0. 0/ 0 St at i c 60 0 1. 1. 4. 2 Vl an500
1. 1. 2. 0/ 24 Di r ect 0 0 1. 1. 2. 3 Vl an300
1. 1. 2. 3/ 32 Di r ect 0 0 127. 0. 0. 1 I nLoop0
1. 1. 4. 0/ 30 Di r ect 0 0 1. 1. 4. 1 Vl an500
1. 1. 4. 1/ 32 Di r ect 0 0 127. 0. 0. 1 I nLoop0
127. 0. 0. 0/ 8 Di r ect 0 0 127. 0. 0. 1 I nLoop0
8/17/2019 IP Routing Volume Organization
11/11
1-5
127. 0. 0. 1/ 32 Di r ect 0 0 127. 0. 0. 1 I nLoop0
# Display the IP routing table of Switch B.
[ Swi t chB] di spl ay i p r out i ng- t abl e
Rout i ng Tabl es: Publ i c
Desti nati ons : 10 Rout es : 10
Dest i nat i on/ Mask Proto Pre Cost Next Hop I nter f ace
1. 1. 2. 0/ 24 St at i c 60 0 1. 1. 4. 1 Vl an500
1. 1. 3. 0/ 24 St at i c 60 0 1. 1. 5. 6 Vl an600
1. 1. 4. 0/ 30 Di r ect 0 0 1. 1. 4. 2 Vl an500
1. 1. 4. 2/ 32 Di r ect 0 0 127. 0. 0. 1 I nLoop0
1. 1. 5. 4/ 30 Di r ect 0 0 1. 1. 5. 5 Vl an600
1. 1. 5. 5/ 32 Di r ect 0 0 127. 0. 0. 1 I nLoop0
127. 0. 0. 0/ 8 Di r ect 0 0 127. 0. 0. 1 I nLoop0
127. 0. 0. 1/ 32 Di r ect 0 0 127. 0. 0. 1 I nLoop01. 1. 6. 0/ 24 Di r ect 0 0 192. 168. 1. 47 Vl an100
1. 1. 6. 1/ 32 Di r ect 0 0 127. 0. 0. 1 I nLoop0
# Use the ping command on Host B to check reachability to Host A, assuming Windows XP runs on the
two hosts.
C: \ Document s and Set t i ngs\ Admi ni st r ator>pi ng 1. 1. 2. 2
Pi ngi ng 1. 1. 2. 2 wi t h 32 bytes of data:
Repl y f r om 1. 1. 2. 2: bytes=32 t i me=1ms TTL=255Repl y f r om 1. 1. 2. 2: bytes=32 t i me=1ms TTL=255
Repl y f r om 1. 1. 2. 2: bytes=32 t i me=1ms TTL=255
Repl y f r om 1. 1. 2. 2: bytes=32 t i me=1ms TTL=255
Pi ng stat i st i cs for 1. 1. 2. 2:
Packet s: Sent = 4, Recei ved = 4, Lost = 0 ( 0% l oss) ,
Appr oxi mat e r ound t r i p t i mes i n mi l l i - seconds:
Mi ni mum = 1ms, Maxi mum = 1ms, Aver age = 1ms
# Use the tracert command on Host B to check reachability to Host A.[ Host B] t r acert 1. 1. 2. 2
Traci ng r oute t o 1. 1. 2. 2 over a maxi mum of 30 hops
1