HCNP-IERN
Huawei Certification
HCNP-IERN Implementing Enterprise Routing Network Lab Guide
Huawei Technologies Co.,Ltd
HUAWEI TECHNOLOGIES
HCNP-IERN
Copyright © Huawei Technologies Co., Ltd. 2010. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any means without prior written consent of Huawei Technologies Co., Ltd. Trademarks and Permissions
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd. All other trademarks and trade names mentioned in this document are the property of their respective holders. Notice
The information in this document is subject to change without notice. Every effort has been made in the preparation of this document to ensure accuracy of the contents, but all statements, information, and recommendations in this document do not constitute the warranty of any kind, expressed or implied.
Huawei Certification HCNP-IERN Implementing Enterprise Routing Network Lab Guide
Edition 1.6
HUAWEI TECHNOLOGIES
HCNP-IERN
Huawei Certification System Relying on its strong technical and professional training system, in accordance with different customers at different levels of ICT technology, Huawei certification is committed to provide customs with authentic, professional certification. Based on characteristics of ICT technologies and customers’needs at different levels, Huawei certification provides customers with certification system of four levels. HCNA (Huawei Certified Network Associate) is primary for IP network maintenance engineers, and any others who want to build an understanding of the IP network. HCNA certification covers the TCP/IP basics, routing, switching and other common foundational knowledge of IP networks, together with Huawei communications products, versatile routing platform VRP characteristics and basic maintenance. HCNP-Enterprise (Huawei Certified Network Professional-Enterprise) is aimed at enterprise-class network maintenance engineers, network design engineers, and any others who want to grasp in depth routing, switching, network adjustment and optimization technologies. HCNP-Enterprise consists of IESN (Implement Enterprise Switch Network), IERN (Implement Enterprise Routing Network), and IENP (Improving Enterprise Network performance), which includes advanced IPv4 routing and switching technology principles, network security, high availability and QoS, as well as the configuration of Huawei products. HCIE-Enterprise (Huawei Certified Internetwork Expert-Enterprise) is designed to endue engineers with a variety of IP technologies and proficiency in the maintenance, diagnostics and troubleshooting of Huawei products, which equips engineers with competence in planning, design and optimization of large-scale IP networks.
HUAWEI TECHNOLOGIES
HCNP-IERN
Referenced icon
Router
L3 Switch
L2 Switch
Firewall
Serial line
Ethernet line
HUAWEI TECHNOLOGIES
Net cloud
HCNP-IERN
Lab environment specification The Lab environment is suggested below:
Identifier
Device
OS version
R1
AR 2220
Version 5.90 ( V200R001C01SPC300)
R2
AR 2220
Version 5.90 ( V200R001C01SPC300)
R3
AR 2220
Version 5.90 ( V200R001C01SPC300)
R4
AR 1220
Version 5.90 ( V200R001C01SPC300)
R5
AR 1220
Version 5.90 ( V200R001C01SPC300)
S1
S5700-28C-EI-24S
Version 5.70 (V100R006C00SPC800)
S2
S5700-28C-EI-24S
Version 5.70 (V100R006C00SPC800)
S3
S3700-28TP-EI-AC
Version 5.70 (V100R006C00SPC800)
S4
S3700-28TP-EI-AC
Version 5.70 (V100R006C00SPC800)
FW1
Eudemon 200E-X2
Version 5.30 (V100R005C00SPC100)
FW2
Eudemon 200E-X2
Version 5.30 (V100R005C00SPC100)
HUAWEI TECHNOLOGIES
HCNP-IERN
CONTENTS Chapter 1 Implementing RIP features ................................................................................................ 1 Lab 1-1 RIPv1 and RIPv2 ................................................................................................................. 1 Chapter 2 Implementing OSPF design structures.............................................................................. 22 Lab 2-1 Single-Area OSPF ............................................................................................................. 22 Lab 2-2 Multi-Area OSPF .............................................................................................................. 43 Lab 2-3 OSPF Adjacency Relationships and Various Types of LSAs................................................ 69 Lab 2-4 OSPF Stub Area and NSSA .............................................................................................. 100 Lab 2-5 OSPF VCs and Inter-Area Route Filtering........................................................................ 124 Lab 2-6 OSPF Troubleshooting.................................................................................................... 149 Lab 2-7 Advanced OSPF Features ............................................................................................... 175 Chapter 3 BGP application and management ................................................................................. 199 Lab 3-1 IBGP and EBGP............................................................................................................... 199 Lab 3-2 BGP Route Aggregation.................................................................................................. 222 Lab 3-3 BGP Attributes and Path Selection 1 .............................................................................. 240 Lab 3-4 BGP Attributes and Path Selection 2 (Optional) ............................................................. 260 Lab 3-5 BGP Multi-homing ......................................................................................................... 278 Lab 3-6 BGP Troubleshooting ..................................................................................................... 305 Lab 3-7 BGP Route Reflector ...................................................................................................... 328 Lab 3-8 BGP Confederation (Optional) ....................................................................................... 352 Chapter 4 Traffic filtering and access control ................................................................................. 375 Lab 4-1 Access Control for Enterprise Data Using an ACL............................................................ 375 Lab 4-2 Route Import and Routing Control ................................................................................. 397 Chapter 5 Implementing multicast technologies ............................................................................ 421 Lab 5-1 Multicast, IGMP, and PIM DM Protocols ........................................................................ 421
HUAWEI TECHNOLOGIES
HCNP-IERN
Lab 5-2 PIM-SM and Dynamic RP ............................................................................................... 444
HUAWEI TECHNOLOGIES
HCNP-IERN
HUAWEI TECHNOLOGIES
HCNP-IERN Chapter 1 Implementing RIP features
Chapter 1 Implementing RIP features Lab 1-1 RIPv1 and RIPv2 Learning Objectives The objectives of this lab are to learn and understand: •
RIPv2 configuration mode
•
RIPv2 summarization mode
•
RIPv2 authentication configuration mode
•
RIPv2 passive interface configuration and effects
•
RIPv2 and RIPv1 compatibility configuration
Topology
Figure 1-1 RIPv1 and RIPv2 HC Series
HUAWEI TECHNOLOGIES
1
HCNP-IERN Chapter 1 Implementing RIP features
Scenario R1, R2, and R3 are connected to the network segment 10.0.123.0/24 through Ethernet switches. R1 and R4 are connected using a serial cable. The entire network uses the RIP protocol. You need to perform the following steps to understand the configuration, route summarization, and authentication configuration of the RIP protocol as well as the RIPv2 and RIPv1 compatibility configuration.
Tasks Step 1 Configure IP addresses. Configure IP addresses for all routers.
system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R1 [R1]interface loopback 0 [R1-LoopBack0]ip address 10.0.1.1 24 [R1-LoopBack0]interface Serial 3/0/0 [R1-Serial3/0/0]ip address 10.0.14.1 24 [R1-Serial3/0/0]interface GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ip address 10.0.123.1 24
system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R2 [R2]interface GigabitEthernet 0/0/0 [R2-GigabitEthernet0/0/0]ip address 10.0.123.2 24 [R2-GigabitEthernet0/0/0]interface loopback 0 [R2-LoopBack0]ip address 10.0.2.2 24
system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R3 [R3]interface GigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ip address 10.0.123.3 24 [R3-GigabitEthernet0/0/0]interface loopback 0 [R3-LoopBack0]ip address 10.0.3.3 24
2
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 1 Implementing RIP features system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R4 [R4]interface serial 1/0/0 [R4-Serial1/0/0]ip address 10.0.14.4 24 [R4-Serial1/0/0]interface loopback 0 [R4-LoopBack0]ip address 10.1.0.1 24 [R4-LoopBack0]interface loopback 1 [R4-LoopBack1]ip address 10.1.1.1 24
After you have configured the IP addresses, test the connectivity between R1 and R2, between R1 and R3, and between R1 and R4. [R1]ping 10.0.123.2 PING 10.0.123.2: 56 data bytes, press CTRL_C to break Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=3 ms Reply from 10.0.123.2: bytes=56 Sequence=2 ttl=255 time=2 ms Reply from 10.0.123.2: bytes=56 Sequence=3 ttl=255 time=2 ms Reply from 10.0.123.2: bytes=56 Sequence=4 ttl=255 time=2 ms Reply from 10.0.123.2: bytes=56 Sequence=5 ttl=255 time=2 ms
--- 10.0.123.2 ping statistics --5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/2/3 ms
[R1]ping 10.0.123.3 PING 10.0.123.3: 56 data bytes, press CTRL_C to break Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=3 ms Reply from 10.0.123.3: bytes=56 Sequence=2 ttl=255 time=2 ms Reply from 10.0.123.3: bytes=56 Sequence=3 ttl=255 time=2 ms Reply from 10.0.123.3: bytes=56 Sequence=4 ttl=255 time=2 ms Reply from 10.0.123.3: bytes=56 Sequence=5 ttl=255 time=2 ms
--- 10.0.123.3 ping statistics --5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/2/3 ms
[R1]ping 10.0.14.4 PING 10.0.14.4: 56 data bytes, press CTRL_C to break
HC Series
HUAWEI TECHNOLOGIES
3
HCNP-IERN Chapter 1 Implementing RIP features Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=42 ms Reply from 10.0.14.4: bytes=56 Sequence=2 ttl=255 time=37 ms Reply from 10.0.14.4: bytes=56 Sequence=3 ttl=255 time=37 ms Reply from 10.0.14.4: bytes=56 Sequence=4 ttl=255 time=37 ms Reply from 10.0.14.4: bytes=56 Sequence=5 ttl=255 time=37 ms
--- 10.0.14.4 ping statistics --5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 37/38/42 ms
Step 2 Configure RIPv2. Configure RIPv2 for all routers and summarization function.
disable the automatic
You can configure a process ID during the RIP configuration. The process ID 1 is used in this lab, however in this case it carries no real function. [R1]rip 1 [R1-rip-1]version 2 [R1-rip-1]network 10.0.0.0 [R1-rip-1]undo summary
[R2]rip 1 [R2-rip-1]version 2 [R2-rip-1]network 10.0.0.0 [R2-rip-1]undo summary
[R3]rip 1 [R3-rip-1]version 2 [R3-rip-1]network 10.0.0.0 [R3-rip-1]undo summary
[R4]rip 1 [R4-rip-1]version 2 [R4-rip-1]network 10.0.0.0 [R4-rip-1]undo summary
4
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 1 Implementing RIP features
After you have configured RIPv2, check the routing table of R2 and test the connectivity between R2 and R4. [R2]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 5
Routes : 5
RIP routing table status : Destinations : 5
Destination/Mask
Routes : 5
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
10.0.3.0/24 RIP
100 1
D
10.0.123.3
GigabitEthernet0/0/0
10.0.14.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
10.1.0.0/24 RIP
100 2
D
10.0.123.1
GigabitEthernet0/0/0
10.1.1.0/24 RIP
100 2
D
10.0.123.1
GigabitEthernet0/0/0
RIP routing table status : Destinations : 0
Routes : 0
[R2]ping 10.0.14.4 PING 10.0.14.4: 56 data bytes, press CTRL_C to break Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=37 ms Reply from 10.0.14.4: bytes=56 Sequence=2 ttl=255 time=32 ms Reply from 10.0.14.4: bytes=56 Sequence=3 ttl=255 time=32 ms Reply from 10.0.14.4: bytes=56 Sequence=4 ttl=255 time=32 ms Reply from 10.0.14.4: bytes=56 Sequence=5 ttl=255 time=32 ms
--- 10.0.14.4 ping statistics --5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 32/33/37 ms
The preceding information shows that R2 learns five RIP routes through G0/0/0 and R2 can communicate with R4 successfully.
Step 3 Configure manual summarization on R4. Configure manual summarization on R4 to summarize routes HC Series
HUAWEI TECHNOLOGIES
5
HCNP-IERN Chapter 1 Implementing RIP features
10.1.0.0/24 and 10.1.1.0/24 to route 10.1.0.0/23. [R4]interface Serial 1/0/0 [R4-Serial1/0/0]rip summary-address 10.1.0.0 255.255.254.0
After you have configured manual summarization, check the routing table of R2. [R2]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 4
Routes : 4
RIP routing table status : Destinations : 4
Destination/Mask
Routes : 4
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
10.0.3.0/24 RIP
100 1
D
10.0.123.3
GigabitEthernet0/0/0
10.0.14.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
10.1.0.0/23 RIP
100 2
D
10.0.123.1
GigabitEthernet0/0/0
RIP routing table status : Destinations : 0
Routes : 0
The preceding information shows that only the summarized route 10.1.0.0/23 exists in the routing table and the routes 10.1.0.0/24 and 10.1.1.0/24 do not exist. Delete the IP address of Loopback1 on R4, that is, delete the network segment10.1.1.0/24, and then view changes in the routing table of R2. [R4]interface loopback 1 [R4-LoopBack1]undo ip address
[R2]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 4
Routes : 4
RIP routing table status :
6
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 1 Implementing RIP features Destinations : 4
Destination/Mask
Routes : 4
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
10.0.3.0/24 RIP
100 1
D
10.0.123.3
GigabitEthernet0/0/0
10.0.14.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
10.1.0.0/23 RIP
100 2
D
10.0.123.1
GigabitEthernet0/0/0
RIP routing table status : Destinations : 0
Routes : 0
The preceding information shows that entries in the routing table of R2 do not change. The summarized route still exists in the routing table. If you delete the IP address of Loopback0 on R4, the summarized route will be deleted from the routing table of R2.
Step 4 Enable RIPv2 plain text authentication on the network segment 10.0.123.0/24. Configure RIP authentication on G0/0/0 interfaces of R1, R2, and R3, and set the authentication mode to plain text and password to huawei. [R1]interface GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]rip authentication-mode simple huawei
[R2]interface GigabitEthernet 0/0/0 [R2-GigabitEthernet0/0/0]rip authentication-mode simple huawei
[R2]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 3
Routes : 3
RIP routing table status : Destinations : 3
Destination/Mask
Proto
10.0.1.0/24 RIP 10.0.14.0/24 RIP
HC Series
Routes : 3
Pre Cost
100 1 100 1
Flags NextHop
Interface
D
10.0.123.1
GigabitEthernet0/0/0
D
10.0.123.1
GigabitEthernet0/0/0
HUAWEI TECHNOLOGIES
7
HCNP-IERN Chapter 1 Implementing RIP features 10.1.0.0/23 RIP
100 2
D
10.0.123.1
GigabitEthernet0/0/0
RIP routing table status : Destinations : 0
Routes : 0
The routing table of R2 shows that R2 has learned two routes from R1 but does not learn any routes from R3. Till now, RIP authentication is not configured on R3. Check routes learned by R3. [R3]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 10
Destination/Mask
Proto
Routes : 10
Pre Cost
Flags NextHop
Interface
10.0.3.0/24 Direct 0
0
D
10.0.3.3
LoopBack0
10.0.3.1/32 Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.3.255/32 Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.0/24 Direct 0
0
D
10.0.123.3 GigabitEthernet0/0/0
10.0.123.3/32 Direct 0
0
D
127.0.0.1
10.0.123.255/32 Direct 0 127.0.0.0/8
0
D
127.0.0.1
InLoopBack0 InLoopBack0
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
The preceding information shows that there is no route learned from other routers through RIP in the routing table of R3. R3 fails to learn routes because the authentication mode of R3 is different from that of R1 and R2. You can run the debugging command to view the processing of routing information received by R3. terminal debugging debugging rip 1 packet Nov 9 2011 11:39:08.180.1+00:00 R3 RM/6/RMDEBUG: 6: 11698: RIP 1: Receive response from 10.0.123.2 on GigabitEthernet0/0/0 Nov 9 2011 11:39:08.180.2+00:00 R3 RM/6/RMDEBUG: 6: 11709: Packet: Version 2,
8
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 1 Implementing RIP features Cmd response, Length 44 Nov 9 2011 11:39:08.180.3+00:00 R3 RM/6/RMDEBUG: 6: 11833: Authentication-mode – Simple: huawei Nov 9 2011 11:39:08.180.4+00:00 R3 RM/6/RMDEBUG: 6: 11777: Dest 10.0.2.0/24, Nexthop 0.0.0.0, Cost 1, Tag 0 Nov 9 2011 11:39:08.180.5+00:00 R3 RM/3/RMDEBUG: 6: 10855: RIP 1: Authentication failure Nov 9 2011 11:39:08.180.6+00:00 R3 RM/6/RMDEBUG: 6: 1662: RIP 1: Process message failed Nov 9 2011 11:39:14.800.1+00:00 R3 RM/6/RMDEBUG: 6: 11689: RIP 1: Sending response on interface GigabitEthernet0/0/0 from 10.0.123.3 to 224.0.0.9 undo debug all
The preceding information shows that G0/0/0 of R3 receives RIP routing information from other routers but the authentication fails because the authentication mode of R3 is different from that of R1 and R2. Run the debugging command to check the processing of routing information received by R2 from R3 and R1. terminal debugging Info: Current terminal debugging is on. debugging rip 1 packet Nov 9 2011 11:39:16.260.1+00:00 R2 RM/6/RMDEBUG: 6: 11698: RIP 1: Receive response from 10.0.123.1 on GigabitEthernet0/0/0 Nov 9 2011 11:39:16.260.2+00:00 R2 RM/6/RMDEBUG: 6: 11709: Packet: Version 2, Cmd response, Length 84 Nov 9 2011 11:39:16.260.3+00:00 R2 RM/6/RMDEBUG: 6: 11833: Authentication-mode – Simple: huawei Nov 9 2011 11:39:16.260.4+00:00 R2 RM/6/RMDEBUG: 6: 11777: Dest 10.0.1.0/24, Nexthop 0.0.0.0, Cost 1, Tag 0 Nov 9 2011 11:39:16.260.5+00:00 R2 RM/6/RMDEBUG: 6: 11777: Dest 10.0.14.0/24, Nexthop 0.0.0.0, Cost 1, Tag 0 Nov 9 2011 11:39:16.260.6+00:00 R2 RM/6/RMDEBUG: 6: 11777: Dest 10.1.0.0/16, Nexthop 0.0.0.0, Cost 2, Tag 0 Nov 9 2011 11:39:23.940.1+00:00 R2 RM/6/RMDEBUG: 6: 11689: RIP 1: Sending response on interface GigabitEthernet0/0/0 from 10.0.123.2 to 224.0.0.9 Nov 9 2011 11:39:23.940.2+00:00 R2 RM/6/RMDEBUG: 6: 11709: Packet: Version 2, Cmd response, Length 44 Nov 9 2011 11:39:23.940.3+00:00 R2 RM/6/RMDEBUG: 6: 11833: Authentication-mode – Simple: huawei Nov 9 2011 11:39:23.940.4+00:00 R2 RM/6/RMDEBUG: 6: 11777: Dest 10.0.2.0/24, Nexthop 0.0.0.0, Cost 1, Tag 0
HC Series
HUAWEI TECHNOLOGIES
9
HCNP-IERN Chapter 1 Implementing RIP features undo debug all Info: All possible debugging has been turned off
Configure RIP plain text authentication on R3. [R3]interface GigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]rip authentication-mode simple huawei
View the routing table of R3. The authentication mode of R3 is the same as that of R1 and R2, and R3 can learn RIP routes from other routers. [R3]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 4
Routes : 4
RIP routing table status : Destinations : 4
Destination/Mask
Routes : 4
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
10.0.2.0/24 RIP
100 1
D
10.0.123.2
GigabitEthernet0/0/0
10.0.14.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
10.1.0.0/23 RIP
100 2
D
10.0.123.1
GigabitEthernet0/0/0
RIP routing table status : Destinations : 0
Routes : 0
Test the connectivity between R3 and other network segments from R3. [R3]ping 10.1.0.1 PING 10.1.0.1: 56 data bytes, press CTRL_C to break Reply from 10.1.0.1: bytes=56 Sequence=1 ttl=254 time=42 ms Reply from 10.1.0.1: bytes=56 Sequence=2 ttl=254 time=38 ms Reply from 10.1.0.1: bytes=56 Sequence=3 ttl=254 time=38 ms Reply from 10.1.0.1: bytes=56 Sequence=4 ttl=254 time=38 ms Reply from 10.1.0.1: bytes=56 Sequence=5 ttl=254 time=38 ms
--- 10.1.0.1 ping statistics --5 packet(s) transmitted
10
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 1 Implementing RIP features 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 38/38/42 ms
Step 5 Enable RIPv2 MD5 authentication on the network segment 10.0.14.0. Configure RIPv2 MD5 authentication on R1 and set the password to huawei. [R1]interface Serial 3/0/0 [R1-Serial3/0/0]rip authentication-mode md5 usual huawei
Check the routing table of R4 before configuring MD5 authentication on R4. There is no RIP route in the routing table of R4 because the authentication mode of R4 is different from that of R1. You can run the debugging command to view information about learned RIP routes and the authentication failure. [R4]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 14
Destination/Mask
Proto
Routes : 14
Pre Cost
Flags NextHop
Interface
10.0.14.0/24 Direct 0
0
D
10.0.14.4
Serial1/0/0
10.0.14.1/32 Direct 0
0
D
10.0.14.1
Serial1/0/0
10.0.14.4/32 Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.14.255/32 Direct 0
0
D
127.0.0.1
InLoopBack0
10.1.0.0/24 Direct 0
0
D
10.1.0.1
LoopBack0
10.1.0.1/32 Direct 0
0
D
127.0.0.1
InLoopBack0
10.1.0.255/32 Direct 0
0
D
127.0.0.1
InLoopBack0
10.1.1.0/24 Direct 0
0
D
10.1.1.1
LoopBack1
10.1.1.1/32 Direct 0
0
D
127.0.0.1
InLoopBack0
10.1.1.255/32 Direct 0
0
D
127.0.0.1
InLoopBack0
Direct 0
0
D
127.0.0.1
InLoopBack0
127.0.0.1/32 Direct 0
0
D
127.0.0.1
InLoopBack0
127.0.0.0/8
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
HC Series
HUAWEI TECHNOLOGIES
11
HCNP-IERN Chapter 1 Implementing RIP features terminal debugging Info: Current terminal debugging is on. debugging rip 1 packet Nov 9 2011 14:51:02.810.1+00:00 R4 RM/6/RMDEBUG: 6: 11698: RIP 1: Receive response from 10.0.14.1 on Serial1/0/0 Nov 9 2011 14:51:02.810.2+00:00 R4 RM/6/RMDEBUG: 6: 11709: Packet: Version 2, Cmd response, Length 128 Nov 9 2011 14:51:02.810.3+00:00 R4 RM/6/RMDEBUG: 6: 11869: Authentication-mode - MD5 Digest: f8e1dc30.deb83bb7.1b8ce4e5.0e92e4a1 Nov 9 2011 14:51:02.810.4+00:00 R4 RM/6/RMDEBUG: 6: 11901: Sequence: 00011728 Nov 9 2011 14:51:02.810.5+00:00 R4 RM/6/RMDEBUG: 6: 11777: Dest 10.0.1.0/24, Nexthop 0.0.0.0, Cost 1, Tag 0 Nov 9 2011 14:51:02.810.6+00:00 R4 RM/6/RMDEBUG: 6: 11777: Dest 10.0.2.0/24, Nexthop 0.0.0.0, Cost 2, Tag 0 Nov 9 2011 14:51:02.810.7+00:00 R4 RM/6/RMDEBUG: 6: 11777: Dest 10.0.3.0/24, Nexthop 0.0.0.0, Cost 2, Tag 0 Nov 9 2011 14:51:02.810.8+00:00 R4 RM/6/RMDEBUG: 6: 11777: Dest 10.0.14.0/24, Nexthop 0.0.0.0, Cost 1, Tag 0 Nov 9 2011 14:51:02.810.9+00:00 R4 RM/6/RMDEBUG: 6: 11777: Dest 10.0.123.0/24, Nexthop 0.0.0.0, Cost 1, Tag 0 Nov 9 2011 14:51:02.810.10+00:00 R4 RM/3/RMDEBUG: 6: 10855: RIP 1: Authentication failure Nov 9 2011 14:51:02.810.11+00:00 R4 RM/6/RMDEBUG: 6: 1662: RIP 1: Process message failed
Configure RIP MD5 authentication on R4. [R4]interface Serial 1/0/0 [R4-Serial1/0/0]rip authentication-mode md5 usual huawei
After you have configured MD5 authentication, view the routing table of R4. R4 has learned routes from other routers. [R4]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 4
Routes : 4
RIP routing table status : Destinations : 4
Destination/Mask
12
Proto
Routes : 4
Pre Cost
Flags NextHop
HUAWEI TECHNOLOGIES
Interface
HC Series
HCNP-IERN Chapter 1 Implementing RIP features
10.0.1.0/24 RIP
100 1
D
10.0.14.1
Serial1/0/0
10.0.2.0/24 RIP
100 2
D
10.0.14.1
Serial1/0/0
10.0.3.0/24 RIP
100 2
D
10.0.14.1
Serial1/0/0
10.0.123.0/24 RIP
100 1
D
10.0.14.1
Serial1/0/0
RIP routing table status : Destinations : 0
Routes : 0
Test the network connectivity on R4. [R4]ping 10.0.3.3 PING 10.0.3.3: 56 data bytes, press CTRL_C to break Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=46 ms Reply from 10.0.3.3: bytes=56 Sequence=2 ttl=254 time=30 ms Reply from 10.0.3.3: bytes=56 Sequence=3 ttl=254 time=30 ms Reply from 10.0.3.3: bytes=56 Sequence=4 ttl=254 time=30 ms Reply from 10.0.3.3: bytes=56 Sequence=5 ttl=254 time=48 ms
--- 10.0.3.3 ping statistics --5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/36/48 ms
[R4]ping 10.0.2.2 PING 10.0.2.2: 56 data bytes, press CTRL_C to break Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=254 time=33 ms Reply from 10.0.2.2: bytes=56 Sequence=2 ttl=254 time=30 ms Reply from 10.0.2.2: bytes=56 Sequence=3 ttl=254 time=30 ms Reply from 10.0.2.2: bytes=56 Sequence=4 ttl=254 time=30 ms Reply from 10.0.2.2: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 10.0.2.2 ping statistics --5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/30/33 ms
HC Series
HUAWEI TECHNOLOGIES
13
HCNP-IERN Chapter 1 Implementing RIP features
Step 6 Configure a RIP silent interface. In actual network applications, you need to forbid RIP from sending RIP updates on some interfaces to guarantee network security after configuring the RIP protocol. Configure S1/0/0 of R4 as a silent interface. [R4]rip 1 [R4-rip-1]silent-interface Serial 1/0/0
After you have configured the silent interface, disable and then enable S1/0/0 of R4 so that R4 learns routes again. Then, observe routes learned by R4. [R4]interface Serial 1/0/0 [R4-Serial1/0/0]shutdown [R4-Serial1/0/0]undo shutdown
Wait for R4 to learn routes completely and observe the routing table of R4. [R4]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 4
Routes : 4
RIP routing table status : Destinations : 4
Destination/Mask
Proto
Routes : 4
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 RIP
100 1
D
10.0.14.1
Serial1/0/0
10.0.2.0/24 RIP
100 2
D
10.0.14.1
Serial1/0/0
10.0.3.0/24 RIP
100 2
D
10.0.14.1
Serial1/0/0
10.0.123.0/24 RIP
100 1
D
10.0.14.1
Serial1/0/0
RIP routing table status : Destinations : 0
Routes : 0
The preceding information shows that the routing table of R4 keeps unchanged and R4 still learns routes of the entire network.
14
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 1 Implementing RIP features
View routing tables of R1 and R3 and compare them with original routing tables. [R1]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 2
Routes : 2
RIP routing table status : Destinations : 2
Destination/Mask
Routes : 2
Proto
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 RIP
100 1
D
10.0.123.2
GigabitEthernet0/0/0
10.0.3.0/24 RIP
100 1
D
10.0.123.3
GigabitEthernet0/0/0
RIP routing table status : Destinations : 0
Routes : 0
[R3]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 3
Routes : 3
RIP routing table status : Destinations : 3
Destination/Mask
Proto
Routes : 3
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
10.0.2.0/24 RIP
100 1
D
10.0.123.2
GigabitEthernet0/0/0
10.0.14.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
RIP routing table status : Destinations : 0
Routes : 0
The preceding information shows that the route 10.1.0.0/23 does not exist in the routing tables of R1 and R3. R4 only learns existing routes on the network and does not advertise its routes because S1/0/0 of R4 is configured as a silent interface. Therefore, R1, R2, and R3 cannot learn routes from R4. HC Series
HUAWEI TECHNOLOGIES
15
HCNP-IERN Chapter 1 Implementing RIP features
Step 7 Configure RIPv1 and RIPv2 compatibility. Change the version of RIP to version 1 on R2 and R3. [R2]rip 1 [R2-rip-1]version 1
[R3]rip 1 [R3-rip-1]version 1
Disable and then enable G0/0/0 of R1 so that R1 recalculates routes. [R1]interface GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]shutdown [R1-GigabitEthernet0/0/0]undo shutdown
Then, observe the routing table of each router. [R1]display ip routing-table protocol rip [R1]
There is no RIP route in the routing table of R1 because of the following causes: A silent interface is configured on R4, and therefore R4 does not send route updates to R1. R2 and R3 run RIPv1 and R1 runs RIPv2. R1 cannot receive routing information from R2 and R3. You can run the debugging command to view receiving and sending status of routing information. terminal debugging Info: Current terminal debugging is on. debugging rip 1 packet Nov 10 2011 20:47:53.190.1+00:00 R1 RM/6/RMDEBUG: 6: 11689: RIP 1: Sending response on interface GigabitEthernet0/0/0 from 10.0.123.1 to 224.0.0.9 Nov 10 2011 20:47:53.190.2+00:00 R1 RM/6/RMDEBUG: 6: 11709: Packet: Version 2, Cmd response, Length 84 Nov 10 2011 20:48:13.540.1+00:00 R1 RM/6/RMDEBUG: 6: 11698: RIP 1: Receive response from 10.0.123.3 on GigabitEthernet0/0/0 Nov 10 2011 20:48:13.540.2+00:00 R1 RM/6/RMDEBUG: 6: 11709: Packet: Version 1, Cmd response, Length 24 Nov 10 2011 20:48:13.540.3+00:00 R1 RM/6/RMDEBUG: 6: 11758: Dest 10.0.3.0, Cost 1 Nov 10 2011 20:48:13.540.4+00:00 R1 RM/6/RMDEBUG: 6: 2410: RIP 1: Ignoring packet.
16
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 1 Implementing RIP features This version is not configured. Nov 10 2011 20:48:13.980.1+00:00 R1 RM/6/RMDEBUG: 6: 11698: RIP 1: Receive response from 10.0.123.2 on GigabitEthernet0/0/0 Nov 10 2011 20:48:13.980.2+00:00 R1 RM/6/RMDEBUG: 6: 11709: Packet: Version 1, Cmd response, Length 24 Nov 10 2011 20:48:13.980.4+00:00 R1 RM/6/RMDEBUG: 6: 2410: RIP 1: Ignoring packet. This version is not configured. undo debugging all Info: All possible debugging has been turned off
The preceding information shows that R1 sends routing information of RIPv2 but receives routing information of RIPv1from R2 and R3. R1 ignores information of RIPv1 due to different RIP versions. Likewise, R2 and R3 do not learn RIP routes from R1 due to different RIP versions. You can run the debugging command to view route learning status on R2 and R3. RIPv1 and RIPv2 may coexist in the actual network environment. Compatibility has been considered in RIPv2 design. You can make proper configuration to enable RIPv1 routers and RIPv2 routers to exchange routing information. Configure G0/0/0 of R1 to run in RIPv1 mode so that R1 can identify routing information of RIPv1 received by G0/0/0. [R1]interface GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]rip version 1 [R1-GigabitEthernet0/0/0]display this [V200R001C00SPC200] # interface GigabitEthernet0/0/0 ip address 10.0.123.1 255.255.255.0 rip authentication-mode simple huawei rip version 1 # Return
View routing tables of R1, R2, and R3. Each router can learn routes from other routers. [R1]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP
HC Series
HUAWEI TECHNOLOGIES
17
HCNP-IERN Chapter 1 Implementing RIP features Destinations : 2
Routes : 2
RIP routing table status : Destinations : 2
Destination/Mask
Routes : 2
Proto
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 RIP
100 1
D
10.0.123.2
GigabitEthernet0/0/0
10.0.3.0/24 RIP
100 1
D
10.0.123.3
GigabitEthernet0/0/0
RIP routing table status : Destinations : 0
Routes : 0
[R2]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 3
Routes : 3
RIP routing table status : Destinations : 3
Destination/Mask
Routes : 3
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
10.0.3.0/24 RIP
100 1
D
10.0.123.3
GigabitEthernet0/0/0
10.0.14.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
RIP routing table status : Destinations : 0
Routes : 0
[R3]display ip routing-table protocol rip Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : RIP Destinations : 3
Routes : 3
RIP routing table status : Destinations : 3
Destination/Mask
Proto
10.0.1.0/24 RIP
18
Routes : 3
Pre Cost
100 1
Flags NextHop
D
10.0.123.1
HUAWEI TECHNOLOGIES
Interface
GigabitEthernet0/0/0
HC Series
HCNP-IERN Chapter 1 Implementing RIP features 10.0.2.0/24 RIP
100 1
D
10.0.123.2
GigabitEthernet0/0/0
10.0.14.0/24 RIP
100 1
D
10.0.123.1
GigabitEthernet0/0/0
RIP routing table status : Destinations : 0
Routes : 0
Final Configurations [R1]display current-configuration [V200R001C00SPC200] # sysname R1 # interface Serial3/0/0 link-protocol ppp ip address 10.0.14.1 255.255.255.0 rip authentication-mode md5 usual gg^dP=F.[>=H)H2[EInB~.2# interface GigabitEthernet0/0/0 ip address 10.0.123.1 255.255.255.0 rip authentication-mode simple huawei rip version 1 # interface LoopBack0 ip address 10.0.1.1 255.255.255.0 # rip 1 undo summary version 2 network 10.0.0.0 # Return
[R2]display current-configuration [V200R001C00SPC200] # sysname R2 # interface GigabitEthernet0/0/0 ip address 10.0.123.2 255.255.255.0 rip authentication-mode simple huawei # interface LoopBack0
HC Series
HUAWEI TECHNOLOGIES
19
HCNP-IERN Chapter 1 Implementing RIP features ip address 10.0.2.2 255.255.255.0 # rip 1 version 1 network 10.0.0.0 # Return
[R3]display current-configuration [V200R001C00SPC200] # sysname R3 # interface GigabitEthernet0/0/0 ip address 10.0.123.3 255.255.255.0 rip authentication-mode simple huawei # interface LoopBack0 ip address 10.0.3.3 255.255.255.0 # rip 1 version 1 network 10.0.0.0 # Return
[R4]display current-configuration [V200R001C00SPC200] # sysname R4 # aaa authentication-scheme default authorization-scheme default accounting-scheme default domain default domain default_admin local-user admin password simple admin local-user admin service-type http # interface Serial1/0/0 link-protocol ppp ip address 10.0.14.4 255.255.255.0
20
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 1 Implementing RIP features rip authentication-mode md5 usual gg^dP=F.[>=H)H2[EInB~.2# rip summary-address 10.1.0.0 255.255.254.0 # interface LoopBack0 ip address 10.1.0.1 255.255.255.0 # interface LoopBack1 ip address 10.1.1.1 255.255.255.0 # rip 1 undo summary version 2 network 10.0.0.0 silent-interface Serial1/0/0 # return
HC Series
HUAWEI TECHNOLOGIES
21
HCNP-IERN Chapter 2 Implementing OSPF design structures
Chapter 2 Implementing OSPF design structures Lab 2-1 Single-Area OSPF Learning Objectives The objectives of this lab are to learn and understand how to perform the following operations: •
Configure single-area OSPF.
•
Configure OSPF authentication.
•
Establish neighbor relationships on multi-access networks.
•
Use OSPF to advertise the subnet mask of the network to which
the loopback interface connects. •
Change cost values for OSPF interfaces.
•
Configure an interface as a silent interface.
•
View OSPF status using the display command.
•
View OSPF neighbor relationships and troubleshoot faults using
the debug command.
22
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Topology
Figure 2-1 Single-area OSPF
Scenario Assume that you are a network administrator of a company that has three ARG3 routers. These routers are interconnected over the Ethernet. A broadcast multi-access network, such as Ethernet, has security threats. Therefore, OSPF area authentication is required to prevent malicious route attacks. A network connectivity problem occurs during network deployment. You must rectify the fault using the display and debug commands, and finally resume normal network operation.
Tasks Step 1 Perform basic configuration and IP addressing. Configure IP addresses and subnet masks for R1, R2, and R3. Configure a 24-bit subnet mask for the loopback interface to simulate an independent network segment. system-view Enter system view, return user view with Ctrl+Z. [R1]interface GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ip address 10.0.123.1 24
HC Series
HUAWEI TECHNOLOGIES
23
HCNP-IERN Chapter 2 Implementing OSPF design structures [R1-GigabitEthernet0/0/0]quit [R1]interface LoopBack 0 [R1-LoopBack0]ip address 10.0.1.1 24 [R1-LoopBack0]quit
system-view Enter system view, return user view with Ctrl+Z. [R2]interface GigabitEthernet 0/0/0 [R2-GigabitEthernet0/0/0]ip address 10.0.123.2 24 [R2-GigabitEthernet0/0/0]quit [R2]interface LoopBack 0 [R2-LoopBack0]ip address 10.0.2.2 24 [R2-LoopBack0]quit
system-view Enter system view, return user view with Ctrl+Z. [R3]interface GigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ip address 10.0.123.3 24 [R3-GigabitEthernet0/0/0]quit [R3]interface LoopBack 0 [R3-LoopBack0]ip address 10.0.3.3 24 [R3-LoopBack0]quit
Verify the connectivity between routers. [R1]ping -c 1 10.0.123.2 PING 10.0.123.2: 56 data bytes, press CTRL_C to break Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=2 ms
--- 10.0.123.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/2/2 ms
[R1]ping -c 1 10.0.123.3 PING 10.0.123.3: 56 data bytes, press CTRL_C to break Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=2 ms
--- 10.0.123.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss
24
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures round-trip min/avg/max = 2/2/2 ms
[R2]ping -c 1 10.0.123.3 PING 10.0.123.3: 56 data bytes, press CTRL_C to break Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=2 ms
--- 10.0.123.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/2/2 ms
Step 2 Configure single-area OSPF. Configure single-area OSPF and deploy all routers in area 0. Configure OSPF process 1. In addition, configure area authentication and set the password to huawei. Huawei's equipment supports plain text and MD5 authentication. Plain text authentication is used for this step. Note that the wildcard subnet mask 0.0.0.0 is used when you use the network command. Router IDs are usually specified using the router-id parameter so that they will not change. [R1]ospf 1 router-id 10.0.1.1 [R1-ospf-1]area 0 [R1-ospf-1-area-0.0.0.0]network 10.0.123.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]authentication-mode simple plain huawei
[R2]ospf 1 router-id 10.0.2.2 [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]network 10.0.123.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]authentication-mode simple plain huawei
[R3]ospf 1 router-id 10.0.3.3 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 10.0.123.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]authentication-mode simple plain huawei
View the routing tables and test the connectivity of the entire network. View the routing table of R1.
HC Series
HUAWEI TECHNOLOGIES
25
HCNP-IERN Chapter 2 Implementing OSPF design structures [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 12
Destination/Mask
Routes : 12
Proto Pre Cost
Flags NextHop
Interface
10.0.1.0/24
Direct 0
0
D
10.0.1.1
LoopBack0
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.1.255/32
Direct 0
0
D
127.0.0.1
10.0.2.2/32
OSPF
10
1
D
10.0.123.2
GigabitEthernet0/0/0
InLoopBack0
10.0.3.3/32
OSPF
10
1
D
10.0.123.3
GigabitEthernet0/0/0 GigabitEthernet0/0/0
10.0.123.0/24
Direct 0
0
D
10.0.123.1
10.0.123.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
R1 learns two routes from OSPF: 10.0.2.2/32 and 10.0.3.3/32. The next hops of the two routes are 10.0.123.2 and 10.0.123.3 respectively. Check whether the loopback addresses configured for R2 and R3 are reachable from R1. [R1]ping -c 1 10.0.2.2 PING 10.0.2.2: 56 data bytes, press CTRL_C to break Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms
--- 10.0.2.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 3/3/3 ms
[R1]ping -c 1 10.0.3.3 PING 10.0.3.3: 56 data bytes, press CTRL_C to break Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=255 time=2 ms
--- 10.0.3.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss 26
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures round-trip min/avg/max = 2/2/2 ms
Run the display ospf brief command to view basic OSPF information. [R1]display ospf brief
OSPF Process 1 with Router ID 10.0.1.1 OSPF Protocol Information
RouterID: 10.0.1.1
Border Router:
Multi-VPN-Instance is not enabled Global DS-TE Mode: Non-Standard IETF Mode Graceful-restart capability: disabled Helper support capability : not configured Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms Default ASE parameters: Metric: 1 Tag: 1 Type: 2 Route Preference: 10 ASE Route Preference: 150 SPF Computation Count: 18 RFC 1583 Compatible Retransmission limitation is disabled Area Count: 1
Nssa Area Count: 0
ExChange/Loading Neighbors: 0
Area: 0.0.0.0 Authtype: Simple
Area flag: Normal
SPF scheduled Count: 18 ExChange/Loading Neighbors: 0
Interface: 10.0.123.1 (GigabitEthernet0/0/0) Cost: 1
State: DROther
Type: Broadcast
MTU: 1500
Priority: 1 Designated Router: 10.0.123.2 Backup Designated Router: 10.0.123.3 Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Interface: 10.0.1.1 (LoopBack0) Cost: 0
State: P-2-P
Type: P2P
MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
The preceding information shows that plain text authentication (Authtype: Simple) is enabled in area 0, and two interfaces run OSPF:
HC Series
HUAWEI TECHNOLOGIES
27
HCNP-IERN Chapter 2 Implementing OSPF design structures
GigabitEthernet 0/0/0 and LoopBack 0. GigabitEthernet 0/0/0: the network type is broadcast, the cost is 1, and priority is 1. The role of R1 is DROther. The information about the DR (10.0.123.2) and BDR (10.0.123.3) is also provided. The network type of OSPF-enabled LoopBack 0 is P2P. Run the display ospf peer brief command to view the OSPF neighbor relationships between routers. [R1]display ospf peer brief
OSPF Process 1 with Router ID 10.0.1.1 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
State
0.0.0.0
GigabitEthernet0/0/0
10.0.2.2
Full
0.0.0.0
GigabitEthernet0/0/0
10.0.3.3
Full
----------------------------------------------------------------------------
The preceding information shows that R1 has two neighbors in area 0.0.0.0. The IDs of the two neighbors are 10.0.2.2 and 10.0.3.3 respectively. The two neighbor relationships are in the Full state. Run the display ospf lsdb command to view the OSPF LSDB of R1. [R1]dis ospf lsdb
OSPF Process 1 with Router ID 10.0.1.1 Link State Database
Area: 0.0.0.0 Type
LinkState ID
Router
10.0.3.3
Router
10.0.2.2
Router
10.0.1.1
Network
10.0.123.2
AdvRouter 10.0.3.3 10.0.2.2 10.0.1.1 10.0.2.2
Age Len 98 48
98 48 96 48
Sequence
80000011
1
80000016
80000013
99 36
Metric
8000000F
1 1 0
There are four link-state advertisements (LSAs), among which the first three LSAs are Type 1 LSAs and are respectively generated by R1, R2, and R3. The AdvRouter field indicates the router that generates a specific LSA. The fourth LSA is a Type2 LSA that is generated by the DR on a network segment. R2 is the DR on the network segment 10.0.123.0/24. Therefore, the AdvRouter field value of this LSA is 28
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
10.0.2.2. View the details about the LSA generated by R1. [R1]display ospf lsdb router self-originate
OSPF Process 1 with Router ID 10.0.1.1 Area: 0.0.0.0 Link State Database
Type
: Router
Ls id
: 10.0.1.1
Adv rtr
: 10.0.1.1
Ls age
: 680
Len
: 48
Options
: E
seq#
: 80000013
chksum
: 0x7787
Link count: 2 * Link ID: 10.0.123.2 Data
: 10.0.123.1
Link Type: TransNet Metric : 1 * Link ID: 10.0.1.1 Data
: 255.255.255.255
Link Type: StubNet Metric : 0 Priority : Medium
The LSA generated by R1 describes two network segments. The first network segment interconnects the three routers. The value of Link Type is TransNet, the value of Link ID is the interface IP address (10.0.123.2) of the DR, and the value of Data is the IP address (10.0.123.1) of the local interface on this network segment. The second network segment is the network segment where the loopback interface resides. The value of Link Type is StubNet, and the values of Link ID and Data are the IP address and subnet mask of the stub network segment respectively. View the details about the LSA generated by R2. [R2]dis ospf lsdb network self-originate
OSPF Process 1 with Router ID 10.0.2.2 Area: 0.0.0.0 Link State Database
HC Series
HUAWEI TECHNOLOGIES
29
HCNP-IERN Chapter 2 Implementing OSPF design structures Type
: Network
Ls id
: 10.0.123.2
Adv rtr
: 10.0.2.2
Ls age
: 1369
Len
: 36
Options
: E
seq#
: 8000000f
chksum
: 0xa7e
Net mask : 255.255.255.0 Priority : Low Attached Router
10.0.2.2
Attached Router
10.0.1.1
Attached Router
10.0.3.3
The Type 2 LSA describes the neighbor relationship information about the network segment where the DR resides.
Step 3 Observe relationships
how
routers
establish
neighbor
over Ethernet.
On the network segment 10.0.123.0/24, observe and analyze how the DR and BDR are elected, and check whether the same routers are elected as the DR and BDR when others carry out the experiment. Observe how the DR and BDR are elected on the network segment 10.0.123.0/24. [R1]display ospf peer
OSPF Process 1 with Router ID 10.0.1.1 Neighbors
Area 0.0.0.0 interface 10.0.123.1(GigabitEthernet0/0/0)'s neighbors Router ID: 10.0.2.2
Address: 10.0.123.2
State: Full Mode:Nbr is Master Priority: 1 DR: 10.0.123.2 BDR: 10.0.123.3 MTU: 0 Dead timer due in 40 sec Retrans timer interval: 5 Neighbor is up for 00:32:27 Authentication Sequence: [ 0 ]
Router ID: 10.0.3.3
Address: 10.0.123.3
State: Full Mode:Nbr is Master Priority: 1
30
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures DR: 10.0.123.2 BDR: 10.0.123.3 MTU: 0 Dead timer due in 33 sec Retrans timer interval: 3 Neighbor is up for 00:32:28 Authentication Sequence: [ 0 ]
The preceding information shows that the interface IP address of the DR is 10.0.123.2 on this network segment and the interface IP address of the BDR is 10.0.123.3. The elected DR and BDR may be different when different engineers carry out the experiment. This is because the DR is not preempted in OSPF. In other words, when a DR or BDR exists on the network, a newly deployed router cannot be elected as the DR or BDR. On a network, the router that first starts the OSPF process or connects to the network is the DR on the corresponding network segment, and others are the BDR and DROther routers. When the DR becomes faulty, the BDR functions as the DR. In the experiment, reset the OSPF process to observe how the DR role changes. Reset the OSPF process on R2. reset ospf process Warning: The OSPF process will be reset. Continue? [Y/N]:y
[R2]display ospf peer
OSPF Process 1 with Router ID 10.0.2.2 Neighbors
Area 0.0.0.0 interface 10.0.123.2(GigabitEthernet0/0/0)'s neighbors Router ID: 10.0.1.1
Address: 10.0.123.1
State: Full Mode:Nbr is Slave Priority: 1 DR: 10.0.123.3 BDR: 10.0.123.1 MTU: 0 Dead timer due in 33 sec Retrans timer interval: 4 Neighbor is up for 00:00:35 Authentication Sequence: [ 0 ]
Router ID: 10.0.3.3
Address: 10.0.123.3
State: Full Mode:Nbr is Master Priority: 1 DR: 10.0.123.3 BDR: 10.0.123.1 MTU: 0 Dead timer due in 33 sec Retrans timer interval: 5 Neighbor is up for 00:00:35
HC Series
HUAWEI TECHNOLOGIES
31
HCNP-IERN Chapter 2 Implementing OSPF design structures Authentication Sequence: [ 0 ]
After the OSPF process is reset on R2, the BDR (10.0.123.3) on this network segment becomes the new DR and the DROther router (10.0.123.1) becomes the new BDR. Disable G0/0/0 interface on R1, R2, and R3, and run the debugging ospf 1 event command to view the process of establishing OSPF neighbor relationships. Then enable this interface on R1, R2, and R3, at the same time if possible. Observe how the neighbor status changes on the broadcast multi-access network, and how the DR and BDR are elected. debugging ospf 1 event terminal debugging [R1]int GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]shut [R1-GigabitEthernet0/0/0]undo shut
Perform the same operations on R2 and R3 and view the debugging information about R3. The default interface priority of all routers is 1. The router ID is referenced during DR election. R3 has the largest router ID among the three routers and becomes the DR on the network segment. [R3-GigabitEthernet0/0/0]undo shutdown Nov 22 2011 18:41:50.990.3+00:00 R3 RM/6/RMDEBUG: FileID: 0xd017802c Line: 1268 Level: 0x20 OSPF 1: Intf 10.0.123.3 Rcv InterfaceUp State Down -> Waiting. Nov 22 2011 18:41:50.990.4+00:00 R3 RM/6/RMDEBUG: FileID: 0xd017802c Line: 1382 Level: 0x20 OSPF 1 Send Hello Interface Up on 10.0.123.3 Nov 22 2011 18:41:57.470.1+00:00 R3 RM/6/RMDEBUG: FileID: 0xd017802d Line: 1132 Level: 0x20 OSPF 1: Nbr 10.0.123.1 Rcv HelloReceived State Down -> Init. Nov 22 2011 18:41:57.480.1+00:00 R3 RM/6/RMDEBUG: FileID: 0xd017802d Line: 1728 Level: 0x20 OSPF 1: Nbr 10.0.123.1 Rcv 2WayReceived State Init -> 2Way. Nov 22 2011 18:41:59.510.3+00:00 R3 RM/6/RMDEBUG: FileID: 0xd017802d Line: 1132 Level: 0x20 OSPF 1: Nbr 10.0.123.2 Rcv HelloReceived State Down -> Init. Nov 22 2011 18:41:59.510.4+00:00 R3 RM/6/RMDEBUG: FileID: 0xd017802d Line: 1728 Level: 0x20 OSPF 1: Nbr 10.0.123.2 Rcv 2WayReceived State Init -> 2Way. Nov 22 2011 18:42:28.350.4+00:00 R3 RM/6/RMDEBUG:
32
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures FileID: 0xd017802d Line: 1728 Level: 0x20 OSPF 1: Nbr 10.0.123.1 Rcv AdjOk? State 2Way -> ExStart. Nov 22 2011 18:42:28.350.5+00:00 R3 RM/6/RMDEBUG: FileID: 0xd017802d Line: 1728 Level: 0x20 OSPF 1: Nbr 10.0.123.2 Rcv AdjOk? State 2Way -> ExStart. Nov 22 2011 18:42:28.350.6+00:00 R3 RM/6/RMDEBUG: FileID: 0xd017802c Line: 2045 Level: 0x20 OSPF 1 Send Hello Interface State Changed on 10.0.123.3 Nov 22 2011 18:42:28.350.7+00:00 R3 RM/6/RMDEBUG: FileID: 0xd017802c Line: 2056 Level: 0x20 OSPF 1: Intf 10.0.123.3 Rcv WaitTimer State Waiting -> DR.
After G0/0/0 interface is enabled, its status changes from Down to Waiting. Then the routers start to exchange Hello packets. After about 40 seconds, the status of G0/0/0 interface on R3 changes from Waiting to DR.
Step 4 Configure the network type of the OSPF loopback interface. Observe the two routes 10.0.2.2/32 and 10.0.3.3/32 in the routing table of R1. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 12
Destination/Mask
Routes : 12
Proto Pre Cost
Flags NextHop
Interface
10.0.1.0/24
Direct 0
0
D
10.0.1.1
LoopBack0
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.1.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.2.2/32
OSPF
10
1
D
10.0.123.2
10.0.3.3/32
OSPF
10
1
D
10.0.123.3
GigabitEthernet0/0/0 GigabitEthernet0/0/0
10.0.123.0/24
Direct 0
0
D
10.0.123.1
10.0.123.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
HC Series
HUAWEI TECHNOLOGIES
GigabitEthernet0/0/0
33
HCNP-IERN Chapter 2 Implementing OSPF design structures 255.255.255.255/32 Direct 0
0
D
127.0.0.1
InLoopBack0
The subnet masks of the loopback interfaces of both R2 and R3 contain 24 bits. Analyze why the subnet mask in the routing table contains 32 bits. Run the display ospf interface LoopBack 0 verbose command to view the OSPF status on interface LoopBack 0. [R1]display ospf interface LoopBack 0 verbose
OSPF Process 1 with Router ID 10.0.1.1 Interfaces
Interface: 10.0.1.1 (LoopBack0) Cost: 0
State: P-2-P
Type: P2P
MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1 IO Statistics Type
Input
Hello
0
0
DB Description
0
0
Link-State Req
0
0
0
0
0
0
Link-State Update Link-State Ack
Output
ALLSPF GROUP OpaqueId: 0
PrevState: Down
OSPF learns that the network segment where LoopBack 0 resides has only one IP address. Therefore, the subnet masks of the advertised routes contain 32 bits. Change the network type of LoopBack 0 on R2 to broadcast. In OSPF, a 24-bit subnet mask is used to advertise the network information about this interface. [R2]interface LoopBack 0 [R2-LoopBack0]ospf network-type broadcast
On R1, the route subnet masks of LoopBack 0 advertised by R2 contain 24 binary digits. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 12
34
Routes : 12
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Destination/Mask
Proto Pre Cost
Flags NextHop
Interface
10.0.1.0/24
Direct 0
0
D
10.0.1.1
LoopBack0
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.1.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.2.0/24
OSPF
10
1
D
10.0.123.2
GigabitEthernet0/0/0
10.0.3.3/32
OSPF
10
1
D
10.0.123.3
GigabitEthernet0/0/0
0
D
10.0.123.1
GigabitEthernet0/0/0
10.0.123.0/24
Direct 0
10.0.123.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
Run the display ospf interface LoopBack 0 verbose command to view the operating status of the LoopBack 0 interface. The command output shows that the network type of this interface is broadcast. [R2]display ospf interface LoopBack 0 verbose
OSPF Process 1 with Router ID 10.0.2.2 Interfaces
Interface: 10.0.2.2 (LoopBack0) Cost: 0
State: DR
Type: Broadcast
MTU: 1500
Priority: 1 Designated Router: 10.0.2.2 Backup Designated Router: 0.0.0.0 Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1 IO Statistics Type Hello
Input
Output
0
0
DB Description
0
0
Link-State Req
0
0
0
0
0
0
Link-State Update Link-State Ack ALLSPF GROUP ALLDR GROUP OpaqueId: 0
HC Series
PrevState: Waiting
HUAWEI TECHNOLOGIES
35
HCNP-IERN Chapter 2 Implementing OSPF design structures
Step 5 Change OSPF cost values of interfaces. On R1, view the cost value of the route to LoopBack 0 of R3. The cost value of the route to 10.0.3.3/32 is 1. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 12
Destination/Mask
Routes : 12
Proto Pre Cost
Flags NextHop
Interface
10.0.1.0/24
Direct 0
0
D
10.0.1.1
LoopBack0
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.1.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.2.0/24
OSPF
10
1
D
10.0.123.2
GigabitEthernet0/0/0
10.0.3.3/32
OSPF
10
1
D
10.0.123.3
GigabitEthernet0/0/0 GigabitEthernet0/0/0
10.0.123.0/24
Direct 0
0
D
10.0.123.1
10.0.123.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
Change the cost value of G0/0/0 of R1 to 20 and that of R3 to 10. [R1]interface GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ospf cost 20
[R3]interface GigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ospf cost 10
On R1, view the cost value of the route to LoopBack 0 of R3. The cost value of the route to 10.0.3.3/32 is 20. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 12
Destination/Mask
36
Routes : 12
Proto Pre Cost
Flags NextHop
HUAWEI TECHNOLOGIES
Interface
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
10.0.1.0/24
Direct 0
0
D
10.0.1.1
LoopBack0
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.1.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.2.0/24
OSPF
10
20
D
10.0.123.2
GigabitEthernet0/0/0
10.0.3.3/32
OSPF
10
20
D
10.0.123.3
GigabitEthernet0/0/0 GigabitEthernet0/0/0
10.0.123.0/24
Direct 0
0
D
10.0.123.1
10.0.123.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
On R3, view the cost value of the route destined for address 10.0.1.1/32. The command output shows that the cost value is 10. [R3]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 12
Destination/Mask
Routes : 12
Proto Pre Cost
Flags NextHop
Interface
10.0.1.1/32
OSPF
10
10
D
10.0.123.1
GigabitEthernet0/0/0
10.0.2.0/24
OSPF
10
10
D
10.0.123.2
GigabitEthernet0/0/0
10.0.3.0/24
Direct 0
0
D
10.0.3.3
LoopBack0
10.0.3.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.3.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.0/24
Direct 0
0
D
10.0.123.3
GigabitEthernet0/0/0
10.0.123.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
Different cost values can be configured at the two ends of a link. The cost values of a link take effect only for local devices.
HC Series
HUAWEI TECHNOLOGIES
37
HCNP-IERN Chapter 2 Implementing OSPF design structures
Step 6 Configure OSPF silent interfaces. Configure G0/0/0 of R1 as a silent interface. [R1]ospf 1 [R1-ospf-1]silent-interface GigabitEthernet 0/0/0
Observe neighbor relationships and learned routes on R1. It is found that the routes learned from OSPF do not exist in the routing table. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 12
Destination/Mask
Routes : 12
Proto Pre Cost
Flags NextHop
Interface
10.0.1.0/24
Direct 0
0
D
10.0.1.1
LoopBack0
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.1.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.0/24
Direct 0
0
D
10.0.123.1
10.0.123.1/32
Direct 0
0
D
127.0.0.1
GigabitEthernet0/0/0 InLoopBack0
10.0.123.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
View the neighbor list of R1. The neighbor relationships between R1 and R2 and between R1 and R3 are interrupted. In RIP, an interface no longer sends RIP update messages after being configured as a silent interface. In OSPF, routers exchange routing information only after establishing neighbor relationships with each other. After an interface is configured as a silent interface, it no longer sends or receives Hello packets. As a result, neighbor relationships with other routers cannot be established through this interface. [R1]display ospf interface GigabitEthernet 0/0/0
OSPF Process 1 with Router ID 10.0.1.1 Interfaces
38
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Interface: 10.0.123.1 (GigabitEthernet0/0/0) Cost: 20
State: DR
Type: Broadcast
MTU: 1500
Priority: 10 Designated Router: 10.0.123.1 Backup Designated Router: 0.0.0.0 Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1 Silent interface, No hellos
Run the debugging ip packet command to view the packets received by R1. It is found that R1 discards an OSPF packet (protocol = 89) after receiving it. debugging ip packet Nov 23 2011 09:51:53.500.1+00:00 R1 IP/7/debug_case: Receiving, interface = GE0/0/0, version = 4, headlen = 20, tos = 192, pktlen = 68, pktid = 7272, offset = 0, ttl = 1, protocol = 89, checksum = 14129, s = 10.0.123.3, d = 224.0.0.5 prompt: Receiving IP packet from GE0/0/0
Nov 23 2011 09:51:53.500.2+00:00 R1 IP/7/debug_case: Receiving, interface = GigabitEthernet0/0/0, version = 4, headlen = 20, tos = 192, pktlen = 68, pktid = 7272, offset = 0, ttl = 1, protocol = 89, checksum = 14129, s = 10.0.123.3, d = 224.0.0.5 prompt: IP_ProcessByBoard Begin!
Nov 23 2011 09:51:53.500.3+00:00 R1 IP/7/debug_case: Discarding, interface = GE0/0/0, version = 4, headlen = 20, tos = 192, pktlen = 68, pktid = 7272, offset = 0, ttl = 1, protocol = 89, checksum = 14129, s = 10.0.123.3, d = 224.0.0.5 prompt: IP_Distribute: The packet was dropped by security application.
Restore G0/0/0 of R1 to its default state and configure LoopBack 0 interface as a silent interface for all the three routers. [R1]ospf 1 [R1-ospf-1]undo silent-interface GigabitEthernet0/0/0 [R1-ospf-1]silent-interface LoopBack 0
[R2]ospf 1 [R2-ospf-1]silent-interface LoopBack 0
HC Series
HUAWEI TECHNOLOGIES
39
HCNP-IERN Chapter 2 Implementing OSPF design structures
[R3]ospf 1 [R3-ospf-1]silent-interface LoopBack 0
Check the routing table of R1. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 12
Destination/Mask
Routes : 12
Proto Pre Cost
Flags NextHop
Interface
10.0.1.0/24
Direct 0
0
D
10.0.1.1
LoopBack0
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.1.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.2.2/24
OSPF
10
20
D
10.0.123.2
GigabitEthernet0/0/0
10.0.3.3/32
OSPF
10
20
D
10.0.123.3
GigabitEthernet0/0/0 GigabitEthernet0/0/0
10.0.123.0/24
Direct 0
0
D
10.0.123.1
10.0.123.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
The preceding information shows that information about LoopBack 0 interface can be still advertised routes properly after loopback is configured as a silent interface.
Additional Exercises: Analyzing and Verifying The wildcard subnet mask 0.0.0.0 is used during OSPF configuration. In practice, the wildcard subnet mask 0.0.0.255 can also be used. Think about what are the differences between the two subnet masks. Figure out which types of interfaces must be configured as silent interfaces on live networks.
Final Configurations display current-configuration
40
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures [V200R001C00SPC200] # sysname R1 # interface GigabitEthernet0/0/0 ip address 10.0.123.1 255.255.255.0 ospf cost 20 # interface LoopBack0 ip address 10.0.1.1 255.255.255.0 # ospf 1 router-id 10.0.1.1 silent-interface LoopBack0 area 0.0.0.0 authentication-mode simple plain huawei network 10.0.123.1 0.0.0.0 network 10.0.1.1 0.0.0.0 # return
display current-configuration [V200R001C00SPC200] # sysname R2 # interface GigabitEthernet0/0/0 ip address 10.0.123.2 255.255.255.0 # interface LoopBack0 ip address 10.0.2.2 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.2.2 silent-interface LoopBack0 area 0.0.0.0 authentication-mode simple plain huawei network 10.0.123.2 0.0.0.0 network 10.0.2.2 0.0.0.0 # return
display current-configuration [V200R001C00SPC200]
HC Series
HUAWEI TECHNOLOGIES
41
HCNP-IERN Chapter 2 Implementing OSPF design structures # sysname R3 # interface GigabitEthernet0/0/0 ip address 10.0.123.3 255.255.255.0 ospf cost 10 # interface LoopBack0 ip address 10.0.3.3 255.255.255.0 # ospf 1 router-id 10.0.3.3 silent-interface LoopBack0 area 0.0.0.0 authentication-mode simple plain huawei network 10.0.123.3 0.0.0.0 network 10.0.3.3 0.0.0.0 # Return
42
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Lab 2-2 Multi-Area OSPF Learning Objectives The objectives of this lab are to learn and understand how to perform the following operations: •
Configure a specified router ID.
•
Configure multi-area OSPF.
•
Configure route summarization among OSPF areas.
•
Configure OSPF reference bandwidth.
•
Configure OSPF to import external routes.
•
Conduct route summarization when OSPF imports external
routes. •
Import default routes to OSPF.
•
Change priorities of OSPF routes.
Topology
Figure 2-2 Multi-area OSPF
HC Series
HUAWEI TECHNOLOGIES
43
HCNP-IERN Chapter 2 Implementing OSPF design structures
Scenario Assume that you are a network administrator of a company that has five ARG3 routers, of which R1, R2, and R4 are in the headquarters and interconnected over Ethernet. R3 and R5 are in branches. R3 and R2, as well as R5 and R3, are connected through a dedicated line. Multi-area OSPF is enabled to avoid the flooding of link-state advertisements (LSAs) as the network is of a large scale. Loopback 0 interfaces and interconnection interfaces of R2 and R3 belong to area 0; the network segment interconnecting R3 and R5, and Loopback 0/1/2 of R5 belong to area 1; the network segments interconnecting R4, R1, and R2, and the Loopback 0 interfaces of R1 and R4 belong to area 2. Fixed IP addresses are used as router IDs to ensure that router IDs do not change. Automatic route summarization is enabled at area borders to improve routing and forwarding efficiency. R1 connects to external networks. Routes outside the OSPF areas are configured to be imported to the OSPF areas. R4 connects to the Internet. Therefore, a default route must be configured and imported to the OSPF areas so that all routers in these areas understand how to connect to the Internet. OSPF routes are classified into internal routes and external routes. The priorities of OSPF routes are changed to avoid risks. In OSPF, the metric value of specific routes is the sum of the cost values of all links that are passed to reach the target network. The cost value of a link is obtained by comparing the actual interface bandwidth with the reference bandwidth. For example, the reference bandwidth is 100 Mbit/s and the actual interface bandwidth may be 1000 Mbit/s. The metric is an integer. Therefore, the OSPF cost value is 1 for both FE and GE interfaces. The reference bandwidth is set to 10 Gbit/s to distinguish links. Network faults occur during device configuration. The faults are rectified using the display and debug commands.
44
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Tasks Step 1 Perform basic configurations and IP addressing. Configure IP addresses and subnet masks for all routers. The subnet masks of all loopback interfaces contain 24 bits to simulate an independent network segment. system-view Enter system view, return user view with Ctrl+Z. [R1]interface GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ip address 10.0.124.1 24 [R1-GigabitEthernet0/0/0]interface LoopBack 0 [R1-LoopBack0]ip address 10.0.1.1 24 [R1-LoopBack0]interface LoopBack 1 [R1-LoopBack1]ip address 10.2.0.1 24 [R1-LoopBack1]interface LoopBack 2 [R1-LoopBack2]ip address 10.2.1.1 24
system-view Enter system view, return user view with Ctrl+Z. [R2]interface GigabitEthernet 0/0/0 [R2-GigabitEthernet0/0/0]ip address 10.0.124.2 24 [R2-GigabitEthernet0/0/0]interface Serial 2/0/0 [R2-Serial2/0/0]ip address 10.0.23.2 24 [R2-Serial2/0/0]interface LoopBack 0 [R2-LoopBack0]ip address 10.0.2.2 24
system-view Enter system view, return user view with Ctrl+Z. [R3]interface Serial 2/0/0 [R3-Serial2/0/0]ip address 10.0.23.3 24 [R3-Serial2/0/0]interface Serial 3/0/0 [R3-Serial3/0/0]ip address 10.0.35.3 24 [R3-Serial3/0/0]interface LoopBack 0 [R3-LoopBack0]ip address 10.0.3.3 24
system-view Enter system view, return user view with Ctrl+Z. [R4]interface GigabitEthernet 0/0/0 [R4-GigabitEthernet0/0/0]ip address 10.0.124.4 24 [R4-GigabitEthernet0/0/0]interface LoopBack 0
HC Series
HUAWEI TECHNOLOGIES
45
HCNP-IERN Chapter 2 Implementing OSPF design structures [R4-LoopBack0]ip address 10.0.4.4 24
system-view Enter system view, return user view with Ctrl+Z. [R5]interface Serial 1/0/0 [R5-Serial1/0/0]ip address 10.0.35.5 24 [R5-Serial1/0/0]interface LoopBack 0 [R5-LoopBack0]ip address 10.0.5.5 24 [R5-LoopBack0]interface LoopBack 1 [R5-LoopBack1]ip address 10.1.0.1 24 [R5-LoopBack1]interface LoopBack 2 [R5-LoopBack2]ip address 10.1.1.1 24
Check the connectivity of direct links. [R2]ping -c 1 10.0.124.1 PING 10.0.124.1: 56 data bytes, press CTRL_C to break Reply from 10.0.124.1: bytes=56 Sequence=1 ttl=255 time=5 ms
--- 10.0.124.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 5/5/5 ms
[R2]ping -c 1 10.0.124.4 PING 10.0.124.4: 56 data bytes, press CTRL_C to break Reply from 10.0.124.4: bytes=56 Sequence=1 ttl=255 time=14 ms
--- 10.0.124.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 14/14/14 ms
[R2]ping -c 1 10.0.23.3 PING 10.0.23.3: 56 data bytes, press CTRL_C to break Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=41 ms
--- 10.0.23.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss
46
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures round-trip min/avg/max = 41/41/41 ms
[R3]ping -c 1 10.0.35.5 PING 10.0.35.5: 56 data bytes, press CTRL_C to break Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=38 ms
--- 10.0.35.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 38/38/38 ms
Step 2 Configure multi-area OSPF. Usually, router IDs are manually specified to ensure that they do not change. There are two methods of specifying the ID of an OSPF-enabled router. The first method is to run the router id command in the system view. [R1]router id 10.0.1.1
The second method is to add the router-id parameter when the OSPF process is started. [R1]ospf 1 router-id 10.0.1.1
If both methods are used to specify the ID of a router, the router ID specified using the second method takes effect. When a router must start multiple OSPF processes and each OSPF process requires a unique router ID, only the second method can be used to specify router IDs. On R1, configure Loopback 0 and GigabitEthernet 0/0/0 interfaces in area 2. Change the network type of the loopback interfaces in all OSPF areas to broadcast so that OSPF advertises actual subnet masks of the loopback interfaces. [R1]ospf 1 router-id 10.0.1.1 [R1-ospf-1]area 2 [R1-ospf-1-area-0.0.0.2]network 10.0.124.1 0.0.0.0 [R1-ospf-1-area-0.0.0.2]quit [R1-ospf-1]quit [R1]interface LoopBack 0 [R1-LoopBack0]ospf network-type broadcast
HC Series
HUAWEI TECHNOLOGIES
47
HCNP-IERN Chapter 2 Implementing OSPF design structures [R1-LoopBack0]quit
On R2, configure loopback 0 and Serial 2/0/0 in area 0, and GigabitEthernet 0/0/0 in area 2. [R2]ospf 1 router-id 10.0.2.2 [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]quit [R2-ospf-1]area 2 [R2-ospf-1-area-0.0.0.2]network 10.0.124.2 0.0.0.0 [R2-ospf-1-area-0.0.0.2]quit [R2-ospf-1]quit [R2]interface LoopBack 0 [R2-LoopBack0]ospf network-type broadcast [R2-LoopBack0]quit
On R3, configure Loopback 0 and Serial 2/0/0 interfaces in area 0, and serial 3/0/0 in area 1. [R3]ospf 1 router-id 10.0.3.3 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]quit [R3-ospf-1]area 1 [R3-ospf-1-area-0.0.0.1]network 10.0.35.3 0.0.0.0 [R3-ospf-1-area-0.0.0.1]quit [R3-ospf-1]quit [R3]interface LoopBack 0 [R3-LoopBack0]ospf network-type broadcast [R3-LoopBack0]quit
On R4, configure Loopback 0 and GigabitEthernet 0/0/0 interfaces in area 2. [R4]ospf 1 router-id 10.0.4.4 [R4-ospf-1]area 2 [R4-ospf-1-area-0.0.0.2]network 10.0.4.4 0.0.0.0 [R4-ospf-1-area-0.0.0.2]network 10.0.124.4 0.0.0.0 [R4-ospf-1-area-0.0.0.2]quit [R4-ospf-1]quit [R4]interface LoopBack 0
48
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures [R4-LoopBack0]ospf network-type broadcast [R4-LoopBack0]quit
On R5, configure all loopback interfaces and serial 1/0/0 in area 1. [R5]ospf 1 router-id 10.0.5.5 [R5-ospf-1]area 1 [R5-ospf-1-area-0.0.0.1]network 10.0.5.5 0.0.0.0 [R5-ospf-1-area-0.0.0.1]network 10.1.0.1 0.0.0.0 [R5-ospf-1-area-0.0.0.1]network 10.1.1.1 0.0.0.0 [R5-ospf-1-area-0.0.0.1]network 10.0.35.5 0.0.0.0 [R5-ospf-1-area-0.0.0.1]quit [R5-ospf-1]quit [R5]interface LoopBack 0 [R5-LoopBack0]ospf network-type broadcast [R5-LoopBack0]quit [R5]interface LoopBack 1 [R5-LoopBack1]ospf network-type broadcast [R5-LoopBack1]quit [R5]interface LoopBack 2 [R5-LoopBack2]ospf network-type broadcast [R5-LoopBack2]quit
View the routing table on R1. [R1]display ip routing-table Route Flags: R - relay, D - download to fib --------------------------------------------------------------------------Routing Tables: Public Destinations : 24
Destination/Mask
Routes : 24
Proto Pre Cost
Flags NextHop
Interface
10.0.1.0/24
Direct 0
0
D
10.0.1.1
LoopBack0
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.1.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.2.0/24
OSPF
10
1
D
10.0.124.2
GigabitEthernet0/0/0
10.0.3.0/24
OSPF
10
1563
D
10.0.124.2
GigabitEthernet0/0/0
10.0.4.0/24
OSPF
10
1
D
10.0.124.4
GigabitEthernet0/0/0
10.0.5.0/24
OSPF
10
3125
D
10.0.124.2
GigabitEthernet0/0/0
10.0.23.0/24
OSPF
10
1563
D
10.0.124.2
GigabitEthernet0/0/0
10.0.35.0/24
OSPF
10
3125
D
10.0.124.2
GigabitEthernet0/0/0 GigabitEthernet0/0/0
10.0.124.0/24
Direct 0
0
D
10.0.124.1
10.0.124.1/32
Direct 0
0
D
127.0.0.1
HC Series
HUAWEI TECHNOLOGIES
InLoopBack0
49
HCNP-IERN Chapter 2 Implementing OSPF design structures 10.0.124.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.1.0.0/24
OSPF
10
3125
D
10.0.124.2
GigabitEthernet0/0/0
10.1.1.0/24
OSPF
10
3125
D
10.0.124.2
GigabitEthernet0/0/0
10.2.0.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.2.1.0/24
Direct 0
0
D
10.2.1.1
LoopBack2
10.2.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.2.1.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
The routing table of R1 contains all routing entries on the network. On R1, test whether the routes to the loopback interfaces of other routers are reachable. [R1]ping -c 1 10.0.2.2 PING 10.0.2.2: 56 data bytes, press CTRL_C to break Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=3 ms
--- 10.0.2.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 3/3/3 ms
[R1]ping -c 1 10.0.5.5 PING 10.0.5.5: 56 data bytes, press CTRL_C to break Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=253 time=88 ms
--- 10.0.5.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 88/88/88 ms
[R1]ping -c 1 10.0.4.4 PING 10.0.4.4: 56 data bytes, press CTRL_C to break Reply from 10.0.4.4: bytes=56 Sequence=1 ttl=255 time=3 ms
--- 10.0.4.4 ping statistics --1 packet(s) transmitted 1 packet(s) received
50
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures 0.00% packet loss round-trip min/avg/max = 3/3/3 ms
On R2, run the display ospf brief command to view basic OSPF information. [R2]display ospf brief
OSPF Process 1 with Router ID 10.0.2.2 OSPF Protocol Information
RouterID: 10.0.2.2
Border Router: AREA
Multi-VPN-Instance is not enabled Global DS-TE Mode: Non-Standard IETF Mode Graceful-restart capability: disabled Helper support capability : not configured Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms Default ASE parameters: Metric: 1 Tag: 1 Type: 2 Route Preference: 10 ASE Route Preference: 150 SPF Computation Count: 19 RFC 1583 Compatible Retransmission limitation is disabled Area Count: 2
Nssa Area Count: 0
ExChange/Loading Neighbors: 0
Area: 0.0.0.0 Authtype: None
Area flag: Normal
SPF scheduled Count: 19 ExChange/Loading Neighbors: 0
Interface: 10.0.2.2 (LoopBack0) Cost: 0
State: DR
Type: Broadcast
MTU: 1500
Priority: 1 Designated Router: 10.0.2.2 Backup Designated Router: 0.0.0.0 Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Interface: 10.0.23.2 (Serial2/0/0) --> 10.0.23.3 Cost: 1562
State: P-2-P
Type: P2P
MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Area: 0.0.0.2
HC Series
HUAWEI TECHNOLOGIES
51
HCNP-IERN Chapter 2 Implementing OSPF design structures Authtype: None
Area flag: Normal
SPF scheduled Count: 17 ExChange/Loading Neighbors: 0
Interface: 10.0.124.2 (GigabitEthernet0/0/0) Cost: 1
State: BDR
Type: Broadcast
MTU: 1500
Priority: 1 Designated Router: 10.0.124.1 Backup Designated Router: 10.0.124.2 Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
In the preceding information, Border Router: AREA indicates that this router is an area border router (ABR). The value is blank if the router is an intra-domain router. The value is AS if the router is an ASBR. The router has three interfaces involved in OSPF calculation. The network type of the Loopback 0 interface has been changed to Broadcast manually. The encapsulation type of Serial 2/0/0 is PPP. Therefore, the default network type is PPP. GigabitEthernet 0/0/0 connects to area 2 and the network type is broadcast. On R2, run the display ospf peer brief command to view the OSPF neighbor relationships between routers. R2 has one neighbor 10.0.3.3 in area 0 and two neighbors (10.0.1.1 and 10.0.4.4) in area 2. Adjacencies are established between R2 and all its neighbors, which is called Full adjacency. [R2]display ospf peer brief
OSPF Process 1 with Router ID 10.0.2.2 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
State
0.0.0.0
Serial2/0/0
10.0.3.3
Full
0.0.0.2
GigabitEthernet0/0/0
10.0.1.1
Full
0.0.0.2
GigabitEthernet0/0/0
10.0.4.4
Full
----------------------------------------------------------------------------
On R2, run the display ospf lsdb command to view OSPF database information. R2 has two link state databases (LSDBs) to respectively describe the routes in area 0 and area 2 because it is an ABR. [R2]display ospf lsdb
52
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures OSPF Process 1 with Router ID 10.0.2.2 Link State Database
Area: 0.0.0.0 Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.3.3
10.0.3.3
788 60
80000008
0
Router
10.0.2.2
10.0.2.2
869 60
80000008
0
Sum-Net
10.0.35.0
10.0.3.3
846 28
80000002
1562
Sum-Net
10.0.124.0
10.0.2.2
1259 28
80000002
1
Sum-Net
10.1.1.0
10.0.3.3
1565 28
80000001
1562
Sum-Net
10.0.5.0
10.0.3.3
1594 28
80000001
1562
Sum-Net
10.1.0.0
10.0.3.3
1584 28
80000001
1562
Sum-Net
10.0.4.0
10.0.2.2
538 28
80000002
1
Area: 0.0.0.2 Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.4.4
10.0.4.4
504 48
80000008
1
Router
10.0.2.2
10.0.2.2
558 36
80000006
1
Router
10.0.1.1
10.0.1.1
568 60
80000011
1
Network
10.0.124.1
10.0.1.1
559 36
80000005
0
Sum-Net
10.0.35.0
10.0.2.2
846 28
80000002
3124
Sum-Net
10.0.3.0
10.0.2.2
830 28
80000002
1562
Sum-Net
10.0.2.0
10.0.2.2
1249 28
80000002
0
Sum-Net
10.1.1.0
10.0.2.2
1565 28
80000001
3124
Sum-Net
10.0.5.0
10.0.2.2
1595 28
80000001
3124
Sum-Net
10.1.0.0
10.0.2.2
1584 28
80000001
3124
Sum-Net
10.0.23.0
10.0.2.2
1261 28
80000002
1562
Step 3 Configure route summarization between OSPF areas. View the routing tables of R2 and R3. [R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 8
Routes : 8
OSPF routing table status : Destinations : 8
Destination/Mask
HC Series
Routes : 8
Proto Pre Cost
Flags NextHop
HUAWEI TECHNOLOGIES
Interface
53
HCNP-IERN Chapter 2 Implementing OSPF design structures
10.0.3.0/24 OSPF
10
1562
D
10.0.23.3
Serial2/0/0
10.0.4.0/24 OSPF
10
1
D
10.0.124.4
10.0.5.0/24 OSPF
10
3124
D
10.0.23.3
Serial2/0/0
10.0.35.0/24 OSPF
10
3124
D
10.0.23.3
Serial2/0/0
10.1.0.0/24 OSPF
10
3124
D
10.0.23.3
Serial2/0/0
10.1.1.0/24 OSPF
10
3124
D
10.0.23.3
Serial2/0/0
GigabitEthernet0/0/0
OSPF routing table status : Destinations : 0
Routes : 0
[R3]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 8
Routes : 8
OSPF routing table status : Destinations : 8
Destination/Mask
Proto
Routes : 8
Pre Cost
Flags NextHop
Interface
10.0.2.0/24
OSPF
10
1562
D
10.0.23.2
Serial2/0/0
10.0.4.0/24
OSPF
10
1563
D
10.0.23.2
Serial2/0/0
10.0.5.0/24
OSPF
10
1562
D
10.0.35.5
Serial3/0/0
10.0.124.0/24
OSPF
10
1563
D
10.0.23.2
Serial2/0/0
10.1.0.0/24
OSPF
10
1562
D
10.0.35.5
Serial3/0/0
10.1.1.0/24
OSPF
10
1562
D
10.0.35.5
Serial3/0/0
OSPF routing table status : Destinations : 0
Routes : 0
The two routes 10.1.0.0/24 and 10.1.1.0/24 are provided as specific routes. Information about such routes can be summarized and forwarded to other OSPF areas. This reduces the routing entries in routing tables of routers in other areas and minimizes the possibility of route flapping. On R3, run the abr-summary command to summarize the routes on the network segment of Loopback1 and Loopback2 of R5. [R3]ospf 1 [R3-ospf-1]area 1
54
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures [R3-ospf-1-area-0.0.0.1]abr-summary 10.1.0.0 255.255.254.0
View summarized routing information on R2 and R3. [R3]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 8
Routes : 8
OSPF routing table status : Destinations : 8
Destination/Mask
Routes : 8
Proto
Pre Cost
Flags NextHop
Interface
10.0.2.0/24
OSPF
10
1562
D
10.0.23.2
Serial2/0/0
10.0.4.0/24
OSPF
10
1563
D
10.0.23.2
Serial2/0/0
10.0.5.0/24
OSPF
10
1562
D
10.0.35.5
Serial3/0/0
10.0.124.0/24
OSPF
10
1563
D
10.0.23.2
Serial2/0/0
10.1.0.0/24
OSPF
10
1562
D
10.0.35.5
Serial3/0/0
10.1.1.0/24
OSPF
10
1562
D
10.0.35.5
Serial3/0/0
OSPF routing table status : Destinations : 0
Routes : 0
[R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 7
Destination/Mask
Proto
Routes : 7
Pre Cost
Flags NextHop
Interface
10.0.3.0/24 OSPF
10
1562
D
10.0.23.3
Serial2/0/0
10.0.4.0/24 OSPF
10
1
D
10.0.124.4
10.0.5.0/24 OSPF
10
3124
D
10.0.23.3
Serial2/0/0
10.0.35.0/24 OSPF
10
3124
D
10.0.23.3
Serial2/0/0
10.1.0.0/23 OSPF
10
3124
D
10.0.23.3
Serial2/0/0
GigabitEthernet0/0/0
OSPF routing table status :
HC Series
HUAWEI TECHNOLOGIES
55
HCNP-IERN Chapter 2 Implementing OSPF design structures Destinations : 0
Routes : 0
The preceding information shows that the two routes are provided as specific routes in the routing table of R3, and only the summarized route 10.1.0.0/23 exists in the routing table of R2. Test whether the routes from other routers to 10.1.0.0/24 and 10.1.1.0/24 are reachable. [R1]ping -c 1 10.1.0.1 PING 10.1.0.1: 56 data bytes, press CTRL_C to break Reply from 10.1.0.1: bytes=56 Sequence=1 ttl=253 time=66 ms
--- 10.1.0.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 66/66/66 ms
[R1]ping -c 1 10.1.1.1 PING 10.1.1.1: 56 data bytes, press CTRL_C to break Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=253 time=66 ms
--- 10.1.1.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 66/66/66 ms
[R2]ping -c 1 10.1.0.1 PING 10.1.0.1: 56 data bytes, press CTRL_C to break Reply from 10.1.0.1: bytes=56 Sequence=1 ttl=254 time=69 ms
--- 10.1.0.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 69/69/69 ms
[R3]ping -c 1 10.1.0.1 PING 10.1.0.1: 56 data bytes, press CTRL_C to break Reply from 10.1.0.1: bytes=56 Sequence=1 ttl=255 time=29 ms
56
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures --- 10.1.0.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 29/29/29 ms
Step 4 Change the reference bandwidth of OSPF. GE and even 10 GE networks may be used in practice. Because the default OSPF reference bandwidth is 100 Mbit/s and the cost values of interfaces are integers, OSPF cannot distinguish FE and GE networks based on the bandwidth. On R2, change the OSPF reference bandwidth to 10 Gbit/s. Run the bandwidth-reference command to change the reference bandwidth. Note that the unit of bandwidth is Mbit/s. [R2-ospf-1]bandwidth-reference 10000
On R2, view OSPF neighbor relationships and learned routes. The cost values have changed in the routing table. [R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 7
Destination/Mask
Proto
Routes : 7
Pre Cost
Flags NextHop
Interface
10.0.3.0/24 OSPF
10
65535
D
10.0.23.3
Serial2/0/0
10.0.4.0/24 OSPF
10
100
D
10.0.124.4
10.0.5.0/24 OSPF
10
67097
D
10.0.23.3
Serial2/0/0
10.0.35.0/24 OSPF
10
67097
D
10.0.23.3
Serial2/0/0
10.1.0.0/23 OSPF
10
67097
D
10.0.23.3
Serial2/0/0
GigabitEthernet0/0/0
OSPF routing table status : Destinations : 0
Routes : 0
The OSPF reference bandwidth must be the same across OSPF areas; HC Series
HUAWEI TECHNOLOGIES
57
HCNP-IERN Chapter 2 Implementing OSPF design structures
otherwise, OSPF cannot work properly. Change the OSPF reference bandwidth to 10 Gbit/s for all routers. [R1-ospf-1]bandwidth-reference 10000 [R3-ospf-1]bandwidth-reference 10000 [R4-ospf-1]bandwidth-reference 10000 [R5-ospf-1]bandwidth-reference 10000
On R2, view the neighbor list and routing table to check whether the OSPF neighbor relationships and routing information are correct. [R2]display ospf peer brief
OSPF Process 1 with Router ID 10.0.2.2 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
State
0.0.0.0
Serial2/0/0
10.0.3.3
Full
0.0.0.2
GigabitEthernet0/0/0
10.0.1.1
Full
0.0.0.2
GigabitEthernet0/0/0
10.0.4.4
Full
----------------------------------------------------------------------------
[R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 7
Destination/Mask
Proto
Routes : 7
Pre Cost
Flags NextHop
Interface
10.0.3.0/24 OSPF
10
65535
D
10.0.23.3
Serial2/0/0
10.0.4.0/24 OSPF
10
100
D
10.0.124.4
10.0.5.0/24 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
10.0.35.0/24 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
10.1.0.0/23 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
GigabitEthernet0/0/0
OSPF routing table status : Destinations : 0
Routes : 0
The preceding information shows that the routing information is
58
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
correct. You can test the network connectivity.
Step 5 Summarize direct routes and import them to OSPF areas. The Loopback1 and Loopback2 interfaces of R1 do not belong to any OSPF areas. Import these two routes to OSPF areas and conduct route summarization on R1. [R1]ospf [R1-ospf-1]import-route direct [R1-ospf-1]asbr-summary 10.2.0.0 255.255.254.0
View information about external routes on R1. [R1]display ospf lsdb ase 10.2.0.0
OSPF Process 1 with Router ID 10.0.1.1 Link State Database
Type
: External
Ls id
: 10.2.0.0
Adv rtr
: 10.0.1.1
Ls age
: 293
Len
: 36
Options
: E
seq#
: 80000001
chksum
: 0x2b6
Net mask : 255.255.254.0 TOS 0 Metric: 2 E type
: 2
Forwarding Address : 0.0.0.0 Tag
: 1
Priority : Low
R1 advertises the network segment 10.2.0.0 to other routers through a Type5 LSA and the subnet mask is 255.255.254.0. View summarized route information on other routers and test network connectivity. [R2]display ip routing-table protocol ospf
HC Series
HUAWEI TECHNOLOGIES
59
HCNP-IERN Chapter 2 Implementing OSPF design structures Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 7
Destination/Mask
Routes : 7
Proto
Pre Cost
Flags NextHop
Interface
GigabitEthernet0/0/0
10.0.1.0/24 O_ASE
150 1
D
10.0.124.1
10.0.3.0/24 OSPF
10
65535
D
10.0.23.3
10.0.4.0/24 OSPF
10
100
D
10.0.124.4
10.0.5.0/24 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
10.0.35.0/24 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
10.1.0.0/23 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
10.2.0.0/23 O_ASE
150 2
D
10.0.124.1
Serial2/0/0 GigabitEthernet0/0/0
GigabitEthernet0/0/0
OSPF routing table status : Destinations : 0
Routes : 0
[R2]ping -c 1 10.2.0.1 PING 10.2.0.1: 56 data bytes, press CTRL_C to break Reply from 10.2.0.1: bytes=56 Sequence=1 ttl=255 time=2 ms
--- 10.2.0.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/2/2 ms
[R2]ping -c 1 10.2.1.1 PING 10.2.1.1: 56 data bytes, press CTRL_C to break Reply from 10.2.1.1: bytes=56 Sequence=1 ttl=255 time=2 ms
--- 10.2.1.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/2/2 ms
A summarized route with a 23-digit subnet mask is found on R2.
60
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Disable the Loopback2 interface on R1 and then view routing entries on R2. The summarized route still exists after the Loopback2 interface is disabled. [R1]undo interface LoopBack 2
[R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 7
Destination/Mask
Proto
Routes : 7
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 O_ASE
150 1
D
10.0.124.1
GigabitEthernet0/0/0
10.0.3.0/24 OSPF
10
65535
D
10.0.23.3
10.0.4.0/24 OSPF
10
100
D
10.0.124.4
10.0.5.0/24 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
10.0.35.0/24 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
10.1.0.0/23 OSPF
10
131070
D
10.0.23.3
10.2.0.0/23 O_ASE
150 2
D
10.0.124.1
Serial2/0/0 GigabitEthernet0/0/0
Serial2/0/0 GigabitEthernet0/0/0
OSPF routing table status : Destinations : 0
Routes : 0
Enable R5 to send Tracert packets to 10.2.1.1. tracert 10.2.1.1 traceroute to 10.2.1.1(10.2.1.1), max hops: 30 ,packet length: 40,press CTRL_C to break 1 10.0.35.3 62 ms 28 ms 27 ms 2 10.0.23.2 54 ms 58 ms 57 ms 3 * * * ...
After the Loopback2 interface on R1 is disabled, packets bound for this interface are still forwarded by R2 and R3 and are discarded after arriving at R1.
HC Series
HUAWEI TECHNOLOGIES
61
HCNP-IERN Chapter 2 Implementing OSPF design structures
Step 6 Import default routes to OSPF. The Loopback 0 interface of R4 connects to the Internet. On R4, configure a default route whose next hop points to the Loopback 0 interface. [R4]ip route-static 0.0.0.0 0.0.0.0 LoopBack 0
Import this default route to OSPF areas, with the type set to 1, cost value set to 10, and import always enabled. [R4]ospf 1 [R4-ospf-1]default-route-advertise always type 1
On R2, view the default route learning status. R2 learns a default route through a Type5 LSA. The next hop of this route is the interface IP address of R4. [R2]dis ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 8
Routes : 8
OSPF routing table status : Destinations : 8
Routes : 8
Destination/Mask
Proto
Pre Cost
Flags NextHop
Interface
0.0.0.0/0
O_ASE
150 101
D
10.0.124.4
GigabitEthernet0/0/0
10.0.1.0/24 O_ASE
150 1
D
10.0.124.1
GigabitEthernet0/0/0
10.0.3.0/24 OSPF
10
65535
D
10.0.23.3
10.0.4.0/24 OSPF
10
100
D
10.0.124.4
10.0.5.0/24 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
10.0.35.0/24 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
10.1.0.0/23 OSPF
10
131070
D
10.0.23.3
Serial2/0/0
10.2.0.0/23 O_ASE
150 2
D
10.0.124.1
Serial2/0/0 GigabitEthernet0/0/0
GigabitEthernet0/0/0
OSPF routing table status : Destinations : 0
Routes : 0
Test whether the route from R5 to 10.0.4.4 is reachable. [R5]ping -c 1 10.0.4.4
62
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures PING 10.0.4.4: 56 data bytes, press CTRL_C to break Reply from 10.0.4.4: bytes=56 Sequence=1 ttl=253 time=78 ms
--- 10.0.4.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 78/78/78 ms
Step 7 Change the priorities of two types of OSPF routes. View the routing table of R1 and observe the priorities of different types of OSPF routes. [R1]dis ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 8
Routes : 8
OSPF routing table status : Destinations : 8
Destination/Mask
0.0.0.0/0
Proto
O_ASE
Routes : 8
Pre Cost
Flags NextHop
Interface
150 101
D
10.0.124.4
GigabitEthernet0/0/0
10.0.2.0/24 OSPF
10
100
D
10.0.124.2
GigabitEthernet0/0/0
10.0.3.0/24 OSPF
10
65635
D
10.0.124.2
GigabitEthernet0/0/0
10.0.4.0/24 OSPF
10
100
D
10.0.124.4
GigabitEthernet0/0/0
10.0.5.0/24 OSPF
10
131170
D
10.0.124.2
GigabitEthernet0/0/0
10.0.23.0/24 OSPF
10
65635
D
10.0.124.2
GigabitEthernet0/0/0
10.0.35.0/24 OSPF
10
131170
D
10.0.124.2
GigabitEthernet0/0/0
10.1.0.0/23 OSPF
10
131170
D
10.0.124.2
GigabitEthernet0/0/0
OSPF routing table status : Destinations : 0
Routes : 0
By default, the priority of the internal OSPF routes found within an OSPF area or between OSPF areas is 10. The priority of OSPF external routes is 150. Change the priority of the internal OSPF routes to 20 for R1 and R4,
HC Series
HUAWEI TECHNOLOGIES
63
HCNP-IERN Chapter 2 Implementing OSPF design structures
and the priority of OSPF external routes to 50. [R1]ospf [R1-ospf-1]preference 20 [R1-ospf-1]preference ase 50
[R4]ospf [R4-ospf-1]preference 20 [R4-ospf-1]preference ase 50
Check that the priorities of internal and external routes in the routing table have been changed successfully. [R1]dis ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 8
Routes : 8
OSPF routing table status : Destinations : 8
Routes : 8
Destination/Mask
Proto
Pre Cost
Flags NextHop
Interface
0.0.0.0/0
O_ASE
50
101
D
10.0.124.4
GigabitEthernet0/0/0
10.0.2.0/24 OSPF
20
100
D
10.0.124.2
GigabitEthernet0/0/0
10.0.3.0/24 OSPF
20
65635
D
10.0.124.2
GigabitEthernet0/0/0
10.0.4.0/24 OSPF
20
100
D
10.0.124.4
GigabitEthernet0/0/0
10.0.5.0/24 OSPF
20
131170
D
10.0.124.2
GigabitEthernet0/0/0
10.0.23.0/24 OSPF
20
65635
D
10.0.124.2
GigabitEthernet0/0/0
10.0.35.0/24 OSPF
20
131170
D
10.0.124.2
GigabitEthernet0/0/0
10.1.0.0/23 OSPF
20
131170
D
10.0.124.2
GigabitEthernet0/0/0
OSPF routing table status : Destinations : 0
Routes : 0
The route priority takes effect only for local devices and represents the preference of routes learned locally by various means. The routes of routers in an OSPF area may have different priorities.
Additional Exercises: Analyzing and Verifying Why is the default route configured to be always advertised in step 6? 64
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
What are the advantages and disadvantages?
Route summarization has strong points and drawbacks. Sum up the strong points and drawbacks of route summarization and analyze how to avoid these drawbacks.
Final Configurations display current-configuration [V200R001C00SPC200] # sysname R1 # interface GigabitEthernet0/0/0 ip address 10.0.124.1 255.255.255.0 # interface LoopBack0 ip address 10.0.1.1 255.255.255.0 ospf network-type broadcast # interface LoopBack1 ip address 10.2.0.1 255.255.255.0 # ospf 1 router-id 10.0.1.1 asbr-summary 10.2.0.0 255.255.254.0 import-route direct preference 20 preference ase 50 bandwidth-reference 10000 area 0.0.0.2 network 10.0.124.1 0.0.0.0 # return
display current-configuration [V200R001C00SPC200] # sysname R2 # interface Serial2/0/0 link-protocol ppp
HC Series
HUAWEI TECHNOLOGIES
65
HCNP-IERN Chapter 2 Implementing OSPF design structures ip address 10.0.23.2 255.255.255.0 # interface GigabitEthernet0/0/0 ip address 10.0.124.2 255.255.255.0 # interface LoopBack0 ip address 10.0.2.2 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.2.2 bandwidth-reference 10000 area 0.0.0.0 network 10.0.23.2 0.0.0.0 network 10.0.2.2 0.0.0.0 area 0.0.0.2 network 10.0.124.2 0.0.0.0 # return
display current-configuration [V200R001C00SPC200] # sysname R3 # interface Serial2/0/0 link-protocol ppp ip address 10.0.23.3 255.255.255.0 # interface Serial3/0/0 link-protocol ppp ip address 10.0.35.3 255.255.255.0 # interface LoopBack0 ip address 10.0.3.3 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.3.3 bandwidth-reference 10000 area 0.0.0.0 network 10.0.3.3 0.0.0.0 network 10.0.23.3 0.0.0.0 area 0.0.0.1 abr-summary 10.1.0.0 255.255.254.0
66
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures network 10.0.35.3 0.0.0.0 # return
display current-configuration [V200R001C00SPC200] # sysname R4 # interface GigabitEthernet0/0/0 ip address 10.0.124.4 255.255.255.0 # interface LoopBack0 ip address 10.0.4.4 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.4.4 default-route-advertise always type 1 preference 20 preference ase 50 bandwidth-reference 10000 area 0.0.0.2 network 10.0.4.4 0.0.0.0 network 10.0.124.4 0.0.0.0 # ip route-static 0.0.0.0 0.0.0.0 LoopBack0 # return
display current-configuration [V200R001C00SPC200] # sysname R5 # interface Serial1/0/0 link-protocol ppp ip address 10.0.35.5 255.255.255.0 # interface LoopBack0 ip address 10.0.5.5 255.255.255.0 ospf network-type broadcast # interface LoopBack1
HC Series
HUAWEI TECHNOLOGIES
67
HCNP-IERN Chapter 2 Implementing OSPF design structures ip address 10.1.0.1 255.255.255.0 ospf network-type broadcast # interface LoopBack2 ip address 10.1.1.1 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.5.5 bandwidth-reference 10000 area 0.0.0.1 network 10.0.5.5 0.0.0.0 network 10.1.0.1 0.0.0.0 network 10.1.1.1 0.0.0.0 network 10.0.35.5 0.0.0.0 # Return
68
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Lab 2-3 OSPF Adjacency Relationships and Various Types of LSAs Learning Objectives The objectives of this lab are to learn and understand: •
Process of establishing neighbor relationships over Ethernet
•
Method of intervening in DR election in OSPF
•
Content of five types of LSAs and their functions
•
Exchange of LSR, LSU, and LSAck packets in OSPF
Topology
Figure 2-3 OSPF adjacency relationships and various types of LSAs
HC Series
HUAWEI TECHNOLOGIES
69
HCNP-IERN Chapter 2 Implementing OSPF design structures
Scenario Assume that you are a network administrator of a company that has five ARG3 routers, of which R1, R2, R3, and R4 are in the headquarters and interconnected over Ethernet. R5 is in a branch and connects to R3 through a dedicated line. Multi-area OSPF is enabled to avoid the flooding of LSAs as the network is of a large scale. The Loopback 0 interface of R1 belongs to area 2. The Loopback 0 interfaces of R2, R3, and R4, and network segment 10.1.234.0/24 belong to area 0. The network segment interconnecting R3 and R5 belongs to area 1. The Loopback 0 interface of R5 belongs to a network outside OSPF areas. Fixed IP addresses are used as router IDs to ensure that router IDs do not change. Manual intervention is required in the election of the DR and BDR on the network segment where R4 interconnects with R1, R2, and R3. In practice, configure R3 as the designated router (DR), R2 as the backup designated router (BDR), and R4 as the DROther router.
Tasks Step 1 Perform basic configurations and IP addressing. Configure IP addresses and subnet masks for all routers. The subnet masks of all loopback interfaces contain 24 bits to simulate an independent network segment. system-view Enter system view, return user view with Ctrl+Z. [R1]interface GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ip address 10.1.234.1 24 [R1-GigabitEthernet0/0/0]interface LoopBack 0 [R1-LoopBack0]ip address 10.0.1.1 24
system-view Enter system view, return user view with Ctrl+Z. [R2]interface GigabitEthernet 0/0/0 [R2-GigabitEthernet0/0/0]ip address 10.1.234.2 24
70
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures [R2-GigabitEthernet0/0/0]interface LoopBack 0 [R2-LoopBack0]ip address 10.0.2.2 24
system-view Enter system view, return user view with Ctrl+Z. [R3]interface GigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ip address 10.1.234.3 24 [R3-GigabitEthernet0/0/0]interface Serial 3/0/0 [R3-Serial3/0/0]ip address 10.0.35.3 24 [R3-Serial3/0/0]interface LoopBack 0 [R3-LoopBack0]ip address 10.0.3.3 24
system-view Enter system view, return user view with Ctrl+Z. [R4]interface GigabitEthernet 0/0/0 [R4-GigabitEthernet0/0/0]ip address 10.1.234.4 24 [R4-GigabitEthernet0/0/0]interface LoopBack 0 [R4-LoopBack0]ip address 10.0.4.4 24
system-view Enter system view, return user view with Ctrl+Z. [R5]interface Serial 1/0/0 [R5-Serial1/0/0]ip address 10.0.35.5 24 [R5-Serial1/0/0]interface LoopBack 0 [R5-LoopBack0]ip address 10.0.5.5 24
Check the connectivity of direct links. [R1]ping -c 1 10.1.234.2 PING 10.1.234.2: 56 data bytes, press CTRL_C to break Reply from 10.1.234.2: bytes=56 Sequence=1 ttl=255 time=13 ms
--- 10.1.234.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 13/13/13 ms
[R1]ping -c 1 10.1.234.4 PING 10.1.234.4: 56 data bytes, press CTRL_C to break Reply from 10.1.234.4: bytes=56 Sequence=1 ttl=255 time=6 ms
--- 10.1.234.4 ping statistics ---
HC Series
HUAWEI TECHNOLOGIES
71
HCNP-IERN Chapter 2 Implementing OSPF design structures 1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 6/6/6 ms
[R3]ping -c 1 10.1.234.1 PING 10.1.234.1: 56 data bytes, press CTRL_C to break Reply from 10.1.234.1: bytes=56 Sequence=1 ttl=255 time=13 ms
--- 10.1.234.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 13/13/13 ms
[R3]ping -c 1 10.0.35.5 PING 10.0.35.5: 56 data bytes, press CTRL_C to break Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=32 ms
--- 10.0.35.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 32/32/32 ms
Step 2 Configure multi-area OSPF. On R1, configure GigabitEthernet 0/0/0 in area 0, and Loopback 0 interface in area 2. Change the network type of the loopback interfaces in all OSPF areas to broadcast to help OSPF advertise actual subnet masks of the loopback interfaces. [R1]ospf 1 router-id 10.0.1.1 [R1-ospf-1]area 0 [R1-ospf-1-area-0.0.0.0]network 10.1.234.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]area 2 [R1-ospf-1-area-0.0.0.2]network 10.0.1.1 0.0.0.0 [R1-ospf-1-area-0.0.0.2]interface LoopBack 0 [R1-LoopBack0]ospf network-type broadcast
All interfaces of R2 and R4 belong to area 0.
72
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures [R2]ospf 1 router-id 10.0.2.2 [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]network 10.1.234.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]interface LoopBack 0 [R2-LoopBack0]ospf network-type broadcast
[R4]ospf 1 router-id 10.0.4.4 [R4-ospf-1]area 0 [R4-ospf-1-area-0.0.0.0]network 10.1.234.4 0.0.0.0 [R4-ospf-1-area-0.0.0.0]network 10.0.4.4 0.0.0.0 [R4-ospf-1-area-0.0.0.0]interface LoopBack 0 [R4-LoopBack0]ospf network-type broadcast
On R3, configure Loopback 0 and GigabitEthernet 0/0/0 interfaces to belong to area 0, and serial 3/0/0 to belong to area 2. [R3]ospf 1 router-id 10.0.3.3 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 10.1.234.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]area 1 [R3-ospf-1-area-0.0.0.1]network 10.0.35.3 0.0.0.0 [R3-ospf-1-area-0.0.0.1]interface LoopBack 0 [R3-LoopBack0]ospf network-type broadcast [R3-LoopBack0]quit
On R5, configure serial 1/0/0 to belong to area 1, and Loopback 0 not to belong to any OSPF area. [R5]ospf 1 router-id 10.0.5.5 [R5-ospf-1]area 1 [R5-ospf-1-area-0.0.0.1]network 10.0.35.5 0.0.0.0
View the routing table on R1. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 14
Destination/Mask
HC Series
Proto
Routes : 14
Pre Cost
Flags NextHop
HUAWEI TECHNOLOGIES
Interface
73
HCNP-IERN Chapter 2 Implementing OSPF design structures 10.0.1.0/24
Direct 0
0
D
10.0.1.1
LoopBack0
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.1.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.2.0/24
OSPF
10
1
D
10.1.234.2
GigabitEthernet0/0/0
10.0.3.0/24
OSPF
10
1
D
10.1.234.3
GigabitEthernet0/0/0
10.0.4.0/24
OSPF
10
1
D
10.1.234.4
GigabitEthernet0/0/0
10.0.35.0/24
OSPF
10
1563
D
10.1.234.3
GigabitEthernet0/0/0 GigabitEthernet0/0/0
10.1.234.0/24
Direct 0
0
D
10.1.234.1
10.1.234.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.1.234.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
The routing table on R1 contains all routes of the entire network except the routes of 10.0.5.5/24 that are not advertised to OSPF areas. Test the network connectivity. [R1]ping -c 1 10.0.2.2 PING 10.0.2.2: 56 data bytes, press CTRL_C to break Reply from 10.0.2.2: bytes=56 Sequence=1 ttl=255 time=2 ms
--- 10.0.2.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 2/2/2 ms
[R1]ping -c 1 10.0.4.4 PING 10.0.4.4: 56 data bytes, press CTRL_C to break Reply from 10.0.4.4: bytes=56 Sequence=1 ttl=255 time=3 ms
--- 10.0.4.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 3/3/3 ms
[R3]ping -c 1 10.0.1.1 PING 10.0.1.1: 56 data bytes, press CTRL_C to break Reply from 10.0.1.1: bytes=56 Sequence=1 ttl=255 time=3 ms
74
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures --- 10.0.1.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 3/3/3 ms
Run the display ospf brief command to view basic OSPF information. R1 is an area border router (ABR) because its Loopback 0 is in area 2. The network to which GigabitEthernet 0/0/0 of R1 connects is a broadcast network and R1 is the DR on this network segment. [R1]display ospf brief
OSPF Process 1 with Router ID 10.0.1.1 OSPF Protocol Information
RouterID: 10.0.1.1
Border Router: AREA
Multi-VPN-Instance is not enabled Global DS-TE Mode: Non-Standard IETF Mode Graceful-restart capability: disabled Helper support capability : not configured Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms Default ASE parameters: Metric: 1 Tag: 1 Type: 2 Route Preference: 10 ASE Route Preference: 150 SPF Computation Count: 26 RFC 1583 Compatible Retransmission limitation is disabled Area Count: 2
Nssa Area Count: 0
ExChange/Loading Neighbors: 0
Area: 0.0.0.0 Authtype: None
Area flag: Normal
SPF scheduled Count: 26 ExChange/Loading Neighbors: 0
Interface: 10.1.234.1 (GigabitEthernet0/0/0) Cost: 1
State: DR
Type: Broadcast
MTU: 1500
Priority: 1 Designated Router: 10.1.234.1 Backup Designated Router: 10.1.234.2 Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
HC Series
HUAWEI TECHNOLOGIES
75
HCNP-IERN Chapter 2 Implementing OSPF design structures Area: 0.0.0.2 Authtype: None
Area flag: Normal
SPF scheduled Count: 25 ExChange/Loading Neighbors: 0
Interface: 10.0.1.1 (LoopBack0) Cost: 0
State: DR
Type: Broadcast
MTU: 1500
Priority: 1 Designated Router: 10.0.1.1 Backup Designated Router: 0.0.0.0 Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Run the display ospf peer brief command to view the OSPF neighbor relationships between routers. As the DR, R1 establishes adjacency relationships with all routers on this network segment. View neighbor relationships on R3. A neighbor relationship instead of an adjacency relationship is established between R3 and R4. [R1]display ospf peer brief
OSPF Process 1 with Router ID 10.0.1.1 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
0.0.0.0
GigabitEthernet0/0/0
0.0.0.0
GigabitEthernet0/0/0
10.0.3.3
Full
0.0.0.0
GigabitEthernet0/0/0
10.0.4.4
Full
10.0.2.2
State Full
----------------------------------------------------------------------------
[R3]display ospf peer brief
OSPF Process 1 with Router ID 10.0.3.3 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
State
0.0.0.0
GigabitEthernet0/0/0
10.0.1.1
Full
0.0.0.0
GigabitEthernet0/0/0
10.0.2.2
Full
0.0.0.0
GigabitEthernet0/0/0
10.0.4.4
2-Way
0.0.0.1
Serial3/0/0
10.0.5.5
Full
----------------------------------------------------------------------------
On R5, run the display ospf lsdb command to view the OSPF link
76
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
state database (LSDB). [R5]display ospf lsdb
OSPF Process 1 with Router ID 10.0.5.5 Link State Database
Area: 0.0.0.1 Type
LinkState ID
AdvRouter
Router
10.0.5.5
10.0.5.5
Age Len 1182 48
Sequence
Metric
80000002
1562
Router
10.0.3.3
10.0.3.3
1183 48
80000002
1562
Sum-Net
10.0.3.0
10.0.3.3
1429 28
80000001
0
Sum-Net
10.0.2.0
10.0.3.3
1429 28
80000001
1
Sum-Net
10.0.1.0
10.0.3.3
1429 28
80000001
1
Sum-Net
10.1.234.0
10.0.3.3
1429 28
80000001
1
Sum-Net
10.0.4.0
10.0.3.3
1430 28
80000001
1
Area 1 has only two routers. Therefore, the LSDB of R5 contains only two Type1 LSAs. The other five Type3 LSAs are inter-area routes advertised by R3 to R5. On R2, run the display ospf lsdb command to view OSPF database information. [R2]display ospf lsdb
OSPF Process 1 with Router ID 10.0.2.2 Link State Database
Area: 0.0.0.0 Type
LinkState ID
AdvRouter
Age Len
Sequence
Router
10.0.3.3
10.0.3.3
4 48
80000009
1
Router
10.0.4.4
10.0.4.4
150 48
80000009
1
Router
10.0.2.2
10.0.2.2
149 48
8000000C
1
Router
10.0.1.1
10.0.1.1
149 36
8000000B
1
Network
10.1.234.1
10.0.1.1
149 40
80000007
0
Sum-Net
10.0.35.0
10.0.3.3
1790 28
80000001
Sum-Net
10.0.1.0
10.0.1.1
817 28
80000002
Metric
1562 0
R2 contains four Type1 LSAs and one Type2 LSA. GigabitEthernet 0/0/0 of R2 connects to a broadcast network. The DR on this network generates a Type2 LSA to describe all its neighbors. The AdvRouter field indicates that this LSA is generated by R1 as expected. On R1, run the display ospf lsdb command to view OSPF database HC Series
HUAWEI TECHNOLOGIES
77
HCNP-IERN Chapter 2 Implementing OSPF design structures
information. [R1]display ospf lsdb
OSPF Process 1 with Router ID 10.0.1.1 Link State Database
Area: 0.0.0.0 Type
LinkState ID
AdvRouter
Age Len
Sequence
Router
10.0.3.3
10.0.3.3
447 48
80000009
Metric 1
Router
10.0.4.4
10.0.4.4
592 48
80000009
1
Router
10.0.2.2
10.0.2.2
592 48
8000000C
1
Router
10.0.1.1
10.0.1.1
591 36
8000000B
1
Network
10.1.234.1
10.0.1.1
591 40
80000007
0
Sum-Net
10.0.35.0
10.0.3.3
434 28
80000002
1562
Sum-Net
10.0.1.0
10.0.1.1
1259 28
80000002
0
Area: 0.0.0.2 Type
LinkState ID
AdvRouter
Router
10.0.1.1
10.0.1.1
Age Len 1223 36
Sequence
Metric
80000004
0
Sum-Net
10.0.35.0
10.0.1.1
433 28
80000002
1563
Sum-Net
10.0.3.0
10.0.1.1
541 28
80000002
1
Sum-Net
10.0.2.0
10.0.1.1
909 28
80000002
1
Sum-Net
10.1.234.0
10.0.1.1
1269 28
80000002
1
Sum-Net
10.0.4.0
10.0.1.1
711 28
80000002
1
Loopback 0 of R1 is in area 2. Therefore, R1 has the LSDBs serving two areas: area 0 and area 2. On R4, run the display ospf lsdb command to view OSPF database information. [R4]display ospf lsdb
OSPF Process 1 with Router ID 10.0.4.4 Link State Database
Area: 0.0.0.0 Type
LinkState ID
AdvRouter
Age Len
Sequence
Router
10.0.3.3
10.0.3.3
745 48
80000009
1
Router
10.0.4.4
10.0.4.4
888 48
80000009
1
Router
10.0.2.2
10.0.2.2
889 48
8000000C
1
Router
10.0.1.1
10.0.1.1
889 36
8000000B
1
Network
10.1.234.1
10.0.1.1
889 40
80000007
0
78
HUAWEI TECHNOLOGIES
Metric
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Sum-Net
10.0.35.0
10.0.3.3
732 28
80000002
1562
Sum-Net
10.0.1.0
10.0.1.1
1556 28
80000002
0
The content of LSDB varies according to the role of the OSPF router. Compare the LSDBs of R5, R2, R1, and R4, and find out their differences.
Step 3 Change the priority of the OSPF interface of a router to affect DR election. Configure the priority of G0/0/0 of R3 to 255 to ensure that R3 is the DR on the network segment 10.1.234.0/24. Configure the priority of G0/0/0 of R2 to 254 to ensure that R2 is the BDR on the network segment 10.1.234.0/24. Configure the priority of G0/0/0 of R4 to 0 to ensure that R4 is the DROther router on the network segment 10.1.234.0/24. [R3]interface GigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ospf dr-priority 255
[R2]interface GigabitEthernet 0/0/0 [R2-GigabitEthernet0/0/0]ospf dr-priority 254
[R4]interface GigabitEthernet 0/0/0 [R4-GigabitEthernet0/0/0]ospf dr-priority 0
Disable the G0/0/0 interfaces of R1, R2, R3, and R4 and then enable the G0/0/0 interfaces of R3, R2, R1, and R4 in sequence. This is because the BR and BDR have been elected and cannot be preempted. [R1-GigabitEthernet0/0/0]shutdown
[R2-GigabitEthernet0/0/0]shutdown
[R3-GigabitEthernet0/0/0]shutdown
[R4-GigabitEthernet0/0/0]shutdown
[R1-GigabitEthernet0/0/0]undo shutdown
[R2-GigabitEthernet0/0/0]undo shutdown
[R3-GigabitEthernet0/0/0]undo shutdown
HC Series
HUAWEI TECHNOLOGIES
79
HCNP-IERN Chapter 2 Implementing OSPF design structures
[R4-GigabitEthernet0/0/0]undo shutdown
View the DR/BDR election on the network segment 10.1.234.0/24. [R3]display ospf peer
OSPF Process 1 with Router ID 10.0.3.3 Neighbors
Area 0.0.0.0 interface 10.1.234.3(GigabitEthernet0/0/0)'s neighbors Router ID: 10.0.1.1
Address: 10.1.234.1
State: Full Mode:Nbr is Slave Priority: 1 DR: 10.1.234.3 BDR: 10.1.234.2 MTU: 0 Dead timer due in 29 sec Retrans timer interval: 3 Neighbor is up for 00:02:17 Authentication Sequence: [ 0 ]
Router ID: 10.0.2.2
Address: 10.1.234.2
State: Full Mode:Nbr is Slave Priority: 254 DR: 10.1.234.3 BDR: 10.1.234.2 MTU: 0 Dead timer due in 35 sec Retrans timer interval: 6 Neighbor is up for 00:01:14 Authentication Sequence: [ 0 ]
Router ID: 10.0.4.4
Address: 10.1.234.4
State: Full Mode:Nbr is Master Priority: 0 DR: 10.1.234.3 BDR: 10.1.234.2 MTU: 0 Dead timer due in 32 sec Retrans timer interval: 3 Neighbor is up for 00:01:26 Authentication Sequence: [ 0 ]
Neighbors
Area 0.0.0.1 interface 10.0.35.3(Serial3/0/0)'s neighbors Router ID: 10.0.5.5
Address: 10.0.35.5
State: Full Mode:Nbr is Master Priority: 1 DR: None
BDR: None
MTU: 0
Dead timer due in 27 sec Retrans timer interval: 4
80
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Neighbor is up for 00:53:37 Authentication Sequence: [ 0 ]
After the G0/0/0 interfaces are enabled again, R3 becomes the DR on the network segment and R2 becomes the BDR. View the neighbor relationship between R4 and R1. [R4]display ospf peer 10.0.1.1
OSPF Process 1 with Router ID 10.0.4.4 Neighbors
Area 0.0.0.0 interface 10.1.234.4(GigabitEthernet0/0/0)'s neighbors Router ID: 10.0.1.1
Address: 10.1.234.1
State: 2-Way Mode:Nbr is Slave Priority: 1 DR: 10.1.234.3 BDR: 10.1.234.2 MTU: 0 Dead timer due in 30 sec Retrans timer interval: 0 Neighbor is up for 00:00:00 Authentication Sequence: [ 0 ]
R1 and R4 are both DROther routers and therefore they are the neighbor of each other and remain in the 2-way state.
Step 4 Configure direct routes to be summarized and imported to OSPF areas. Loopback 0 of R5 does not belong to any OSPF area. Import this direct route to OSPF areas. [R5]ospf [R5-ospf-1]import-route direct
View the imported external routes on R1 and R3. [R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 6
Routes : 6
OSPF routing table status :
HC Series
HUAWEI TECHNOLOGIES
81
HCNP-IERN Chapter 2 Implementing OSPF design structures Destinations : 6
Destination/Mask
Proto
Routes : 6
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 OSPF
10
1
D
10.1.234.2
GigabitEthernet0/0/0
10.0.3.0/24 OSPF
10
1
D
10.1.234.3
GigabitEthernet0/0/0
10.0.4.0/24 OSPF
10
1
D
10.1.234.4
GigabitEthernet0/0/0
10.0.5.0/24 O_ASE
150 1
D
10.1.234.3
GigabitEthernet0/0/0
10.0.35.0/24 OSPF
10
D
10.1.234.3
GigabitEthernet0/0/0
10.0.35.3/32 O_ASE
150 1
D
10.1.234.3
GigabitEthernet0/0/0
1563
OSPF routing table status : Destinations : 0
Routes : 0
[R3]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 5
Routes : 5
OSPF routing table status : Destinations : 4
Destination/Mask
Proto
Routes : 4
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
1
D
10.1.234.1
GigabitEthernet0/0/0
10.0.2.0/24 OSPF
10
1
D
10.1.234.2
GigabitEthernet0/0/0
10.0.4.0/24 OSPF
10
1
D
10.1.234.4
GigabitEthernet0/0/0
10.0.5.0/24 O_ASE
150 1
D
10.0.35.5
Serial3/0/0
OSPF routing table status : Destinations : 1
Destination/Mask
Proto
10.0.35.3/32 O_ASE
Routes : 1
Pre Cost
150 1
Flags NextHop
10.0.35.5
Interface
Serial3/0/0
The two external routes 10.0.5.0/24 and 10.0.35.3/32 can be viewed on R1 and R3. 10.0.5.0/24 is the loopback interface of R5. Why does another external route exist? View the routing table on R5. PPP is used for data transmission between R3 and R5, and the IP address of Serial 3/0/0 of R3 is included in 82
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
the routing table of R5 to describe a direct route. Therefore, this route is also advertised after the import-route direct command is run on R5. [R5]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 16
Destination/Mask
Proto
Routes : 16
Pre Cost
Flags NextHop
Interface
10.0.35.0/24
Direct 0
0
D
10.0.35.5
Serial1/0/0
10.0.35.3/32
Direct 0
0
D
10.0.35.3
Serial1/0/0
10.0.35.5/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.35.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
Test the network connectivity. [R1]ping -c 1 10.0.5.5 PING 10.0.5.5: 56 data bytes, press CTRL_C to break Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=254 time=41 ms
--- 10.0.5.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 41/41/41 ms
On R1, view the OSPF external routes in the LSDB. The LSDB of R1 has three external routes: 10.0.5.0/24, 10.0.35.0/24, and 10.0.35.3/32. However, the routing table on R1 has only two external routes. [R1]display ospf lsdb ase
OSPF Process 1 with Router ID 10.0.1.1 Link State Database
Type
: External
Ls id
: 10.0.5.0
Adv rtr
: 10.0.5.5
Ls age
: 834
Len
: 36
Options seq#
: E : 80000001
HC Series
HUAWEI TECHNOLOGIES
83
HCNP-IERN Chapter 2 Implementing OSPF design structures chksum
: 0xa904
Net mask : 255.255.255.0 TOS 0 Metric: 1 E type
: 2
Forwarding Address : 0.0.0.0 Tag
: 1
Priority : Low
Type
: External
Ls id
: 10.0.35.0
Adv rtr
: 10.0.5.5
Ls age
: 1342
Len
: 36
Options
: E
seq#
: 80000001
chksum
: 0x5e31
Net mask : 255.255.255.0 TOS 0 Metric: 1 E type
: 2
Forwarding Address : 0.0.0.0 Tag
: 1
Priority : Low
Type
: External
Ls id
: 10.0.35.3
Adv rtr
: 10.0.5.5
Ls age
: 1344
Len
: 36
Options
: E
seq#
: 80000001
chksum
: 0x404c
Net mask : 255.255.255.255 TOS 0 Metric: 1 E type
: 2
Forwarding Address : 0.0.0.0 Tag
: 1
Priority : Medium
The route 10.0.35.0/24 is provided as an internal route in the routing table. This route can be found in the Type3 LSA of the LSDB of R1. [R1]display ospf lsdb summary 10.0.35.0
84
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
OSPF Process 1 with Router ID 10.0.1.1 Area: 0.0.0.0 Link State Database
Type
: Sum-Net
Ls id
: 10.0.35.0
Adv rtr
: 10.0.3.3
Ls age
: 136
Len
: 28
Options
: E
seq#
: 80000004
chksum
: 0x1ae2
Net mask : 255.255.255.0 Tos 0 metric: 1562 Priority : Low
When the routes advertised by a Type3 LSA and a Type5 LSA share the same network ID and subnet mask, the route advertised by the Type3 LSA takes precedence and is therefore added to the routing table.
Step 5 View different types of LSAs. On R1, view the content of the Type1 LSA 10.0.1.0 in area 0 and area 2. [R1]display ospf lsdb router 10.0.1.1
OSPF Process 1 with Router ID 10.0.1.1 Area: 0.0.0.0 Link State Database
Type
: Router
Ls id
: 10.0.1.1
Adv rtr
: 10.0.1.1
Ls age
: 591
Len
: 36
Options
: ABR E
seq#
: 8000001e
chksum
: 0xbc70
Link count: 1
HC Series
HUAWEI TECHNOLOGIES
85
HCNP-IERN Chapter 2 Implementing OSPF design structures * Link ID: 10.1.234.3 Data
: 10.1.234.1
Link Type: TransNet Metric : 1 Area: 0.0.0.2 Link State Database
Type
: Router
Ls id
: 10.0.1.1
Adv rtr
: 10.0.1.1
Ls age
: 627
Len
: 36
Options
: ABR E
seq#
: 80000008
chksum
: 0x1018
Link count: 1 * Link ID: 10.0.1.0 Date
: 255.255.255.0
Link Type: StubNet Metric : 0 Priority: Low
For Type1 LSAs, the Ls id field indicates the ID of the router that generates this LSA. R1 generates two Type1 LSAs and one is flooded in area 0. R1 connects to a transit network segment in area 0. Therefore, the value of Link Type is TransNet. For a transit network segment, the Link ID field indicates the interface IP address of the DR on this network segment, and Data indicates the IP address of the local interface. The second Type1 LSA is flooded in area 2 by R1. R1 connects to area 2 through a loopback interface. For the loopback interface, the value of Link Type is StubNet. The Link ID field indicates the IP address of the stub network segment, and Data indicates the network mask. On R2, R3, and R4, view the content of the Type2 LSA 10.1.234.0 in area 0. [R2]display ospf lsdb network 10.1.234.3
OSPF Process 1 with Router ID 10.0.2.2 Area: 0.0.0.0
86
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Link State Database
Type
: Network
Ls id
: 10.1.234.3
Adv rtr
: 10.0.3.3
Ls age
: 115
Len
: 40
Options
: E
seq#
: 8000000f
chksum
: 0x807e
Net mask : 255.255.255.0 Priority : Low Attached Router
10.0.3.3
Attached Router
10.0.1.1
Attached Router
10.0.2.2
Attached Router
10.0.4.4
The content of this LSA is the same on R2, R3, and R4. The Adv rtr field indicates that this LSA is generated by R3. The Ls id field of the Type2 LSA indicates the interface IP address of the DR on the network segment, and Attached Router indicates the IDs of all routers. On R1 and R3, view the content of the Type3 LSA 10.0.35.0/24 in area 0. [R3]display ospf lsdb summary 10.0.35.0
OSPF Process 1 with Router ID 10.0.3.3 Area: 0.0.0.0 Link State Database
Type
: Sum-Net
Ls id
: 10.0.35.0
Adv rtr
: 10.0.3.3
Ls age
: 591
Len
: 28
Options
: E
seq#
: 8000000a
chksum
: 0xee8
Net mask : 255.255.255.0 Tos 0 metric: 1562
HC Series
HUAWEI TECHNOLOGIES
87
HCNP-IERN Chapter 2 Implementing OSPF design structures Priority : Low
The preceding information shows that this route is advertised by R3 to area 0. The Ls id field indicates the network address of the target network segment, and Net mask indicates the mask. [R1]display ospf lsdb summary 10.0.35.0
OSPF Process 1 with Router ID 10.0.1.1 Area: 0.0.0.0 Link State Database
Type
: Sum-Net
Ls id
: 10.0.35.0
Adv rtr
: 10.0.3.3
Ls age
: 136
Len
: 28
Options
: E
seq#
: 80000004
chksum
: 0x1ae2
Net mask : 255.255.255.0 Tos 0 metric: 1562 Priority : Low Area: 0.0.0.2 Link State Database
Type
: Sum-Net
Ls id
: 10.0.35.0
Adv rtr
: 10.0.1.1
Ls age
: 382
Len
: 28
Options
: E
seq#
: 80000002
chksum
: 0x42bf
Net mask : 255.255.255.0 Tos 0 metric: 1563 Priority : Low
R1 has two Type3 LSAs that describe 10.0.35.0/24. The Adv rtr field indicates that the LSA in area 0 is generated by R3. As R1 is an ABR, it generates an LSA after receiving the LSA and advertises the generated 88
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
LSA to area 2. On R1, view the content of the Type4 LSA 10.0.5.0 in area 2. The Type4 LSA describes the route to the ASBR. [R1]display ospf lsdb asbr 10.0.5.5
OSPF Process 1 with Router ID 10.0.1.1 Area: 0.0.0.0 Link State Database
Type
: Sum-Asbr
Ls id
: 10.0.5.5
Adv rtr
: 10.0.3.3
Ls age
: 1119
Len
: 28
Options
: E
seq#
: 80000008
chksum
: 0x1df3
Tos 0 metric: 1562 Area: 0.0.0.2 Link State Database
Type
: Sum-Asbr
Ls id
: 10.0.5.5
Adv rtr
: 10.0.1.1
Ls age
: 1118
Len
: 28
Options
: E
seq#
: 80000008
chksum
: 0x41d2
Tos 0 metric: 1563
The preceding information shows that R1 receives a Type4 LSA from R3. The Ls id field indicates the router ID of the ASBR. Because this type of LSA cannot be flooded across OSPF areas, R1 generates a Type4 LSA and advertises it to area 2. This LSA exists in the LSDBs of R2, R3, and R4 in area 0. The ASBR (R5) is in a different area from these routers and therefore they need to learn the location of the ASBR through a Type4 LSA. [R2]display ospf lsdb asbr
HC Series
HUAWEI TECHNOLOGIES
89
HCNP-IERN Chapter 2 Implementing OSPF design structures
OSPF Process 1 with Router ID 10.0.2.2 Area: 0.0.0.0 Link State Database
Type
: Sum-Asbr
Ls id
: 10.0.5.5
Adv rtr
: 10.0.3.3
Ls age
: 1676
Len
: 28
Options
: E
seq#
: 80000008
chksum
: 0x1df3
Tos 0 metric: 1562
This Type4 LSA does not exist in area 1. Routers in the same area do not need to learn the location of the ASBR through this Type4 LSA.
Step 6 Observe the exchange of LSR, LSU, and LSAck packets. Observe the process of sending OSPF Update and ACK packets. On R1, run the debugging ospf packet update and debugging ospf packet ack commands. terminal monitor % Current terminal monitor is on terminal debugging % Current terminal debugging is on debugging ospf packet update OSPF Link State Update PACKET debugging switch is on debugging ospf packet ack OSPF Link State Acknowledgment PACKET debugging switch is on
By default, the OSPF router updates information at 30-minute intervals when the network runs properly. The Loopback 0 interface of R3 is disabled to trigger information query and update. [R3]undo interface LoopBack 0
R1 receives the Update message sent from 10.1.234.3. The 90
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
destination IP address of this message is 224.0.0.5, which indicates all OSPF routers. This message describes a network segment (# Links: 1) and contains the LinkID and LinkData of the network segment. Nov 24 2011 16:08:19.740.1+00:00 R1 RM/6/RMDEBUG: FileID: 0xd0178024 Line: 2178 Level: 0x20 OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0 Nov 24 2011 16:08:19.740.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.3 Nov 24 2011 16:08:19.740.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.5 Nov 24 2011 16:08:19.740.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 4 (Link-State Update) Nov 24 2011 16:08:19.740.5+00:00 R1 RM/6/RMDEBUG: Length: 64, Router: 10.0.3.3 Nov 24 2011 16:08:19.740.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 3671 Nov 24 2011 16:08:19.740.7+00:00 R1 RM/6/RMDEBUG: AuType: 00 Nov 24 2011 16:08:19.740.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): 0 0 0 0 0 0 0 0 Nov 24 2011 16:08:19.740.9+00:00 R1 RM/6/RMDEBUG: # LSAS: 1 Nov 24 2011 16:08:19.740.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1 Nov 24 2011 16:08:19.740.11+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.3.3
Nov 24 2011 16:08:19.740.12+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.3.3
Nov 24 2011 16:08:19.740.13+00:00 R1 RM/6/RMDEBUG:
LSA Age: 1
Nov 24 2011 16:08:19.740.14+00:00 R1 RM/6/RMDEBUG:
Options: ExRouting:ON
Nov 24 2011 16:08:19.740.15+00:00 R1 RM/6/RMDEBUG:
Length: 36, Seq# 8000004f
Nov 24 2011 16:08:19.740.16+00:00 R1 RM/6/RMDEBUG: Nov 24 2011 16:08:19.740.17+00:00 R1 RM/6/RMDEBUG:
CheckSum: 32bf NtBit: 0 VBit: 0 EBit: 0
BBit: 1 Nov 24 2011 16:08:19.740.18+00:00 R1 RM/6/RMDEBUG:
# Links: 1
Nov 24 2011 16:08:19.740.19+00:00 R1 RM/6/RMDEBUG:
LinkID: 10.1.234.3
Nov 24 2011 16:08:19.740.20+00:00 R1 RM/6/RMDEBUG:
LinkData: 10.1.234.3
Nov 24 2011 16:08:19.740.21+00:00 R1 RM/6/RMDEBUG:
LinkType: 2
Nov 24 2011 16:08:19.740.22+00:00 R1 RM/6/RMDEBUG:
TOS# 0 Metric 1
Then R1 receives an ACK message. The content of this message indicates that this message is sent from the BDR. R1 receives this message because the destination address in this message is 224.0.0.5. The serial number (Seq# 8000004f) of this message indicates that this message is the response to the Update message. Nov 24 2011 16:08:20.360.1+00:00 R1 RM/6/RMDEBUG: FileID: 0xd0178024 Line: 2178 Level: 0x20 OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0 Nov 24 2011 16:08:20.360.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.2 Nov 24 2011 16:08:20.360.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.5 Nov 24 2011 16:08:20.360.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 5 (Link-State Ack)
HC Series
HUAWEI TECHNOLOGIES
91
HCNP-IERN Chapter 2 Implementing OSPF design structures Nov 24 2011 16:08:20.360.5+00:00 R1 RM/6/RMDEBUG: Length: 64, Router: 10.0.2.2 Nov 24 2011 16:08:20.360.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 9b07 Nov 24 2011 16:08:20.360.7+00:00 R1 RM/6/RMDEBUG: AuType: 00 Nov 24 2011 16:08:20.360.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): 0 0 0 0 0 0 0 0 Nov 24 2011 16:08:20.360.9+00:00 R1 RM/6/RMDEBUG: # LSA Headers: 2 Nov 24 2011 16:08:20.360.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1 Nov 24 2011 16:08:20.360.11+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.3.3
Nov 24 2011 16:08:20.360.12+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.3.3
Nov 24 2011 16:08:20.360.13+00:00 R1 RM/6/RMDEBUG:
LSA Age: 6
Nov 24 2011 16:08:20.360.14+00:00 R1 RM/6/RMDEBUG: Nov 24 2011 16:08:20.360.15+00:00 R1 RM/6/RMDEBUG:
Options: ExRouting:ON Length: 36, Seq# 8000004f
Nov 24 2011 16:08:20.360.16+00:00 R1 RM/6/RMDEBUG:
CheckSum: 32bf
Finally R1 sends an ACK message. The source address of this message is the interface IP address of the interface GigabitEthernet 0/0/0 of R1 and the destination address is 224.0.0.6. The message is bound for the DR and the BDR. The serial number of this message is also 8000004f. Nov 24 2011 16:08:20.650.1+00:00 R1 RM/6/RMDEBUG: FileID: 0xd0178025 Line: 4383 Level: 0x20 OSPF 1: SEND Packet. Interface: GigabitEthernet0/0/0 Nov 24 2011 16:08:20.650.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.1 Nov 24 2011 16:08:20.650.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.6 Nov 24 2011 16:08:20.650.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 5 (Link-State Ack) Nov 24 2011 16:08:20.650.5+00:00 R1 RM/6/RMDEBUG: Length: 44, Router: 10.0.1.1 Nov 24 2011 16:08:20.650.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 2392 Nov 24 2011 16:08:20.650.7+00:00 R1 RM/6/RMDEBUG: AuType: 00 Nov 24 2011 16:08:20.650.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): 0 0 0 0 0 0 0 0 Nov 24 2011 16:08:20.650.9+00:00 R1 RM/6/RMDEBUG: # LSA Headers: 1 Nov 24 2011 16:08:20.650.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1 Nov 24 2011 16:08:20.650.11+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.3.3
Nov 24 2011 16:08:20.650.12+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.3.3
Nov 24 2011 16:08:20.650.13+00:00 R1 RM/6/RMDEBUG:
LSA Age: 2
Nov 24 2011 16:08:20.650.14+00:00 R1 RM/6/RMDEBUG:
Options: ExRouting:ON
Nov 24 2011 16:08:20.650.15+00:00 R1 RM/6/RMDEBUG: Nov 24 2011 16:08:20.650.16+00:00 R1 RM/6/RMDEBUG:
Length: 36, Seq# 8000004f CheckSum: 32bf
Enable the Loopback 0 interface on R3. [R3]interface loopback 0 [R3-LoopBack0]ip address 10.0.3.3 24
92
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
R1 receives the Update message sent from R3. This message advertises a new network segment and therefore the value of # Links is 2. The network ID and mask of the new network segment are also provided. Nov 24 2011 16:13:50.110.1+00:00 R1 RM/6/RMDEBUG: FileID: 0xd0178024 Line: 2178 Level: 0x20 OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0 Nov 24 2011 16:13:50.110.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.3 Nov 24 2011 16:13:50.110.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.5 Nov 24 2011 16:13:50.110.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 4 (Link-State Update) Nov 24 2011 16:13:50.110.5+00:00 R1 RM/6/RMDEBUG: Length: 76, Router: 10.0.3.3 Nov 24 2011 16:13:50.110.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 8516 Nov 24 2011 16:13:50.110.7+00:00 R1 RM/6/RMDEBUG: AuType: 00 Nov 24 2011 16:13:50.110.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): 0 0 0 0 0 0 0 0 Nov 24 2011 16:13:50.110.9+00:00 R1 RM/6/RMDEBUG: # LSAS: 1 Nov 24 2011 16:13:50.110.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1 Nov 24 2011 16:13:50.110.11+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.3.3
Nov 24 2011 16:13:50.110.12+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.3.3
Nov 24 2011 16:13:50.110.13+00:00 R1 RM/6/RMDEBUG:
LSA Age: 1
Nov 24 2011 16:13:50.110.14+00:00 R1 RM/6/RMDEBUG:
Options: ExRouting:ON
Nov 24 2011 16:13:50.110.15+00:00 R1 RM/6/RMDEBUG:
Length: 48, Seq# 80000056
Nov 24 2011 16:13:50.110.16+00:00 R1 RM/6/RMDEBUG: Nov 24 2011 16:13:50.110.17+00:00 R1 RM/6/RMDEBUG:
CheckSum: d3f6 NtBit: 0 VBit: 0 EBit: 0
BBit: 1 Nov 24 2011 16:13:50.110.18+00:00 R1 RM/6/RMDEBUG:
# Links: 2
Nov 24 2011 16:13:50.110.19+00:00 R1 RM/6/RMDEBUG:
LinkID: 10.1.234.3
Nov 24 2011 16:13:50.110.20+00:00 R1 RM/6/RMDEBUG:
LinkData: 10.1.234.3
Nov 24 2011 16:13:50.110.21+00:00 R1 RM/6/RMDEBUG:
LinkType: 2
Nov 24 2011 16:13:50.110.22+00:00 R1 RM/6/RMDEBUG:
TOS# 0 Metric 1
Nov 24 2011 16:13:50.110.23+00:00 R1 RM/6/RMDEBUG: Nov 24 2011 16:13:50.110.24+00:00 R1 RM/6/RMDEBUG:
LinkID: 10.0.3.3 LinkData: 255.255.255.255
Nov 24 2011 16:13:50.110.25+00:00 R1 RM/6/RMDEBUG:
LinkType: 3
Nov 24 2011 16:13:50.110.26+00:00 R1 RM/6/RMDEBUG:
TOS# 0 Metric 0
Nov 24 2011 16:13:50.110.27+00:00 R1 RM/6/RMDEBUG: Nov 24 2011 16:13:50.360.1+00:00 R1 RM/6/RMDEBUG:
R1 receives the ACK message sent from the BDR. FileID: 0xd0178024 Line: 2178 Level: 0x20 OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0 Nov 24 2011 16:13:50.360.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.2 Nov 24 2011 16:13:50.360.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.5
HC Series
HUAWEI TECHNOLOGIES
93
HCNP-IERN Chapter 2 Implementing OSPF design structures Nov 24 2011 16:13:50.360.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 5 (Link-State Ack) Nov 24 2011 16:13:50.360.5+00:00 R1 RM/6/RMDEBUG: Length: 44, Router: 10.0.2.2 Nov 24 2011 16:13:50.360.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 8147 Nov 24 2011 16:13:50.360.7+00:00 R1 RM/6/RMDEBUG: AuType: 00 Nov 24 2011 16:13:50.360.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): 0 0 0 0 0 0 0 0 Nov 24 2011 16:13:50.360.9+00:00 R1 RM/6/RMDEBUG: # LSA Headers: 1 Nov 24 2011 16:13:50.360.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1 Nov 24 2011 16:13:50.360.11+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.3.3
Nov 24 2011 16:13:50.360.12+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.3.3
Nov 24 2011 16:13:50.360.13+00:00 R1 RM/6/RMDEBUG:
LSA Age: 1
Nov 24 2011 16:13:50.360.14+00:00 R1 RM/6/RMDEBUG:
Options: ExRouting:ON
Nov 24 2011 16:13:50.360.15+00:00 R1 RM/6/RMDEBUG:
Length: 48, Seq# 80000056
Nov 24 2011 16:13:50.360.16+00:00 R1 RM/6/RMDEBUG:
CheckSum: d3f6
Nov 24 2011 16:13:50.360.17+00:00 R1 RM/6/RMDEBUG: Nov 24 2011 16:13:50.570.1+00:00 R1 RM/6/RMDEBUG:
R1 sends an ACK message. FileID: 0xd0178025 Line: 4383 Level: 0x20 OSPF 1: SEND Packet. Interface: GigabitEthernet0/0/0 Nov 24 2011 16:13:50.570.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.1 Nov 24 2011 16:13:50.570.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 224.0.0.6 Nov 24 2011 16:13:50.570.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 5 (Link-State Ack) Nov 24 2011 16:13:50.570.5+00:00 R1 RM/6/RMDEBUG: Length: 44, Router: 10.0.1.1 Nov 24 2011 16:13:50.570.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 8248 Nov 24 2011 16:13:50.570.7+00:00 R1 RM/6/RMDEBUG: AuType: 00 Nov 24 2011 16:13:50.570.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): 0 0 0 0 0 0 0 0 Nov 24 2011 16:13:50.570.9+00:00 R1 RM/6/RMDEBUG: # LSA Headers: 1 Nov 24 2011 16:13:50.570.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1 Nov 24 2011 16:13:50.570.11+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.3.3
Nov 24 2011 16:13:50.570.12+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.3.3
Nov 24 2011 16:13:50.570.13+00:00 R1 RM/6/RMDEBUG:
LSA Age: 1
Nov 24 2011 16:13:50.570.14+00:00 R1 RM/6/RMDEBUG:
Options: ExRouting:ON
Nov 24 2011 16:13:50.570.15+00:00 R1 RM/6/RMDEBUG: Nov 24 2011 16:13:50.570.16+00:00 R1 RM/6/RMDEBUG:
Length: 48, Seq# 80000056 CheckSum: d3f6
View the Request message. In normal cases, a router does not send this message proactively. Restart the OSPF process on R1. R1 sends an LS Request message to R2. reset ospf process Warning: The OSPF process will be reset. Continue? [Y/N]:y 94
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Nov 24 2011 16:31:42.270.1+00:00 R1 RM/6/RMDEBUG: FileID: 0xd0178025 Line: 2842 Level: 0x20 OSPF 1: SEND Packet. Interface: GigabitEthernet0/0/0 Nov 24 2011 16:31:42.270.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.1 Nov 24 2011 16:31:42.270.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 10.1.234.2 Nov 24 2011 16:31:42.270.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 3 (Link-State Req) Nov 24 2011 16:31:42.270.5+00:00 R1 RM/6/RMDEBUG: Length: 144, Router: 10.0.1.1 Nov 24 2011 16:31:42.270.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: a316 Nov 24 2011 16:31:42.270.7+00:00 R1 RM/6/RMDEBUG: AuType: 00 Nov 24 2011 16:31:42.270.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): 0 0 0 0 0 0 0 0 Nov 24 2011 16:31:42.270.9+00:00 R1 RM/6/RMDEBUG: # Requesting LSAs: 10 Nov 24 2011 16:31:42.270.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1 Nov 24 2011 16:31:42.270.11+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.1.1
Nov 24 2011 16:31:42.270.12+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.1.1
Nov 24 2011 16:31:42.270.13+00:00 R1 RM/6/RMDEBUG: LSA Type 1 Nov 24 2011 16:31:42.270.14+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.3.3
Nov 24 2011 16:31:42.270.15+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.3.3
Nov 24 2011 16:31:42.280.1+00:00 R1 RM/6/RMDEBUG: LSA Type 1 Nov 24 2011 16:31:42.280.2+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.4.4
Nov 24 2011 16:31:42.280.3+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.4.4
Nov 24 2011 16:31:42.280.4+00:00 R1 RM/6/RMDEBUG: LSA Type 2 Nov 24 2011 16:31:42.280.5+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.1.234.3
Nov 24 2011 16:31:42.280.6+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.3.3
Nov 24 2011 16:31:42.280.7+00:00 R1 RM/6/RMDEBUG: LSA Type 3 Nov 24 2011 16:31:42.280.8+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.35.0
Nov 24 2011 16:31:42.280.9+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.3.3
Nov 24 2011 16:31:42.280.10+00:00 R1 RM/6/RMDEBUG: LSA Type 3 Nov 24 2011 16:31:42.280.11+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.1.0
Nov 24 2011 16:31:42.280.12+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.1.1
Nov 24 2011 16:31:42.280.13+00:00 R1 RM/6/RMDEBUG: LSA Type 4 Nov 24 2011 16:31:42.280.14+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.5.5
Nov 24 2011 16:31:42.280.15+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.3.3
Nov 24 2011 16:31:42.280.16+00:00 R1 RM/6/RMDEBUG: LSA Type 5 Nov 24 2011 16:31:42.280.17+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.35.0
Nov 24 2011 16:31:42.280.18+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.5.5
Nov 24 2011 16:31:42.280.19+00:00 R1 RM/6/RMDEBUG: LSA Type 5 Nov 24 2011 16:31:42.280.20+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.35.3
Nov 24 2011 16:31:42.280.21+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.5.5
Nov 24 2011 16:31:42.280.22+00:00 R1 RM/6/RMDEBUG: LSA Type 5 Nov 24 2011 16:31:42.280.23+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.5.0
Nov 24 2011 16:31:42.280.24+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.5.5
HC Series
HUAWEI TECHNOLOGIES
95
HCNP-IERN Chapter 2 Implementing OSPF design structures
R1 receives the LS Request message from R3. Nov 24 2011 16:31:48.320.1+00:00 R1 RM/6/RMDEBUG: FileID: 0xd0178024 Line: 2178 Level: 0x20 OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0 Nov 24 2011 16:31:48.320.2+00:00 R1 RM/6/RMDEBUG: Source Address: 10.1.234.3 Nov 24 2011 16:31:48.320.3+00:00 R1 RM/6/RMDEBUG: Destination Address: 10.1.234.1 Nov 24 2011 16:31:48.320.4+00:00 R1 RM/6/RMDEBUG: Ver# 2, Type: 3 (Link-State Req) Nov 24 2011 16:31:48.320.5+00:00 R1 RM/6/RMDEBUG: Length: 48, Router: 10.0.3.3 Nov 24 2011 16:31:48.320.6+00:00 R1 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: c4c2 Nov 24 2011 16:31:48.320.7+00:00 R1 RM/6/RMDEBUG: AuType: 00 Nov 24 2011 16:31:48.320.8+00:00 R1 RM/6/RMDEBUG: Key(ascii): 0 0 0 0 0 0 0 0 Nov 24 2011 16:31:48.320.9+00:00 R1 RM/6/RMDEBUG: # Requesting LSAs: 2 Nov 24 2011 16:31:48.320.10+00:00 R1 RM/6/RMDEBUG: LSA Type 1 Nov 24 2011 16:31:48.320.11+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.1.1
Nov 24 2011 16:31:48.320.12+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.1.1
Nov 24 2011 16:31:48.320.13+00:00 R1 RM/6/RMDEBUG: LSA Type 3 Nov 24 2011 16:31:48.320.14+00:00 R1 RM/6/RMDEBUG:
LS ID: 10.0.1.0
Nov 24 2011 16:31:48.320.15+00:00 R1 RM/6/RMDEBUG:
Adv Rtr: 10.0.1.1
Additional Exercises: Analyzing and Verifying Assume that area 2 has a router R6. What are the differences between R6 and R2/R3 in the procedure for calculating the routes to the network segment 10.0.5.0/24?
When is the Type4 LSA used?
What risks exist if both R1 and R4 are configured as DROther routers?
Final Configurations display current-configuration [V200R001C00SPC200]
96
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures # sysname R1 # interface GigabitEthernet0/0/0 ip address 10.1.234.1 255.255.255.0 # interface LoopBack0 ip address 10.0.1.1 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.1.1 area 0.0.0.0 network 10.1.234.1 0.0.0.0 area 0.0.0.2 network 10.0.1.1 0.0.0.0 # return
display current-configuration [V200R001C00SPC200] # sysname R2 # interface GigabitEthernet0/0/0 ip address 10.1.234.2 255.255.255.0 ospf dr-priority 254 # interface LoopBack0 ip address 10.0.2.2 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.2.2 area 0.0.0.0 network 10.1.234.2 0.0.0.0 network 10.0.2.2 0.0.0.0 # return
display current-configuration [V200R001C00SPC200] # sysname R3 #
HC Series
HUAWEI TECHNOLOGIES
97
HCNP-IERN Chapter 2 Implementing OSPF design structures interface Serial3/0/0 link-protocol ppp ip address 10.0.35.3 255.255.255.0 # interface GigabitEthernet0/0/0 ip address 10.1.234.3 255.255.255.0 ospf dr-priority 255 # interface LoopBack0 ip address 10.0.3.3 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.3.3 area 0.0.0.0 network 10.1.234.3 0.0.0.0 network 10.0.3.3 0.0.0.0 area 0.0.0.1 network 10.0.35.3 0.0.0.0 # return
display current-configuration [V200R001C00SPC200] # sysname R4 # interface GigabitEthernet0/0/0 ip address 10.1.234.4 255.255.255.0 ospf dr-priority 0 # interface LoopBack0 ip address 10.0.4.4 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.4.4 area 0.0.0.0 network 10.1.234.4 0.0.0.0 network 10.0.4.4 0.0.0.0 # return
display current-configuration [V200R001C00SPC200]
98
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures # sysname R5 # interface Serial1/0/0 link-protocol ppp ip address 10.0.35.5 255.255.255.0 # interface LoopBack0 ip address 10.0.5.5 255.255.255.0 # ospf 1 router-id 10.0.5.5 import-route direct area 0.0.0.1 network 10.0.35.5 0.0.0.0 # return
HC Series
HUAWEI TECHNOLOGIES
99
HCNP-IERN Chapter 2 Implementing OSPF design structures
Lab 2-4 OSPF Stub Area and NSSA Learning Objectives The objectives of this lab are to learn and understand how to perform the following operations: •
Configure stub areas in OSPF.
•
Configure Not-So-Stubby Areas (NSSAs) in OSPF.
•
View the content of Type 7 link-state advertisements (LSAs).
•
Comprehend the translation between Type 7 LSAs and Type 5
LSAs.
Topology
Figure 2-4 OSPF stub area and NSSA
100
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Scenario Assume that you are a network administrator of a company that has five ARG3 routers: R1, R2, R3, R4, and R5. Of these routers, R2, R3, and R4 are in the headquarters, R5 is in a branch and connects to R3 through a dedicated line, and R1 is in another branch and connects to R2 through a dedicated line. The network segments 10.0.23.0/24, 10.0.2.0/24, and 10.0.3.0/24 belong to area 0. 10.0.35.0/24 belongs to area 1, which is an NSSA. The Loopback 0 interface of R5 does not belong to any OSPF areas. 10.0.24.0/24 belongs to area 3. The Loopback 0 interface of R4 connects to the Internet and therefore a default route must be configured. The network segments 10.0.12.0/24 and 10.0.1.0/24 belong to area 2, which is a stub area. Fixed IP addresses are used as router IDs to ensure that the router IDs do not change.
Tasks Step 1 Perform basic configurations and IP addressing. Configure IP addresses and subnet masks for all routers. The subnet masks of all loopback interfaces contain 24 binary digits to simulate an independent network segment. system-view Enter system view, return user view with Ctrl+Z. [R1]interface Serial 1/0/0 [R1-Serial1/0/0]ip address 10.0.12.1 24 [R1-Serial1/0/0]quit [R1]interface LoopBack 0 [R1-LoopBack0]ip address 10.0.1.1 24 [R1-LoopBack0]quit
system-view Enter system view, return user view with Ctrl+Z.
HC Series
HUAWEI TECHNOLOGIES
101
HCNP-IERN Chapter 2 Implementing OSPF design structures [R2]interface Serial 1/0/0 [R2-Serial1/0/0]ip address 10.0.12.2 24 [R2-Serial1/0/0]quit [R2]interface Serial 2/0/0 [R2-Serial2/0/0]ip address 10.0.23.2 24 [R2-Serial2/0/0]quit [R2]interface GigabitEthernet 0/0/0 [R2-GigabitEthernet0/0/0]ip address 10.0.24.2 24 [R2-GigabitEthernet0/0/0]quit [R2]interface LoopBack 0 [R2-LoopBack0]ip address 10.0.2.2 24 [R2-LoopBack0]quit
system-view Enter system view, return user view with Ctrl+Z. [R3]interface Serial 2/0/0 [R3-Serial2/0/0]ip address 10.0.23.3 24 [R3-Serial2/0/0]quit [R3]interface Serial 3/0/0 [R3-Serial3/0/0]ip address 10.0.35.3 24 [R3-Serial3/0/0]quit [R3]interface LoopBack 0 [R3-LoopBack0]ip address 10.0.3.3 24 [R3-LoopBack0]quit
system-view Enter system view, return user view with Ctrl+Z. [R4]interface GigabitEthernet 0/0/0 [R4-GigabitEthernet0/0/0]ip address 10.0.24.4 24 [R4-GigabitEthernet0/0/0]quit [R4]interface LoopBack 0 [R4-LoopBack0]ip address 10.0.4.4 24 [R4-LoopBack0]quit
system-view Enter system view, return user view with Ctrl+Z. [R5]interface Serial 1/0/0 [R5-Serial1/0/0]ip address 10.0.35.5 24 [R5-Serial1/0/0]quit [R5]interface LoopBack 0 [R5-LoopBack0]ip address 10.0.5.5 24 [R5-LoopBack0]quit
102
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Test the connectivity of direct links. [R2]ping -c 1 10.0.12.1 PING 10.0.12.1: 56 data bytes, press CTRL_C to break Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=255 time=30 ms
--- 10.0.12.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/30/30 ms
[R2]ping -c 1 10.0.24.4 PING 10.0.24.4: 56 data bytes, press CTRL_C to break Reply from 10.0.24.4: bytes=56 Sequence=1 ttl=255 time=6 ms
--- 10.0.24.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 6/6/6 ms
[R2]ping -c 1 10.0.23.3 PING 10.0.23.3: 56 data bytes, press CTRL_C to break Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=31 ms
--- 10.0.23.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 31/31/31 ms
[R3]ping -c 1 10.0.35.5 PING 10.0.35.5: 56 data bytes, press CTRL_C to break Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=38 ms
--- 10.0.35.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 38/38/38 ms
HC Series
HUAWEI TECHNOLOGIES
103
HCNP-IERN Chapter 2 Implementing OSPF design structures
Step 2 Configure multi-area OSPF. Configure the S1/0/0 and Loopback 0 interfaces of R1 to belong to area 0. Change the network type of the loopback interfaces in all OSPF areas to Broadcast so that OSPF advertises actual subnet masks of the loopback interfaces. The IP addresses of the Loopback 0 interfaces are used as router IDs. [R1]ospf 1 router-id 10.0.1.1 [R1-ospf-1]area 2 [R1-ospf-1-area-0.0.0.2]network 10.0.12.1 0.0.0.0 [R1-ospf-1-area-0.0.0.2]network 10.0.1.1 0.0.0.0 [R1-ospf-1-area-0.0.0.2]quit [R1-ospf-1]quit [R1]interface LoopBack 0 [R1-LoopBack0]ospf network-type broadcast [R1-LoopBack0]quit
On R2, configure the S2/0/0 and Loopback 0 interfaces to belong to area 0, S1/0/0 to belong to area 2, and G0/0/0 to belong area 3. [R2]ospf 1 router-id 10.0.2.2 [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]quit [R2-ospf-1]area 2 [R2-ospf-1-area-0.0.0.2]network 10.0.12.2 0.0.0.0 [R2-ospf-1-area-0.0.0.2]quit [R2-ospf-1]area 3 [R2-ospf-1-area-0.0.0.3]network 10.0.24.2 0.0.0.0 [R2-ospf-1-area-0.0.0.3]qui [R2-ospf-1]quit [R2]int LoopBack 0 [R2-LoopBack0]ospf network-type broadcast [R2-LoopBack0]quit
On R3, configure the Loopback 0 and S2/0/0 interfaces to belong to area 0, and S3/0/0 to belong to area 1. [R3]ospf 1 router-id 10.0.3.3 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0
104
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures [R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]quit [R3-ospf-1]area 1 [R3-ospf-1-area-0.0.0.1]network 10.0.35.3 0.0.0.0 [R3-ospf-1-area-0.0.0.1]quit [R3-ospf-1]quit [R3]interface LoopBack 0 [R3-LoopBack0]ospf network-type broadcast [R3-LoopBack0]quit
On R4, configure the G0/0/0 interface to belong to area 3, and the Loopback 0 interface not to belong to any OSPF areas. [R4]ospf 1 router-id 10.0.4.4 [R4-ospf-1]area 3 [R4-ospf-1-area-0.0.0.3]network 10.0.24.4 0.0.0.0 [R4-ospf-1-area-0.0.0.3]quit [R4-ospf-1]quit
On R5, configure the S1/0/0 interface to belong to area 1, and the Loopback 0 interface not to belong to any OSPF areas. [R5]ospf 1 router-id 10.0.5.5 [R5-ospf-1]area 1 [R5-ospf-1-area-0.0.0.1]network 10.0.35.5 0.0.0.0 [R5-ospf-1-area-0.0.0.1]quit [R5-ospf-1]quit
View the routing table of R1. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 16
Destination/Mask
Proto
Routes : 16
Pre Cost
Flags NextHop
Interface
10.0.1.0/24
Direct 0
0
D
10.0.1.1
LoopBack0
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.1.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.2.0/24
OSPF
10
1562
D
10.0.12.2
Serial1/0/0
10.0.3.0/24
OSPF
10
3124
D
10.0.12.2
Serial1/0/0
0
D
10.0.12.1
Serial1/0/0
10.0.12.0/24
HC Series
Direct 0
HUAWEI TECHNOLOGIES
105
HCNP-IERN Chapter 2 Implementing OSPF design structures 10.0.12.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.12.2/32
Direct 0
0
D
10.0.12.2
Serial1/0/0
10.0.12.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.23.0/24
OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.24.0/24
OSPF
10
1563
D
10.0.12.2
Serial1/0/0
10.0.35.0/24
OSPF
10
4686
D
10.0.12.2
Serial1/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
Test the network connectivity. [R1]ping -c 1 10.0.35.5 PING 10.0.35.5: 56 data bytes, press CTRL_C to break Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=253 time=114 ms
--- 10.0.35.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 114/114/114 ms
[R1]ping -c 1 10.0.3.3 PING 10.0.3.3: 56 data bytes, press CTRL_C to break Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=74 ms
--- 10.0.3.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 74/74/74 ms
[R1]ping -c 1 10.0.24.4 PING 10.0.24.4: 56 data bytes, press CTRL_C to break Reply from 10.0.24.4: bytes=56 Sequence=1 ttl=254 time=34 ms
--- 10.0.24.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 34/34/34 ms
106
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Step 3 Import external routes to OSPF. Import the network segment 10.0.5.0/24 where the Loopback 0 interface of R5 resides to OSPF areas. Use the default configurations to import the route. [R5]ospf 1 [R5-ospf-1]import-route direct
View this route on R1 and test the network connectivity. [R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 7
Destination/Mask
Proto
Routes : 7
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 OSPF
10
1562
D
10.0.12.2
Serial1/0/0
10.0.3.0/24 OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.5.0/24 O_ASE
150 1
D
10.0.12.2
Serial1/0/0
10.0.23.0/24 OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.24.0/24 OSPF
10
1563
D
10.0.12.2
Serial1/0/0
10.0.35.0/24 OSPF
10
4686
D
10.0.12.2
Serial1/0/0
10.0.35.3/32 O_ASE
150 1
D
10.0.12.2
Serial1/0/0
OSPF routing table status : Destinations : 0
Routes : 0
[R1]ping -c 1 10.0.5.5 PING 10.0.5.5: 56 data bytes, press CTRL_C to break Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=253 time=111 ms
--- 10.0.5.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 111/111/111 ms
HC Series
HUAWEI TECHNOLOGIES
107
HCNP-IERN Chapter 2 Implementing OSPF design structures
On R4, configure a default route whose next hop is the Loopback 0 interface. Import this default route to OSPF areas. Set the type to 1 and cost value to 20, and configure the default route not to be advertised permanently. [R4]ip route-static 0.0.0.0 0.0.0.0 LoopBack 0 [R4]ospf 1 [R4-ospf-1]default-route-advertise type 1 cost 20 [R4-ospf-1]quit
Check whether R1 learns this default route and test the network connectivity. [R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 7
Destination/Mask
0.0.0.0/0
Proto
O_ASE
Routes : 7
Pre Cost
Flags NextHop
Interface
150 1583
D
10.0.12.2
Serial1/0/0
10
1562
D
10.0.12.2
Serial1/0/0
10.0.3.0/24 OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.5.0/24 O_ASE
150 1
D
10.0.12.2
Serial1/0/0
10.0.23.0/24 OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.24.0/24 OSPF
10
1563
D
10.0.12.2
Serial1/0/0
10.0.35.0/24 OSPF
10
4686
D
10.0.12.2
Serial1/0/0
10.0.35.3/32 O_ASE
150 1
D
10.0.12.2
Serial1/0/0
10.0.2.0/24 OSPF
OSPF routing table status : Destinations : 0
Routes : 0
[R1]ping -c 1 10.0.4.4 PING 10.0.4.4: 56 data bytes, press CTRL_C to break Reply from 10.0.4.4: bytes=56 Sequence=1 ttl=254 time=39 ms
--- 10.0.4.4 ping statistics --1 packet(s) transmitted 1 packet(s) received
108
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures 0.00% packet loss round-trip min/avg/max = 39/39/39 ms
Step 4 Configure area 2 as a stub area. View information about OSPF routes on R1. Note that the preceding default route is an external route (O_ASE) and learned through a Type 5 LSA advertised by R4. [R1]display ospf lsdb
OSPF Process 1 with Router ID 10.0.1.1 Link State Database
Area: 0.0.0.2 Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.2.2
10.0.2.2
12 48
80000003
1562
Router
10.0.1.1
10.0.1.1
11 60
80000003
0
Sum-Net
10.0.35.0
10.0.2.2
33 28
80000001
3124
Sum-Net
10.0.24.0
10.0.2.2
33 28
80000001
1
Sum-Net
10.0.3.0
10.0.2.2
33 28
80000001
1562
Sum-Net
10.0.2.0
10.0.2.2
33 28
80000001
0
Sum-Net
10.0.23.0
10.0.2.2
34 28
80000001
1562
Sum-Asbr 10.0.4.4
10.0.2.2
34 28
80000001
1
Sum-Asbr 10.0.5.5
10.0.2.2
34 28
80000001
3124
AS External Database Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
External 0.0.0.0
10.0.4.4
1049 36
80000002
20
External 10.0.5.0
10.0.5.5
1350 36
80000001
1
External 10.0.35.0
10.0.5.5
1350 36
80000001
1
External 10.0.35.3
10.0.5.5
1350 36
80000001
1
[R1]display ospf lsdb ase 0.0.0.0
OSPF Process 1 with Router ID 10.0.1.1 Link State Database
Type
: External
Ls id
: 0.0.0.0
Adv rtr
: 10.0.4.4
HC Series
HUAWEI TECHNOLOGIES
109
HCNP-IERN Chapter 2 Implementing OSPF design structures Ls age
: 504
Len
: 36
Options
: E
seq#
: 80000002
chksum
: 0xa981
Net mask
: 0.0.0.0
TOS 0 Metric: 20 E type
: 1
Forwarding Address : 0.0.0.0 Tag
: 1
Priority : Low
Configure area 2 as a stub area on R1 and R2. [R1]ospf 1 [R1-ospf-1]area 2 [R1-ospf-1-area-0.0.0.2]stub [R1-ospf-1-area-0.0.0.2]quit [R1-ospf-1]quit
[R2]ospf 1 [R2-ospf-1]area 2 [R2-ospf-1-area-0.0.0.2]stub [R2-ospf-1-area-0.0.0.2]quit [R2-ospf-1]quit
View the routing table of R1 and view information about the learned routes. The external route disappears and the default route becomes an internal route. [R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 6
Routes : 6
OSPF routing table status : Destinations : 6
Destination/Mask
Routes : 6
Proto
Pre Cost
0.0.0.0/0
OSPF
10
1563
D
10.0.12.2
Serial1/0/0
10.0.2.0/24
OSPF
10
1562
D
10.0.12.2
Serial1/0/0
10.0.3.0/24
OSPF
10
3124
D
10.0.12.2
Serial1/0/0
110
Flags NextHop
HUAWEI TECHNOLOGIES
Interface
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures 10.0.23.0/24
OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.24.0/24
OSPF
10
1563
D
10.0.12.2
Serial1/0/0
10.0.35.0/24
OSPF
10
4686
D
10.0.12.2
Serial1/0/0
OSPF routing table status : Destinations : 0
Routes : 0
View the link state database (LSDB) of R1. The LSA that describes the external route also disappears. The default route is learned through a Type 3 LSA. [R1]display ospf lsdb
OSPF Process 1 with Router ID 10.0.1.1 Link State Database
Area: 0.0.0.2 Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.2.2
10.0.2.2
182 48
80000003
1562
Router
10.0.1.1
10.0.1.1
182 60
80000004
0
Sum-Net
0.0.0.0
10.0.2.2
183 28
80000001
1
Sum-Net
10.0.35.0
10.0.2.2
183 28
80000001
Sum-Net
10.0.24.0
10.0.2.2
183 28
80000001
1
Sum-Net
10.0.3.0
10.0.2.2
183 28
80000001
1562
Sum-Net
10.0.2.0
10.0.2.2
184 28
80000001
0
Sum-Net
10.0.23.0
10.0.2.2
184 28
80000001
3124
1562
The details about this Type 3 LSA show that this default route is advertised by R2. This proves that after an area is configured as a stub area, the area border router (ABR) blocks Type 4 and Type 5 LSAs bound for the stub area. The ABR also floods a default route pointing to the ABR itself within the stub area through a Type 3 LSA. [R1]display ospf lsdb summary 0.0.0.0
OSPF Process 1 with Router ID 10.0.1.1 Area: 0.0.0.2 Link State Database
Type
: Sum-Net
Ls id
: 0.0.0.0
Adv rtr
: 10.0.2.2
Ls age
: 114
HC Series
HUAWEI TECHNOLOGIES
111
HCNP-IERN Chapter 2 Implementing OSPF design structures Len
: 28
Options
: None
seq#
: 80000001
chksum
: 0x1f31
Net mask
: 0.0.0.0
Tos 0 metric: 1 Priority
: Low
On R2, configure area 2 as a totally stub area (no-summary). [R2]ospf 1 [R2-ospf-1]area 2 [R2-ospf-1-area-0.0.0.2]stub no-summary [R2-ospf-1-area-0.0.0.2]quit [R2-ospf-1]quit
View the routing table of R1 and it is found that only a default route is learned over OSPF. [R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 1
Routes : 1
OSPF routing table status : Destinations : 1
Destination/Mask
0.0.0.0/0
Routes : 1
Proto
Pre Cost
OSPF
10
1563
Flags NextHop
D
10.0.12.2
Interface
Serial1/0/0
OSPF routing table status : Destinations : 0
Routes : 0
View the LSDB of R1. Besides the Type 1 LSAs generated by R1 and R2, only a Type 3 LSA advertised by R2 is found. This proves that the ABR in a totally stub area blocks Type 3, Type 4, and Type 5 LSAs and generates a Type 3 LSA to advertise a default route that points to the ABR. [R1]display ospf lsdb
112
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures OSPF Process 1 with Router ID 10.0.1.1 Link State Database
Area: 0.0.0.2 Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.2.2
10.0.2.2
167 48
80000004
1562
Router
10.0.1.1
10.0.1.1
166 60
80000006
0
Sum-Net
0.0.0.0
10.0.2.2
549 28
80000001
1
Step 5 Configure area 1 as an NSSA. View the routing table of R3. The route 10.0.5.0/24 advertised by R5 is an external route. [R3]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 6
Destination/Mask
0.0.0.0/0
Proto
O_ASE
Routes : 6
Pre Cost
Flags NextHop
Interface
150 1583
D
10.0.23.2
Serial2/0/0
10.0.1.0/24 OSPF
10
3124
D
10.0.23.2
Serial2/0/0
10.0.2.0/24 OSPF
10
1562
D
10.0.23.2
Serial2/0/0
10.0.5.0/24 O_ASE
150 1
D
10.0.35.5
Serial3/0/0
10.0.12.0/24 OSPF
10
3124
D
10.0.23.2
Serial2/0/0
10.0.24.0/24 OSPF
10
1563
D
10.0.23.2
Serial2/0/0
OSPF routing table status : Destinations : 1
Destination/Mask
Proto
10.0.35.3/32 O_ASE
Routes : 1
Pre Cost
150 1
Flags NextHop
Interface
10.0.35.5
Serial3/0/0
View the routing table and LSDB of R5. R5 learns an external route from R4 and the other routes are internal routes. R5 advertises the route 10.0.5.0/24 through a Type 5 LSA. HC Series
HUAWEI TECHNOLOGIES
113
HCNP-IERN Chapter 2 Implementing OSPF design structures [R5]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 7
Destination/Mask
0.0.0.0/0
Proto
O_ASE
Routes : 7
Pre Cost
Flags NextHop
Interface
150 3145
D
10.0.35.3
Serial1/0/0
10.0.1.0/24 OSPF
10
4686
D
10.0.35.3
Serial1/0/0
10.0.2.0/24 OSPF
10
3124
D
10.0.35.3
Serial1/0/0
10.0.3.0/24 OSPF
10
1562
D
10.0.35.3
Serial1/0/0
10.0.12.0/24 OSPF
10
4686
D
10.0.35.3
Serial1/0/0
10.0.23.0/24 OSPF
10
3124
D
10.0.35.3
Serial1/0/0
10.0.24.0/24 OSPF
10
3125
D
10.0.35.3
Serial1/0/0
OSPF routing table status : Destinations : 0
Routes : 0
[R5]display ospf lsdb
OSPF Process 1 with Router ID 10.0.5.5 Link State Database
Area: 0.0.0.1 Type
LinkState ID
AdvRouter
Router
10.0.5.5
10.0.5.5
882 48
80000004
1562
Router
10.0.3.3
10.0.3.3
1309 48
80000003
1562
Sum-Net
10.0.24.0
10.0.3.3
65 28
80000003
1563
Sum-Net
10.0.12.0
10.0.3.3
819 28
80000001
3124
Sum-Net
10.0.3.0
10.0.3.3
65 28
80000003
0
Sum-Net
10.0.2.0
10.0.3.3
65 28
80000003
1562
Sum-Net
10.0.1.0
10.0.3.3
812 28
80000001
3124
Sum-Net
10.0.23.0
10.0.3.3
65 28
80000003
1562
10.0.3.3
602 28
80000002
1563
AdvRouter
Age Len
Sequence
Metric
10.0.5.5
882 36
80000002
Sum-Asbr 10.0.4.4
Age Len
Sequence
Metric
AS External Database Type
LinkState ID
External 10.0.5.0
114
HUAWEI TECHNOLOGIES
1
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures External 10.0.35.0
10.0.5.5
883 36
80000002
1
External 10.0.35.3
10.0.5.5
883 36
80000002
1
External 0.0.0.0
10.0.4.4
586 36
80000003
20
Configure area 1 where R3 and R5 reside as an NSSA. [R3]ospf [R3-ospf-1]area 1 [R3-ospf-1-area-0.0.0.1]nssa
[R5]ospf [R5-ospf-1]area 1 [R5-ospf-1-area-0.0.0.1]nssa
View the routing table of R3 after neighbor relationships are reestablished. [R3]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 6
Destination/Mask
0.0.0.0/0
Proto
O_ASE
Routes : 6
Pre Cost
Flags NextHop
Interface
150 1583
D
10.0.23.2
Serial2/0/0
10.0.1.0/24 OSPF
10
3124
D
10.0.23.2
Serial2/0/0
10.0.2.0/24 OSPF
10
1562
D
10.0.23.2
Serial2/0/0
10.0.5.0/24 O_NSSA
150 1
D
10.0.35.5
Serial3/0/0
10.0.12.0/24 OSPF
10
3124
D
10.0.23.2
Serial2/0/0
10.0.24.0/24 OSPF
10
1563
D
10.0.23.2
Serial2/0/0
OSPF routing table status : Destinations : 1
Destination/Mask
Proto
Routes : 1
Pre Cost
10.0.35.3/32 O_NSSA 150 1
Flags NextHop
Interface
10.0.35.5
Serial3/0/0
The external route advertised by R5 is displayed as an NSSA-specific external route (O_NSSA) in the routing table of R3. HC Series
HUAWEI TECHNOLOGIES
115
HCNP-IERN Chapter 2 Implementing OSPF design structures
View the routing table of R5. [R5]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 7
Destination/Mask
0.0.0.0/0
Routes : 7
Proto
Pre Cost
O_NSSA 150 1
Flags NextHop
Interface
D
10.0.35.3
Serial1/0/0
10.0.1.0/24 OSPF
10
4686
D
10.0.35.3
Serial1/0/0
10.0.2.0/24 OSPF
10
3124
D
10.0.35.3
Serial1/0/0
10.0.3.0/24 OSPF
10
1562
D
10.0.35.3
Serial1/0/0
10.0.12.0/24 OSPF
10
4686
D
10.0.35.3
Serial1/0/0
10.0.23.0/24 OSPF
10
3124
D
10.0.35.3
Serial1/0/0
10.0.24.0/24 OSPF
10
3125
D
10.0.35.3
Serial1/0/0
OSPF routing table status : Destinations : 0
Routes : 0
The default route is displayed as an external route (O_ASE) before but as an NSSA-specific external route (O_NSSA) now. View the LSDB of R5. [R5]display ospf lsdb
OSPF Process 1 with Router ID 10.0.5.5 Link State Database
Area: 0.0.0.1 Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.5.5
10.0.5.5
811 48
80000007
1562
Router
10.0.3.3
10.0.3.3
811 48
80000007
1562
Sum-Net
10.0.24.0
10.0.3.3
929 28
80000005
1563
Sum-Net
10.0.12.0
10.0.3.3
929 28
80000005
3124
Sum-Net
10.0.3.0
10.0.3.3
929 28
80000005
0
Sum-Net
10.0.2.0
10.0.3.3
929 28
80000005
1562
Sum-Net
10.0.1.0
10.0.3.3
930 28
80000005
3124
Sum-Net
10.0.23.0
10.0.3.3
930 28
80000005
1562
116
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures NSSA
10.0.5.0
10.0.5.5
819 36
80000005
1
NSSA
10.0.35.0
10.0.5.5
819 36
80000006
1
NSSA
10.0.35.3
10.0.5.5
819 36
80000005
1
NSSA
0.0.0.0
10.0.3.3
930 36
80000005
1
The Type 5 LSA disappears and the external routes are advertised through Type 7 LSAs. View details about the default route. [R5]display ospf lsdb nssa 0.0.0.0
OSPF Process 1 with Router ID 10.0.5.5 Area: 0.0.0.1 Link State Database
Type
: NSSA
Ls id
: 0.0.0.0
Adv rtr
: 10.0.3.3
Ls age
: 1149
Len
: 36
Options
: None
seq#
: 80000005
chksum
: 0x7745
Net mask
: 0.0.0.0
TOS 0 Metric: 1 E type
: 2
Forwarding Address : 0.0.0.0 Tag
: 1
Priority
: Low
On R5, the default route is advertised by R4. However, the preceding information shows that this default route is advertised by R3. The NSSA blocks external Type 4 and Type 5 LSAs and the ABR in the NSSA advertises a default route through a Type 7 LSA. The autonomous system boundary router (ASBR) advertises the external routes to the NSSA through Type 7 LSAs. The NSSA differs from the stub area in that the NSSA allows external routes to be imported whereas the stub area does not.
HC Series
HUAWEI TECHNOLOGIES
117
HCNP-IERN Chapter 2 Implementing OSPF design structures
Step 6 Observe the changes caused by NSSA to OSPF. Run the display ospf brief command to view the role of R3 in OSPF. The Border Router field has three values: AREA, AS, and NSSA, where AREA indicates that the router is an ABR, AS indicates that the router is an ASBR, and NSSA indicates that the router has at least one interface in the NSSA. [R3]display ospf brief
OSPF Process 1 with Router ID 10.0.3.3 OSPF Protocol Information
RouterID: 10.0.3.3
Border Router: AREA AS NSSA
Multi-VPN-Instance is not enabled Global DS-TE Mode: Non-Standard IETF Mode Graceful-restart capability: disabled Helper support capability : not configured Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms Default ASE parameters: Metric: 1 Tag: 1 Type: 2 Route Preference: 10 ASE Route Preference: 150 SPF Computation Count: 15 RFC 1583 Compatible Retransmission limitation is disabled Area Count: 2
Nssa Area Count: 1
ExChange/Loading Neighbors: 0
Area: 0.0.0.0 Authtype: None
Area flag: Normal
SPF scheduled Count: 7 ExChange/Loading Neighbors: 0
Interface: 10.0.3.3 (LoopBack0) Cost: 0
State: P-2-P
Type: P2P
MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Interface: 10.0.23.3 (Serial2/0/0) --> 10.0.23.2 Cost: 1562
State: P-2-P
Type: P2P
MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Area: 0.0.0.1
118
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Authtype: None
Area flag:
NSSA
SPF scheduled Count: 8 ExChange/Loading Neighbors: 0 NSSA Translator State: Elected
Interface: 10.0.35.3 (Serial3/0/0) --> 10.0.35.5 Cost: 1562
State: P-2-P
Type: P2P
MTU: 1500
Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Because Type 5 LSAs are not allowed in the NSSA, the ASBR advertises external routes to the NSSA through Type 7 LSAs. Type 7 LSAs are allowed only in the NSSA. Therefore, the ABR in the NSSA translates the received Type 7 LSAs into Type 5 LSAs and then advertises them to other OSPF areas. Observe the translation process on R3. The network segment 10.0.5.0/24 is used as an example to describe how routing information is transmitted. In Type 7 LSAs, the Ls id field indicates the target network segment and Net mask indicates the subnet mask of the target network segment. If the Options field is set to NP, this LSA can be translated into a Type 5 LSA. If the value of Options indicates that this LSA cannot be translated into a Type 5 LSA, the Forwarding Address field can be set to 0.0.0.0; otherwise, the Forwarding Address field cannot be set to 0.0.0.0. The next hop of each imported external route does not point to any OSPF areas. Therefore, the Forwarding Address field is set to the IP address of an interface of the ASBR. This interface must be in the stub area. Here the Forwarding Address field is set to the IP address of the S1/0/0 interface of R5. [R3]display ospf lsdb nssa 10.0.5.0
OSPF Process 1 with Router ID 10.0.3.3 Area: 0.0.0.0 Link State Database
Area: 0.0.0.1 Link State Database
Type
: NSSA
Ls id
: 10.0.5.0
Adv rtr
: 10.0.5.5
Ls age
: 836
Len
: 36
HC Series
HUAWEI TECHNOLOGIES
119
HCNP-IERN Chapter 2 Implementing OSPF design structures Options
: NP
seq#
: 80000001
chksum
: 0xb0c2
Net mask : 255.255.255.0 TOS 0 Metric: 1 E type
: 2
Forwarding Address : 10.0.35.5 Tag
: 1
Priority : Low
View the Type 5 LSA generated by R3 to describe the network segment 10.0.5.0/24. [R3]display ospf lsdb ase 10.0.5.0
OSPF Process 1 with Router ID 10.0.3.3 Link State Database
Type
: External
Ls id
: 10.0.5.0
Adv rtr
: 10.0.3.3
Ls age
: 882
Len
: 36
Options
: E
seq#
: 80000001
chksum
: 0x413e
Net mask : 255.255.255.0 TOS 0 Metric: 1 E type
: 2
Forwarding Address : 10.0.35.5 Tag
: 1
Priority : Low
The values of Ls id, Network Mask, and Forwarding Address are copied from the original Type 7 LSA. In this way, the network segment 10.0.5.0/24 is advertised to other OSPF areas.
Additional Exercises: Analyzing and Verifying Figure out the application scenarios of the NSSA. Analyze the reasons why R3 is defined as the ASBR.
120
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Final Configurations display current-configuration [V200R001C00SPC200] # sysname R1 # interface Serial1/0/0 link-protocol ppp ip address 10.0.12.1 255.255.255.0 # interface LoopBack0 ip address 10.0.1.1 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.1.1 area 0.0.0.2 network 10.0.12.1 0.0.0.0 network 10.0.1.1 0.0.0.0 stub # return
display current-configuration [V200R001C00SPC200] # sysname R2 # interface Serial1/0/0 link-protocol ppp ip address 10.0.12.2 255.255.255.0 # interface Serial2/0/0 link-protocol ppp ip address 10.0.23.2 255.255.255.0 # interface GigabitEthernet0/0/0 ip address 10.0.24.2 255.255.255.0 # interface LoopBack0 ip address 10.0.2.2 255.255.255.0 ospf network-type broadcast
HC Series
HUAWEI TECHNOLOGIES
121
HCNP-IERN Chapter 2 Implementing OSPF design structures # ospf 1 router-id 10.0.2.2 area 0.0.0.0 network 10.0.23.2 0.0.0.0 network 10.0.2.2 0.0.0.0 area 0.0.0.2 network 10.0.12.2 0.0.0.0 stub no-summary area 0.0.0.3 network 10.0.24.2 0.0.0.0 # return
display current-configuration [V200R001C00SPC200] # sysname R3 # interface Serial2/0/0 link-protocol ppp ip address 10.0.23.3 255.255.255.0 # interface Serial3/0/0 link-protocol ppp ip address 10.0.35.3 255.255.255.0 # interface LoopBack0 ip address 10.0.3.3 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.3.3 area 0.0.0.0 network 10.0.23.3 0.0.0.0 network 10.0.3.3 0.0.0.0 area 0.0.0.1 network 10.0.35.3 0.0.0.0 nssa # return
display current-configuration [V200R001C00SPC200] #
122
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures sysname R4 # interface GigabitEthernet0/0/0 ip address 10.0.24.4 255.255.255.0 # interface NULL0 # interface LoopBack0 ip address 10.0.4.4 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.4.4 default-route-advertise cost 20 type 1 area 0.0.0.3 network 10.0.24.4 0.0.0.0 # ip route-static 0.0.0.0 0.0.0.0 LoopBack0 # return
display current-configuration [V200R001C00SPC200] # sysname R5 # interface Serial1/0/0 link-protocol ppp ip address 10.0.35.5 255.255.255.0 # interface LoopBack0 ip address 10.0.5.5 255.255.255.0 # ospf 1 router-id 10.0.5.5 import-route direct area 0.0.0.1 network 10.0.35.5 0.0.0.0 nssa # Return
HC Series
HUAWEI TECHNOLOGIES
123
HCNP-IERN Chapter 2 Implementing OSPF design structures
Lab 2-5 OSPF VCs and Inter-Area Route Filtering Learning Objectives The objectives of this lab are to learn and understand how to perform the following operations: •
Repair a discontinuous area 0 using Open Shortest Path First
(OSPF) virtual circuits (VCs). •
Connect non-backbone areas to area 0 using OSPF VCs.
•
Configure inter-area route filtering and control.
Topology
Figure 2-5 OSPF VCs and inter-area route filtering
124
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Scenario Assume that you are a network administrator of a company that has merged two small companies. R4 and R5 are deployed in the two companies respectively. To combine the networks quickly, networks are interconnected using VCs instead of being re-planned. However, it is found that area 0 is discontinuous and there is no direct link between area 0 and area 3. VCs need to be established between R1 and R2 to interconnect area 3 and area 0. VCs also need to be established between R3 and R5 to connect the two parts of area 0, as shown in the preceding figure. Fixed IP addresses are used as router IDs to ensure that the router IDs do not change.
Tasks Step 1 Perform basic configurations and IP addressing. Configure IP addresses and subnet masks for all routers. The subnet masks of all loopback interfaces contain 24 binary digits to simulate an independent network segment. system-view Enter system view, return user view with Ctrl+Z. [R1]interface Serial 3/0/0 [R1-Serial3/0/0]ip address 10.0.14.1 24 [R1-Serial3/0/0]interface Serial 1/0/0 [R1-Serial1/0/0]ip address 10.0.12.1 24 [R1-Serial1/0/0]interface LoopBack 0 [R1-LoopBack0]ip address 10.0.1.1 24
system-view Enter system view, return user view with Ctrl+Z. [R2]interface Serial 1/0/0 [R2-Serial1/0/0]ip address 10.0.12.2 24 [R2-Serial1/0/0]interface Serial 2/0/0 [R2-Serial2/0/0]ip address 10.0.23.2 24 [R2-Serial2/0/0]interface LoopBack 0 [R2-LoopBack0]ip address 10.0.2.2 24
HC Series
HUAWEI TECHNOLOGIES
125
HCNP-IERN Chapter 2 Implementing OSPF design structures system-view Enter system view, return user view with Ctrl+Z. [R3]interface Serial 2/0/0 [R3-Serial2/0/0]ip address 10.0.23.3 24 [R3-Serial2/0/0]interface Serial 3/0/0 [R3-Serial3/0/0]ip address 10.0.35.3 24 [R3-Serial3/0/0]interface LoopBack 0 [R3-LoopBack0]ip address 10.0.3.3 24
system-view Enter system view, return user view with Ctrl+Z. [R4]interface Serial 1/0/0 [R4-Serial1/0/0]ip address 10.0.14.4 24 [R4-Serial1/0/0]interface LoopBack 0 [R4-LoopBack0]ip address 10.0.4.4 24
system-view Enter system view, return user view with Ctrl+Z. [R5]interface Serial 1/0/0 [R5-Serial1/0/0]ip address 10.0.35.5 24 [R5-Serial1/0/0]interface LoopBack 0 [R5-LoopBack0]ip address 10.0.5.5 24
Test whether direct links are reachable. [R1]ping -c 1 10.0.14.4 PING 10.0.14.4: 56 data bytes, press CTRL_C to break Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=39 ms
--- 10.0.14.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 39/39/39 ms
[R1]ping -c 1 10.0.12.2 PING 10.0.12.2: 56 data bytes, press CTRL_C to break Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=29 ms
--- 10.0.12.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss
126
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures round-trip min/avg/max = 29/29/29 ms
[R3]ping -c 1 10.0.23.2 PING 10.0.23.2: 56 data bytes, press CTRL_C to break Reply from 10.0.23.2: bytes=56 Sequence=1 ttl=255 time=45 ms
--- 10.0.23.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 45/45/45 ms
[R3]ping -c 1 10.0.35.5 PING 10.0.35.5: 56 data bytes, press CTRL_C to break Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=32 ms
--- 10.0.35.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 32/32/32 ms
Step 2 Configure multi-area OSPF. On R1, configure the Loopback 0 and S1/0/0 interfaces to belong to area 2, and S3/0/0 to belong to area 3. Change the network type of the loopback interfaces in all OSPF areas to Broadcast so that OSPF advertises actual subnet masks of the loopback interfaces. The IP addresses of the Loopback 0 interfaces are used as router IDs. [R1]ospf 1 router-id 10.0.1.1 [R1-ospf-1]area 2 [R1-ospf-1-area-0.0.0.2]network 10.0.12.1 0.0.0.0 [R1-ospf-1-area-0.0.0.2]network 10.0.1.1 0.0.0.0 [R1-ospf-1-area-0.0.0.2]area 3 [R1-ospf-1-area-0.0.0.3]network 10.0.14.1 0.0.0.0 [R1-ospf-1-area-0.0.0.3]interface LoopBack 0 [R1-LoopBack0]ospf network-type broadcast
On R2, configure the Loopback 0 and S2/0/0 interfaces to belong to area 0, and S1/0/0 to belong to area 2.
HC Series
HUAWEI TECHNOLOGIES
127
HCNP-IERN Chapter 2 Implementing OSPF design structures [R2]ospf 1 router-id 10.0.2.2 [R2-ospf-1]area 2 [R2-ospf-1-area-0.0.0.2]network 10.0.12.2 0.0.0.0 [R2-ospf-1-area-0.0.0.2]area 0 [R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]int LoopBack 0 [R2-LoopBack0]ospf network-type broadcast
On R3, configure the Loopback 0 and S2/0/0 interfaces to belong to area 0, and S3/0/0 to belong to area 1. [R3]ospf 1 router-id 10.0.3.3 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]area 1 [R3-ospf-1-area-0.0.0.1]network 10.0.35.3 0.0.0.0 [R3-ospf-1-area-0.0.0.1]interface LoopBack 0 [R3-LoopBack0]ospf network-type broadcast
On R4, configure the Loopback 0 and S1/0/0 interfaces to belong to area 3. [R4]ospf 1 router-id 10.0.4.4 [R4-ospf-1]area 3 [R4-ospf-1-area-0.0.0.3]network 10.0.14.4 0.0.0.0 [R4-ospf-1-area-0.0.0.3]network 10.0.4.4 0.0.0.0 [R4-ospf-1-area-0.0.0.3]interface LoopBack 0 [R4-LoopBack0]ospf network-type broadcast
On R5, configure S1/0/0 to belong to area 1, and the Loopback 0 interface to belong area 0. [R5]ospf 1 router-id 10.0.5.5 [R5-ospf-1]area 0 [R5-ospf-1-area-0.0.0.0]network 10.0.5.5 0.0.0.0 [R5-ospf-1-area-0.0.0.0]area 1 [R5-ospf-1-area-0.0.0.1]network 10.0.35.5 0.0.0.0 [R5-ospf-1-area-0.0.0.1]interface LoopBack 0 [R5-LoopBack0]ospf network-type broadcast
128
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Step 3 View the routing table of each router. View the routing table of R4. R4 does not learn OSPF routes though it establishes a neighbor relationship with R1. [R4]display ip routing-table protocol ospf [R4]display ospf peer
OSPF Process 1 with Router ID 10.0.4.4 Neighbors
Area 0.0.0.3 interface 10.0.14.4(Serial1/0/0)'s neighbors Router ID: 10.0.1.1
Address: 10.0.14.1
State: Full Mode:Nbr is Slave Priority: 1 DR: None
BDR: None
MTU: 0
Dead timer due in 39 sec Retrans timer interval: 4 Neighbor is up for 00:21:33 Authentication Sequence: [ 0 ]
View the link state database (LSDB) of R4. Only Type 1 link-state advertisements (LSAs) are found. This indicates that R1 does not advertise the routes of other OSPF areas to area 3. [R4]display ospf lsdb
OSPF Process 1 with Router ID 10.0.4.4 Link State Database
Area: 0.0.0.3 Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.4.4
10.0.4.4
571 60
80000005
0
Router
10.0.1.1
10.0.1.1
616 48
80000003
1562
View the routing table of R1. The route 10.0.5.0/24 is not found. Analyze the LSDB of R3 to find the cause. [R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 5
HC Series
Routes : 5
HUAWEI TECHNOLOGIES
129
HCNP-IERN Chapter 2 Implementing OSPF design structures OSPF routing table status : Destinations : 5
Destination/Mask
Proto
Routes : 5
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 OSPF
10
1562
D
10.0.12.2
Serial1/0/0
10.0.3.0/24 OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.4.0/24 OSPF
10
1562
D
10.0.14.4
Serial3/0/0
10.0.23.0/24 OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.35.0/24 OSPF
10
4686
D
10.0.12.2
Serial1/0/0
OSPF routing table status : Destinations : 0
Routes : 0
View the LSDB of R1. According to OSPF, routing information cannot be directly advertised between non-backbone areas to avoid inter-area routing loops. The information in the LSDB of R1 shows that the area border router (ABR) does not forward the Type 3 LSAs sent from non-backbone areas. There are four inter-area routes in area 2 and these routes are learned from R2 (10.0.2.2). R1 does not forward the LSAs that describe these routes to area 3 and therefore R4 cannot learn these routes. The ABR does not advertise the routes learned from a non-backbone area to another non-backbone area. The routes learned by R1 from R4 are not advertised to area 2 through Type 3 LSAs. Therefore, R2, R3, and R5 cannot learn the routes in area 3. [R1]display ospf lsdb
OSPF Process 1 with Router ID 10.0.1.1 Link State Database
Area: 0.0.0.2 Type
LinkState ID
AdvRouter
Router
10.0.2.2
10.0.2.2
Router
10.0.1.1
Sum-Net
Age Len
Sequence
Metric
1251 48
80000023
1562
10.0.1.1
1266 60
80000024
0
10.0.35.0
10.0.2.2
1178 28
8000001B
3124
Sum-Net
10.0.3.0
10.0.2.2
1178 28
8000001B
1562
Sum-Net
10.0.2.0
10.0.2.2
1228 28
80000021
0
Sum-Net
10.0.23.0
10.0.2.2
1189 28
8000001B
1562
Area: 0.0.0.3
130
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.4.4
10.0.4.4
855 60
80000024
0
Router
10.0.1.1
10.0.1.1
898 48
80000022
1562
View the routing table of R2. The routes to the network segments 10.0.4.0/24, 10.0.5.0/24, and 10.0.14.0/24 are not found. [R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 3
Routes : 3
OSPF routing table status : Destinations : 3
Destination/Mask
Proto
Routes : 3
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
1562
D
10.0.12.1
Serial1/0/0
10.0.3.0/24 OSPF
10
1562
D
10.0.23.3
Serial2/0/0
10.0.35.0/24 OSPF
10
3124
D
10.0.23.3
Serial2/0/0
OSPF routing table status : Destinations : 0
Routes : 0
View the LSDB of R2. R1 does not advertise the routes in area 3 to R2. Therefore, the routes 10.0.4.0/24 and 10.0.14.0/24 are not found in the routing table of R2. In area 0, R3 does not advertise the route 10.0.5.0/24 to R2. [R2]display ospf lsdb
OSPF Process 1 with Router ID 10.0.2.2 Link State Database
Area: 0.0.0.0 Type
LinkState ID
AdvRouter
Router
10.0.3.3
10.0.3.3
973 60
80000027
0
Router
10.0.2.2
10.0.2.2
972 60
80000028
0
Sum-Net
10.0.35.0
10.0.3.3
984 28
8000001D
1562
Sum-Net
10.0.12.0
10.0.2.2
1035 28
80000022
1562
Sum-Net
10.0.1.0
10.0.2.2
1035 28
80000022
1562
HC Series
Age Len
HUAWEI TECHNOLOGIES
Sequence
Metric
131
HCNP-IERN Chapter 2 Implementing OSPF design structures Area: 0.0.0.2 Type
LinkState ID
AdvRouter
Router
10.0.2.2
10.0.2.2
Router
10.0.1.1
Sum-Net
Age Len
Sequence
Metric
1046 48
80000024
1562
10.0.1.1
1063 60
80000025
0
10.0.35.0
10.0.2.2
973 28
8000001C
3124
Sum-Net
10.0.3.0
10.0.2.2
973 28
8000001C
1562
Sum-Net
10.0.2.0
10.0.2.2
1023 28
80000022
0
Sum-Net
10.0.23.0
10.0.2.2
984 28
8000001C
1562
View the routing table of R3. The routes 10.0.4.0/24, 10.0.5.0/24, and 10.0.14.0/24 are not found. [R3]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 3
Routes : 3
OSPF routing table status : Destinations : 3
Destination/Mask
Proto
Routes : 3
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
3124
D
10.0.23.2
Serial2/0/0
10.0.2.0/24 OSPF
10
1562
D
10.0.23.2
Serial2/0/0
10.0.12.0/24 OSPF
10
3124
D
10.0.23.2
Serial2/0/0
OSPF routing table status : Destinations : 0
Routes : 0
View the LSDB of R3. R3 receives a Type 3 LSA that describes 10.0.5.0/24 from R5 in area 1. According to the defined principle, Type 3 LSAs received from non-backbone areas are not forwarded. Therefore, R3 does not advertise this Type 3 LSA to area 0 and the route 10.0.5.0/24 cannot be learned by R1 and R2. [R3]display ospf lsdb
OSPF Process 1 with Router ID 10.0.3.3 Link State Database
Area: 0.0.0.0
132
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.3.3
10.0.3.3
111 60
80000028
0
Router
10.0.2.2
10.0.2.2
112 60
80000029
0
Sum-Net
10.0.35.0
10.0.3.3
122 28
8000001E
1562
Sum-Net
10.0.12.0
10.0.2.2
175 28
80000023
1562
Sum-Net
10.0.1.0
10.0.2.2
175 28
80000023
1562
Age Len
Sequence
Metric
Area: 0.0.0.1 Type
LinkState ID
AdvRouter
Router
10.0.5.5
10.0.5.5
117 48
8000001E
1562
Router
10.0.3.3
10.0.3.3
117 48
80000020
1562
Sum-Net
10.0.12.0
10.0.3.3
107 28
8000001D
3124
Sum-Net
10.0.3.0
10.0.3.3
128 28
8000001D
0
Sum-Net
10.0.2.0
10.0.3.3
107 28
8000001D
1562
Sum-Net
10.0.1.0
10.0.3.3
108 28
8000001D
3124
Sum-Net
10.0.5.0
10.0.5.5
128 28
8000001D
0
Sum-Net
10.0.23.0
10.0.3.3
124 28
8000001D
1562
The Type 3 LSA that describes the route 10.0.5.0/24 is found in the LSDB of R3, but not found in the routing table of R3. Check the routing table of R5. [R5]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 5
Routes : 5
OSPF routing table status : Destinations : 5
Destination/Mask
Proto
Routes : 5
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
4686
D
10.0.35.3
Serial1/0/0
10.0.2.0/24 OSPF
10
3124
D
10.0.35.3
Serial1/0/0
10.0.3.0/24 OSPF
10
1562
D
10.0.35.3
Serial1/0/0
10.0.12.0/24 OSPF
10
4686
D
10.0.35.3
Serial1/0/0
10.0.23.0/24 OSPF
10
3124
D
10.0.35.3
Serial1/0/0
OSPF routing table status : Destinations : 0
Routes : 0
[R5]display ospf lsdb
HC Series
HUAWEI TECHNOLOGIES
133
HCNP-IERN Chapter 2 Implementing OSPF design structures
OSPF Process 1 with Router ID 10.0.5.5 Link State Database
Area: 0.0.0.0 Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.5.5
10.0.5.5
820 36
80000002
Sum-Net
10.0.35.0
10.0.5.5
861 28
80000001
1562
Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.5.5
10.0.5.5
1096 48
80000003
1562
Router
10.0.3.3
10.0.3.3
1097 48
80000002
1562
Sum-Net
10.0.12.0
10.0.3.3
1129 28
80000001
3124
Sum-Net
10.0.3.0
10.0.3.3
1129 28
80000001
0
Sum-Net
10.0.2.0
10.0.3.3
1129 28
80000001
1562
Sum-Net
10.0.1.0
10.0.3.3
1129 28
80000001
3124
Sum-Net
10.0.5.0
10.0.5.5
861 28
80000001
Sum-Net
10.0.23.0
10.0.3.3
1129 28
80000001
0
Area: 0.0.0.1
0 1562
The routes to 10.0.4.0/24 and 10.0.14.0/24 are not found in the routing table of R5. However, the route to the Loopback 0 interface of R3 is found. R3 has a physical interface connected to area 0 and therefore it can exchange routing information with other routers in area 0. R3 does not add a route to its routing table if the route is learned from a Type 3 LSA that is sent from a non-backbone area. The Loopback 0 interface of R5 is in area 0 and its link type is StubNet in OSPF route calculation. View the Type 1 LSA generated by R3. [R3]display ospf lsdb router 10.0.3.3
OSPF Process 1 with Router ID 10.0.3.3 Area: 0.0.0.0 Link State Database
Type
: Router
Ls id
: 10.0.3.3
Adv rtr
: 10.0.3.3
Ls age
: 732
134
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Len
: 60
Options
: ABR E
seq#
: 80000158
chksum
: 0xde39
Link count: 3 * Link ID: 10.0.3.3 Data
: 255.255.255.255
Link Type: StubNet Metric : 0 Priority : Medium * Link ID: 10.0.2.2 Data
: 10.0.23.3
Link Type: P-2-P Metric : 1562 * Link ID: 10.0.23.0 Data
: 255.255.255.0
Link Type: StubNet Metric : 1562 Priority : Low
The preceding information shows that the link between R3 and R2 is a point-to-point (P2P) link. Routers with P2P, TransNet, or virtual links exchange information with other routes. Therefore, a router that is connected to a backbone area through any of these types of links does not add a route to its routing table if this route is learned from a Type 3 LSA that is sent from a non-backbone area. [R5]display ospf lsdb router 10.0.5.5
OSPF Process 1 with Router ID 10.0.5.5 Area: 0.0.0.0 Link State Database
Type
: Router
Ls id
: 10.0.5.5
Adv rtr
: 10.0.5.5
Ls age
: 583
Len
: 36
Options
: ABR E
seq#
: 80000040
chksum
: 0x6d69
Link count: 1
HC Series
HUAWEI TECHNOLOGIES
135
HCNP-IERN Chapter 2 Implementing OSPF design structures * Link ID: 10.0.5.5 Data
: 255.255.255.255
Link Type: StubNet Metric : 0 Priority : Medium
On R5, only the Loopback 0 interface is in the backbone area. In the LSA that describes this interface, the link type is StubNet, which indicates that the interface does not connect to other routers. Then, R5 receives Type 3 LSAs from non-backbone areas.
Step 4 Connect the two parts of area 0. Configure a VC between R3 and R5. The value of vlink-peer is the router ID of the peer ABR. [R3]ospf 1 [R3-ospf-1]area 1 [R3-ospf-1-area-0.0.0.1]vlink-peer 10.0.5.5
[R5]ospf [R5-ospf-1]area 1 [R5-ospf-1-area-0.0.0.1]vlink-peer 10.0.3.3
Check whether the VC neighbor is in the Full state. [R3]display ospf vlink
OSPF Process 1 with Router ID 10.0.3.3 Virtual Links
Virtual-link Neighbor-id -> 10.0.5.5, Neighbor-State: Full
Interface: 10.0.35.3 (Serial3/0/0) Cost: 1562 State: P-2-P Type: Virtual Transit Area: 0.0.0.1 Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1 GR State: Normal
Observe the changes of routing information. [R3]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib
136
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 4
Routes : 4
OSPF routing table status : Destinations : 4
Destination/Mask
Routes : 4
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
3124
D
10.0.23.2
Serial2/0/0
10.0.2.0/24 OSPF
10
1562
D
10.0.23.2
Serial2/0/0
10.0.5.0/24 OSPF
10
1562
D
10.0.35.5
Serial3/0/0
10.0.12.0/24 OSPF
10
3124
D
10.0.23.2
Serial2/0/0
OSPF routing table status : Destinations : 0
Routes : 0
View the routing table of R3. The route 10.0.5.0/24 is found. Test the network connectivity. R3 can communicate with the network segment to which the Loopback 0 interface of R5 connects. [R3]ping -c 1 10.0.5.5 PING 10.0.5.5: 56 data bytes, press CTRL_C to break Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=255 time=34 ms
--- 10.0.5.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 34/34/34 ms
View the LSDB of R3. dis ospf lsdb
OSPF Process 1 with Router ID 10.0.3.3 Link State Database
Area: 0.0.0.0 Type
LinkState ID
AdvRouter
Router
10.0.5.5
10.0.5.5
1098 48
80000005
0
Router
10.0.3.3
10.0.3.3
1096 72
80000008
0
Router
10.0.2.2
10.0.2.2
920 60
80000006
0
HC Series
Age Len
HUAWEI TECHNOLOGIES
Sequence
Metric
137
HCNP-IERN Chapter 2 Implementing OSPF design structures Sum-Net
10.0.35.0
10.0.3.3
830 28
80000002
1562
Sum-Net
10.0.35.0
10.0.5.5
565 28
80000002
1562
Sum-Net
10.0.12.0
10.0.2.2
1124 28
80000002
1562
Sum-Net
10.0.1.0
10.0.2.2
1110 28
80000002
1562
Sequence
Metric
Area: 0.0.0.1 Type
LinkState ID
AdvRouter
Age Len
Router
10.0.5.5
10.0.5.5
1098 48
80000004
1562
Router
10.0.3.3
10.0.3.3
1096 48
80000003
1562
Sum-Net
10.0.12.0
10.0.3.3
830 28
80000002
3124
Sum-Net
10.0.3.0
10.0.3.3
831 28
80000002
0
Sum-Net
10.0.2.0
10.0.3.3
831 28
80000002
1562
Sum-Net
10.0.1.0
10.0.3.3
831 28
80000002
3124
Sum-Net
10.0.5.0
10.0.5.5
566 28
80000002
0
Sum-Net
10.0.23.0
10.0.3.3
831 28
80000002
1562
R3 receives two Type 1 LSAs from R5. The first LSA is received in area 0 and the VC belongs to area 0. Therefore, the LSA is actually learned through the VC. The other LSA is learned in area 1 and exists before the VC is configured. The route 10.0.5.0/24 is calculated based on the LSA learned from area 0. View details about the Type 1 LSA 10.0.5.5 in the LSDB of R3. [R3]display ospf lsdb router 10.0.5.5
OSPF Process 1 with Router ID 10.0.3.3 Area: 0.0.0.0 Link State Database
Type
: Router
Ls id
: 10.0.5.5
Adv rtr
: 10.0.5.5
Ls age
: 621
Len
: 48
Options
: ABR E
seq#
: 80000005
chksum
: 0x1291
Link count: 2 * Link ID: 10.0.5.0 Data
: 255.255.255.0
Link Type: StubNet
138
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Metric : 0 Priority : Low * Link ID: 10.0.3.3 Data
: 10.0.35.5
Link Type: Virtual Metric : 1562 Area: 0.0.0.1 Link State Database
Type
: Router
Ls id
: 10.0.5.5
Adv rtr
: 10.0.5.5
Ls age
: 621
Len
: 48
Options
: ABR VIRTUAL E
seq#
: 80000004
chksum
: 0x3530
Link count: 2 * Link ID: 10.0.3.3 Data
: 10.0.35.5
Link Type: P-2-P Metric : 1562 * Link ID: 10.0.35.0 Data
: 255.255.255.0
Link Type: StubNet Metric : 1562 Priority : Low
The LSA describes the network segment 10.0.5.0/24 and therefore this route exists on R3. The Type 1 LSA learned from area 1 describes the network segment that interconnects R3 and R5. View the LSDB of R5. [R5]display ospf lsdb
OSPF Process 1 with Router ID 10.0.5.5 Link State Database
Area: 0.0.0.0 Type
LinkState ID
AdvRouter
Router
10.0.5.5
10.0.5.5
577 48
80000005
0
Router
10.0.3.3
10.0.3.3
577 72
80000008
0
HC Series
Age Len
HUAWEI TECHNOLOGIES
Sequence
Metric
139
HCNP-IERN Chapter 2 Implementing OSPF design structures Router
10.0.2.2
10.0.2.2
401 60
80000006
0
Sum-Net
10.0.35.0
10.0.5.5
45 28
80000002
1562
Sum-Net
10.0.35.0
10.0.3.3
312 28
80000002
1562
Sum-Net
10.0.12.0
10.0.2.2
606 28
80000002
1562
Sum-Net
10.0.1.0
10.0.2.2
593 28
80000002
1562
Age Len
Sequence
Metric
Area: 0.0.0.1 Type
LinkState ID
AdvRouter
Router
10.0.5.5
10.0.5.5
578 48
80000004
1562
Router
10.0.3.3
10.0.3.3
578 48
80000003
1562
Sum-Net
10.0.12.0
10.0.3.3
313 28
80000002
3124
Sum-Net
10.0.3.0
10.0.3.3
313 28
80000002
0
Sum-Net
10.0.2.0
10.0.3.3
313 28
80000002
1562
Sum-Net
10.0.1.0
10.0.3.3
313 28
80000002
3124
Sum-Net
10.0.5.0
10.0.5.5
46 28
80000002
Sum-Net
10.0.23.0
10.0.3.3
313 28
80000002
0 1562
The preceding information is the same as that in the LSDB of R3. After a VC is configured between R3 and R5, both routers have interfaces in area 0 and therefore their LSDBs are synchronous.
Step 5 Connect area 3 to area 0 through a VC. Configure a VC between R1 and R2. [R1]ospf 1 [R1-ospf-1]area 2 [R1-ospf-1-area-0.0.0.2]vlink-peer 10.0.2.2 [R1-ospf-1-area-0.0.0.2]quit [R1-ospf-1]quit
[R2]ospf [R2-ospf-1]area 2 [R2-ospf-1-area-0.0.0.2]vlink-peer 10.0.1.1 [R2-ospf-1-area-0.0.0.2]quit [R2-ospf-1]quit
Check the routing table of R4. [R4]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF
140
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Destinations : 7
Routes : 7
OSPF routing table status : Destinations : 7
Destination/Mask
Proto
Routes : 7
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
1562
D
10.0.14.1
Serial1/0/0
10.0.2.0/24 OSPF
10
3124
D
10.0.14.1
Serial1/0/0
10.0.3.0/24 OSPF
10
4686
D
10.0.14.1
Serial1/0/0
10.0.5.0/24 OSPF
10
6248
D
10.0.14.1
Serial1/0/0
10.0.12.0/24 OSPF
10
3124
D
10.0.14.1
Serial1/0/0
10.0.23.0/24 OSPF
10
4686
D
10.0.14.1
Serial1/0/0
10.0.35.0/24 OSPF
10
6248
D
10.0.14.1
Serial1/0/0
OSPF routing table status : Destinations : 0
Routes : 0
The preceding information shows that the routing table of R4 contains all routes of the entire network. Test the network connectivity. [R4]ping -c 1 10.0.5.5 PING 10.0.5.5: 56 data bytes, press CTRL_C to break Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=252 time=132 ms
--- 10.0.5.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 132/132/132 ms
View the LSDB of R1. [R1]display ospf lsdb
OSPF Process 1 with Router ID 10.0.1.1 Link State Database
Area: 0.0.0.0 Type
LinkState ID
AdvRouter
Router
10.0.5.5
10.0.5.5
419 48
80000006
0
Router
10.0.3.3
10.0.3.3
418 72
80000009
0
HC Series
Age Len
HUAWEI TECHNOLOGIES
Sequence
Metric
141
HCNP-IERN Chapter 2 Implementing OSPF design structures Router
10.0.2.2
10.0.2.2
232 72
8000000A
0
Router
10.0.1.1
10.0.1.1
233 36
80000001
1562
Sum-Net
10.0.35.0
10.0.3.3
151 28
80000003
1562
Sum-Net
10.0.35.0
10.0.5.5
1687 28
80000002
1562
Sum-Net
10.0.14.0
10.0.1.1
291 28
80000001
1562
Sum-Net
10.0.12.0
10.0.1.1
291 28
80000001
1562
Sum-Net
10.0.12.0
10.0.2.2
444 28
80000003
1562
Sum-Net
10.0.1.0
10.0.1.1
291 28
80000001
0
Sum-Net
10.0.1.0
10.0.2.2
430 28
80000003
1562
Sum-Net
10.0.4.0
10.0.1.1
291 28
80000001
1562
Age Len
Sequence
Metric
Area: 0.0.0.2 Type
LinkState ID
AdvRouter
Router
10.0.2.2
10.0.2.2
235 48
80000005
1562
Router
10.0.1.1
10.0.1.1
234 60
80000009
0
Sum-Net
10.0.35.0
10.0.2.2
151 28
80000003
3124
Sum-Net
10.0.14.0
10.0.1.1
291 28
80000001
1562
Sum-Net
10.0.3.0
10.0.2.2
234 28
80000003
1562
Sum-Net
10.0.2.0
10.0.2.2
443 28
80000003
0
Sum-Net
10.0.5.0
10.0.2.2
402 28
80000002
3124
Sum-Net
10.0.4.0
10.0.1.1
292 28
80000001
1562
Sum-Net
10.0.23.0
10.0.2.2
286 28
80000003
1562
Age Len
Sequence
Metric
Area: 0.0.0.3 Type
LinkState ID
AdvRouter
Router
10.0.4.4
10.0.4.4
1193 60
80000005
0
Router
10.0.1.1
10.0.1.1
292 48
80000004
1562
Sum-Net
10.0.35.0
10.0.1.1
292 28
80000001
4686
Sum-Net
10.0.12.0
10.0.1.1
294 28
80000001
1562
Sum-Net
10.0.3.0
10.0.1.1
294 28
80000001
3124
Sum-Net
10.0.2.0
10.0.1.1
294 28
80000001
1562
Sum-Net
10.0.1.0
10.0.1.1
294 28
80000001
0
Sum-Net
10.0.5.0
10.0.1.1
294 28
80000001
4686
Sum-Net
10.0.23.0
10.0.1.1
294 28
80000001
3124
After the VC is configured, R1 receives LSAs from area 0 and therefore area 0 and area 3 can exchange routing information. R1 advertises the routing information about area 0 to area 3 through Type 3 LSAs. View the LSDB of R4. [R4]display ospf lsdb
142
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
OSPF Process 1 with Router ID 10.0.4.4 Link State Database
Area: 0.0.0.3 Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.4.4
10.0.4.4
1303 60
80000005
0
Router
10.0.1.1
10.0.1.1
404 48
80000004
1562
Sum-Net
10.0.35.0
10.0.1.1
404 28
80000001
4686
Sum-Net
10.0.12.0
10.0.1.1
404 28
80000001
1562
Sum-Net
10.0.3.0
10.0.1.1
404 28
80000001
3124
Sum-Net
10.0.2.0
10.0.1.1
404 28
80000001
1562
Sum-Net
10.0.1.0
10.0.1.1
405 28
80000001
0
Sum-Net
10.0.5.0
10.0.1.1
405 28
80000001
4686
Sum-Net
10.0.23.0
10.0.1.1
405 28
80000001
3124
R4 learns the Type 3 LSAs advertised by R1. The routing table of R4 contains routes of other areas.
Step 6 Configure inter-area route filtering. Restrict the advertisement of the route 10.0.4.0/24 so that R1 can learn this route but R2, R3, and R5 cannot. Configure an access control list (ACL). [R1]acl number 2000 [R1-acl-basic-2000]rule deny source 10.0.4.0 0.0.0.255 [R1-acl-basic-2000]rule permit
Configure R1 to filter Type 3 LSAs. R1 is configured to filter Type 3 LSAs that are sent from area 3 to advertise route updates to other areas. [R1]ospf 1 [R1-ospf-1]area 3 [R1-ospf-1-area-0.0.0.3]filter 2000 export
View route filtering status on R2. [R2]dis ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 5
HC Series
Routes : 5
HUAWEI TECHNOLOGIES
143
HCNP-IERN Chapter 2 Implementing OSPF design structures
OSPF routing table status : Destinations : 5
Destination/Mask
Proto
Routes : 5
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
1562
D
10.0.12.1
Serial1/0/0
10.0.3.0/24 OSPF
10
1562
D
10.0.23.3
Serial2/0/0
10.0.5.0/24 OSPF
10
3124
D
10.0.23.3
Serial2/0/0
10.0.14.0/24 OSPF
10
3124
D
10.0.12.1
Serial1/0/0
10.0.35.0/24 OSPF
10
3124
D
10.0.23.3
Serial2/0/0
OSPF routing table status : Destinations : 0
Routes : 0
R2 cannot learn the route 10.0.4.0/24. However, this route is found in the routing table of R1. This is because R1 and R4 are in the same area and R4 advertises this route to R1 through a Type 1 LSA. [R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 6
Routes : 6
OSPF routing table status : Destinations : 6
Destination/Mask
Proto
Routes : 6
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 OSPF
10
1562
D
10.0.12.2
Serial1/0/0
10.0.3.0/24 OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.4.0/24 OSPF
10
1562
D
10.0.14.4
Serial3/0/0
10.0.5.0/24 OSPF
10
4686
D
10.0.12.2
Serial1/0/0
10.0.23.0/24 OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.35.0/24 OSPF
10
4686
D
10.0.12.2
Serial1/0/0
OSPF routing table status : Destinations : 0
144
Routes : 0
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Additional Exercises: Analyzing and Verifying Figure out why area 0 must be continuous in OSPF.
Figure out whether Type 1 and Type 2 LSAs can be filtered.
Final Configurations display current-configuration [V200R001C00SPC200] # sysname R1 # acl number 2000 rule 5 deny source 10.0.4.0 0.0.0.255 rule 10 permit # interface Serial1/0/0 link-protocol ppp ip address 10.0.12.1 255.255.255.0 # interface Serial3/0/0 link-protocol ppp ip address 10.0.14.1 255.255.255.0 # interface LoopBack0 ip address 10.0.1.1 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.1.1 area 0.0.0.0 area 0.0.0.2 network 10.0.1.1 0.0.0.0 network 10.0.12.1 0.0.0.0 vlink-peer 10.0.2.2 area 0.0.0.3 filter 2000 export network 10.0.14.1 0.0.0.0 #
HC Series
HUAWEI TECHNOLOGIES
145
HCNP-IERN Chapter 2 Implementing OSPF design structures return
display current-configuration [V200R001C00SPC200] # sysname R2 # interface Serial1/0/0 link-protocol ppp ip address 10.0.12.2 255.255.255.0 # interface Serial2/0/0 link-protocol ppp ip address 10.0.23.2 255.255.255.0 # interface LoopBack0 ip address 10.0.2.2 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.2.2 area 0.0.0.0 network 10.0.23.2 0.0.0.0 network 10.0.2.2 0.0.0.0 area 0.0.0.2 network 10.0.12.2 0.0.0.0 vlink-peer 10.0.1.1 # return
display current-configuration [V200R001C00SPC200] # sysname R3 # interface Serial2/0/0 link-protocol ppp ip address 10.0.23.3 255.255.255.0 # interface Serial3/0/0 link-protocol ppp ip address 10.0.35.3 255.255.255.0 # interface LoopBack0
146
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures ip address 10.0.3.3 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.3.3 area 0.0.0.0 network 10.0.3.3 0.0.0.0 network 10.0.23.3 0.0.0.0 area 0.0.0.1 network 10.0.35.3 0.0.0.0 vlink-peer 10.0.5.5 # return
display current-configuration [V200R001C00SPC200] # sysname R4 # interface Serial1/0/0 link-protocol ppp ip address 10.0.14.4 255.255.255.0 # interface LoopBack0 ip address 10.0.4.4 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.4.4 area 0.0.0.3 network 10.0.14.4 0.0.0.0 network 10.0.4.4 0.0.0.0 # return
display current-configuration [V200R001C00SPC200] # sysname R5 # interface Serial1/0/0 link-protocol ppp ip address 10.0.35.5 255.255.255.0 # interface LoopBack0
HC Series
HUAWEI TECHNOLOGIES
147
HCNP-IERN Chapter 2 Implementing OSPF design structures ip address 10.0.5.5 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.5.5 area 0.0.0.0 network 10.0.5.5 0.0.0.0 area 0.0.0.1 network 10.0.35.5 0.0.0.0 vlink-peer 10.0.3.3 # Return
148
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Lab 2-6 OSPF Troubleshooting Learning Objectives The objectives of this lab are to learn and understand how to perform the following operations: •
Troubleshoot the mismatch of area IDs in single-area Open
Shortest Path First (OSPF). •
Troubleshoot subnet mask errors in single-area OSPF.
•
Troubleshoot the fault that the interval for sending Hello packets
is different on routers in single-area OSPF. •
Troubleshoot router ID conflicts in single-area OSPF.
•
Troubleshoot OSPF authentication faults.
•
Troubleshoot OSPF route summarization faults.
•
Troubleshoot virtual circuit (VC) faults.
Topology
Figure 2-6 OSPF troubleshooting HC Series
HUAWEI TECHNOLOGIES
149
HCNP-IERN Chapter 2 Implementing OSPF design structures
Scenario Assume that you are a network administrator of a company that uses OSPF for its network. OSPF provides powerful functions but its configurations are complex. In network planning, OSPF features and virtual links are used. Many network communication problems occur in implementation. The problems are finally resolved and the network resumes normal.
Tasks Step 1 Perform basic configurations and IP addressing. Configure IP addresses and subnet masks for all routers. The subnet masks of all loopback interfaces contain 24 binary digits to simulate an independent network segment. system-view Enter system view, return user view with Ctrl+Z. [R1]int Serial 1/0/0 [R1-Serial1/0/0]ip address 10.0.12.1 24 [R1-Serial1/0/0]interface LoopBack 0 [R1-LoopBack0]ip address 10.1.1.1 24
system-view Enter system view, return user view with Ctrl+Z. [R2]int Serial 1/0/0 [R2-Serial1/0/0]ip address 10.0.12.2 24 [R2-Serial1/0/0]interface Serial 2/0/0 [R2-Serial2/0/0]ip address 10.0.23.2 24 [R2-Serial2/0/0]interface LoopBack 0 [R2-LoopBack0]ip address 10.0.2.2 24
To simulate an error, set the IP address of the G0/0/0 interface of R3 to 10.0.75.3/25 and the IP addresses of other interfaces according to the topology. system-view Enter system view, return user view with Ctrl+Z. [R3]interface Serial 2/0/0 [R3-Serial2/0/0]ip address 10.0.23.3 24
150
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures [R3-Serial2/0/0]interface GigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ip address 10.0.75.3 25 [R3-GigabitEthernet0/0/0]interface LoopBack 0 [R3-LoopBack0]ip address 10.0.3.3 24
system-view Enter system view, return user view with Ctrl+Z. [R4]interface GigabitEthernet 0/0/0 [R4-GigabitEthernet0/0/0]ip address 10.0.75.4 24 [R4-GigabitEthernet0/0/0]interface LoopBack 0 [R4-LoopBack0]ip address 10.1.4.4 24
system-view Enter system view, return user view with Ctrl+Z. [R5]interface GigabitEthernet 0/0/0 [R5-GigabitEthernet0/0/0]ip address 10.0.75.5 24 [R5-GigabitEthernet0/0/0]interface LoopBack 0 [R5-LoopBack0]ip address 10.0.5.5 24
Test whether direct links are reachable. [R3]ping -c 1 10.0.75.4 PING 10.0.75.4: 56 data bytes, press CTRL_C to break Reply from 10.0.75.4: bytes=56 Sequence=1 ttl=255 time=5 ms
--- 10.0.75.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 5/5/5 ms
[R3]ping -c 1 10.0.75.5 PING 10.0.75.5: 56 data bytes, press CTRL_C to break Reply from 10.0.75.5: bytes=56 Sequence=1 ttl=255 time=5 ms
--- 10.0.75.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 5/5/5 ms
[R3]ping -c 1 10.0.23.2 PING 10.0.23.2: 56 data bytes, press CTRL_C to break
HC Series
HUAWEI TECHNOLOGIES
151
HCNP-IERN Chapter 2 Implementing OSPF design structures Reply from 10.0.23.2: bytes=56 Sequence=1 ttl=255 time=41 ms
--- 10.0.23.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 41/41/41 ms
[R1]ping -c 1 10.0.12.2 PING 10.0.12.2: 56 data bytes, press CTRL_C to break Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=37 ms
--- 10.0.12.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 37/37/37 ms
Step 2 Configure multi-area OSPF. Configure the S1/0/0 and Loopback 0 interfaces of R1 to belong to area 2. The IP address of the Loopback 0 interface is used as the ID of R1. Change the network type of the loopback interfaces in all OSPF areas to Broadcast so that OSPF advertises actual subnet masks of the loopback interfaces. [R1]ospf 1 router-id 10.1.1.1 [R1-ospf-1]area 2 [R1-ospf-1-area-0.0.0.2]network 10.0.12.1 0.0.0.0 [R1-ospf-1-area-0.0.0.2]network 10.1.1.1 0.0.0.0 [R1-ospf-1-area-0.0.0.2]interface LoopBack 0 [R1-LoopBack0]ospf network-type broadcast
On R2, configure the Loopback 0 and S2/0/0 interfaces to belong to area 1, and S1/0/0 to belong to area 2. The router ID is not specified in static mode when OSPF is enabled on R2. [R2]ospf 1 [R2-ospf-1]area 1 [R2-ospf-1-area-0.0.0.1]network 10.0.23.2 0.0.0.0 [R2-ospf-1-area-0.0.0.1]network 10.0.2.2 0.0.0.0 [R2-ospf-1-area-0.0.0.1]area 2
152
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures [R2-ospf-1-area-0.0.0.2]network 10.0.12.2 0.0.0.0 [R2-ospf-1-area-0.0.0.2]int LoopBack 0 [R2-LoopBack0]ospf network-type broadcast
On R3, configure the Loopback 0 and S2/0/0 interfaces to belong to area 1, and G0/0/0 to belong to area 0. [R3]ospf 1 router-id 10.0.3.3 [R3-ospf-1]area 1 [R3-ospf-1-area-0.0.0.1]network 10.0.23.3 0.0.0.0 [R3-ospf-1-area-0.0.0.1]network 10.0.3.3 0.0.0.0 [R3-ospf-1-area-0.0.0.1]area 0 [R3-ospf-1-area-0.0.0.0]network 10.0.75.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]interface LoopBack 0 [R3-LoopBack0]ospf network-type broadcast
On R4, configure the G0/0/0 interface to belong to area 1, and the Loopback 0 interface not to belong to any OSPF areas. When configuring the OSPF process, run the ospf 1 router-id command to set the router ID of R4 to 10.0.5.5. [R4]ospf 1 router-id 10.0.5.5 [R4-ospf-1]area 1 [R4-ospf-1-area-0.0.0.1]network 10.0.75.4 0.0.0.0
On R5, configure the Loopback 0 and G0/0/0 interfaces to belong to area 0. [R5]ospf 1 router-id 10.0.5.5 [R5-ospf-1]area 0 [R5-ospf-1-area-0.0.0.0]network 10.0.75.5 0.0.0.0 [R5-ospf-1-area-0.0.0.0]network 10.0.5.5 0.0.0.0 [R5-ospf-1-area-0.0.0.0]interface LoopBack 0 [R5-LoopBack0]ospf network-type broadcast
Step 3 Troubleshoot OSPF faults. View the neighbor list of R4. R4 does not establish neighbor relationships with other routers. [R4]display ospf peer
OSPF Process 1 with Router ID 10.0.5.5
HC Series
HUAWEI TECHNOLOGIES
153
HCNP-IERN Chapter 2 Implementing OSPF design structures
Run the display ospf error command on R3, R4, and R5 to view the OSPF errors. [R3]display ospf error
OSPF Process 1 with Router ID 10.0.3.3 OSPF error statistics
General packet errors: 0
: IP: received my own packet
2450 : Bad packet
0
: Bad version
0
: Bad checksum
1032 : Bad area id
0
: Drop on unnumbered interface
0
: Bad virtual link
0
: Bad authentication type
0
: Bad authentication key
0
: Packet too small
0
: Packet size > ip length
0
: Transmit error
2
: Interface down
0
: Unknown neighbor
2450 : Netmask mismatch
0
: Hello timer mismatch
0
0
: Extern option mismatch
HELLO packet errors:
: Dead timer mismatch
0
: Router id confusion
0
: Virtual neighbor unknown
0
: NBMA neighbor unknown
0
: Invalid Source Address
[R4]display ospf error
OSPF Process 1 with Router ID 10.0.5.5 OSPF error statistics
General packet errors: 0
: IP: received my own packet 1354 : Bad packet
0
: Bad version
0
: Bad checksum
0
: Bad area id
0
: Drop on unnumbered interface
1032 : Bad virtual link
0
: Bad authentication type
0
: Bad authentication key
0
: Packet too small
0
: Packet size > ip length
0
: Transmit error
3
: Interface down
0
: Unknown neighbor
1354 : Netmask mismatch
0
: Hello timer mismatch
0
0
: Extern option mismatch
HELLO packet errors:
: Dead timer mismatch
1155 : Router id confusion
0
: Virtual neighbor unknown
0
0
: Invalid Source Address
: NBMA neighbor unknown
154
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
[R5]display ospf error
OSPF Process 1 with Router ID 10.0.5.5 OSPF error statistics
General packet errors: 0
: IP: received my own packet
1216 : Bad packet
0
: Bad version
0
: Bad checksum
0
: Bad area id
0
: Drop on unnumbered interface
0
: Bad virtual link
0
: Bad authentication type
0
: Bad authentication key
0
: Packet too small
0
: Packet size > ip length
0
: Transmit error
3
: Interface down
0
: Unknown neighbor
1216 : Netmask mismatch
0
: Hello timer mismatch
0
0
: Extern option mismatch
1169 : Router id confusion
0
: Virtual neighbor unknown
0
0
: Invalid Source Address
HELLO packet errors:
: Dead timer mismatch
: NBMA neighbor unknown
The preceding information shows that five types of errors occur on R3, R4, and R5: router ID errors (Router id confusion), subnet mask errors (Netmask mismatch), area ID errors (Bad area id), packet errors (Bad packet), and VC errors (Bad virtual link). Because no VC is configured, VC errors actually indicate area ID errors. If R4 receives an OSPF packet with the area ID 0 over an interface with the area ID 1, R4 considers that this packet is sent through a VC. Actually no VC is configured on R4. Subnet mask errors belong to packet errors. When packet errors occur, rectify subnet mask errors first. First rectify the conflict of router IDs. View the ID of each router to find the routers with the same ID. Or, view system logs by running the display logbuffer command. [R5]display logbuffer Logging buffer configuration and contents: enabled Allowed max buffer size: 1024 Actual buffer size: 512 Channel number: 4, Channel name: logbuffer Dropped messages: 0 Overwritten messages: 0
HC Series
HUAWEI TECHNOLOGIES
155
HCNP-IERN Chapter 2 Implementing OSPF design structures Current messages: 66
Nov 29 2011 13:38:22+00:00 R5 %%01OSPF/4/CONFLICT_ROUTERID_INTF(l)[0]:OSPF Router id conflict is detected on interface. (ProcessId=1, RouterId=10.0.5.5, AreaId=0.0.0.0, InterfaceName=GigabitEthernet0/0/0, IpAddr=10.0.75.5, PacketSrcIp=10.0.75.4)
The preceding information shows that the interface IP address of the router whose ID conflicts with R5 is 10.0.75.4. View the topology and it is found that 10.0.75.4 is the interface IP address of R4. Then view the router ID of R4 and it is found that its ID is the same as that of R5. The area ID of R4 is also incorrect. [R4]display ospf brief
OSPF Process 1 with Router ID 10.0.5.5 OSPF Protocol Information
RouterID: 10.0.5.5
Border Router:
Multi-VPN-Instance is not enabled Global DS-TE Mode: Non-Standard IETF Mode Graceful-restart capability: disabled Helper support capability : not configured Spf-schedule-interval: max 10000ms, start 500ms, hold 1000ms Default ASE parameters: Metric: 1 Tag: 1 Type: 2 Route Preference: 10 ASE Route Preference: 150 SPF Computation Count: 13 RFC 1583 Compatible Retransmission limitation is disabled Area Count: 1
Nssa Area Count: 0
ExChange/Loading Neighbors: 0
Area: 0.0.0.1 Authtype: None
Area flag: Normal
SPF scheduled Count: 2 ExChange/Loading Neighbors: 0
Interface: 10.0.75.4 (GigabitEthernet0/0/0) Cost: 1
State: DR
Type: Broadcast
MTU: 1500
Priority: 1 Designated Router: 10.0.75.4 Backup Designated Router: 0.0.0.0
156
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Timers: Hello 10 , Dead 40 , Poll 120 , Retransmit 5 , Transmit Delay 1
Change the router ID and area ID of R4. [R4]ospf 1 router-id 10.1.4.4 [R4-ospf-1]area 0 [R4-ospf-1-area-0.0.0.0]network 10.0.75.4 0.0.0.0
reset ospf process Warning: The OSPF process will be reset. Continue? [Y/N]:y
Run the reset ospf counter command to reset the OSPF counter. Note that this command must be run in the user view. reset ospf counters
Wait for a moment and then run the display ospf error command to check whether the errors are rectified. display ospf error
OSPF Process 1 with Router ID 10.1.4.4 OSPF error statistics
General packet errors: 0
: IP: received my own packet
2
: Bad packet
0
: Bad version
0
: Bad checksum
0
: Bad area id
0
: Drop on unnumbered interface
0
: Bad virtual link
0
: Bad authentication type
0
: Bad authentication key
0
: Packet too small
0
: Packet size > ip length
0
: Transmit error
0
: Interface down
0
: Unknown neighbor
HELLO packet errors: 2
: Netmask mismatch
0
: Hello timer mismatch
0
: Dead timer mismatch
0
: Extern option mismatch
0
: Router id confusion
0
: Virtual neighbor unknown
0
: NBMA neighbor unknown
0
: Invalid Source Address
The preceding information shows that the router ID error and area ID error are rectified but the subnet mask of a router is incorrect. View debugging information on R4 to identify the router with the incorrect subnet mask.
HC Series
HUAWEI TECHNOLOGIES
157
HCNP-IERN Chapter 2 Implementing OSPF design structures terminal debugging Info: Current terminal debugging is on. debugging ospf packet hello Nov 29 2011 14:56:16.720.1+00:00 R4 RM/6/RMDEBUG: FileID: 0xd0178024 Line: 2178 Level: 0x20 OSPF 1: RECV Packet. Interface: GigabitEthernet0/0/0 Nov 29 2011 14:56:16.720.2+00:00 R4 RM/6/RMDEBUG: Source Address: 10.0.75.3 Nov 29 2011 14:56:16.720.3+00:00 R4 RM/6/RMDEBUG: Destination Address: 224.0.0.5 Nov 29 2011 14:56:16.720.4+00:00 R4 RM/6/RMDEBUG: Ver# 2, Type: 1 (Hello) Nov 29 2011 14:56:16.720.5+00:00 R4 RM/6/RMDEBUG: Length: 44, Router: 10.0.3.3 Nov 29 2011 14:56:16.720.6+00:00 R4 RM/6/RMDEBUG: Area: 0.0.0.0, Chksum: 9a18 Nov 29 2011 14:56:16.720.7+00:00 R4 RM/6/RMDEBUG: AuType: 00 Nov 29 2011 14:56:16.720.8+00:00 R4 RM/6/RMDEBUG: Key(ascii): 0 0 0 0 0 0 0 0 Nov 29 2011 14:56:16.720.9+00:00 R4 RM/6/RMDEBUG: Net Mask: 255.255.255.128 Nov 29 2011 14:56:16.720.10+00:00 R4 RM/6/RMDEBUG: Hello Int: 10, Option: _E_ Nov 29 2011 14:56:16.720.11+00:00 R4 RM/6/RMDEBUG: Rtr Priority: 1, Dead Int: 40 Nov 29 2011 14:56:16.720.12+00:00 R4 RM/6/RMDEBUG: DR: 10.0.75.3 Nov 29 2011 14:56:16.720.13+00:00 R4 RM/6/RMDEBUG: BDR: 0.0.0.0 Nov 29 2011 14:56:16.730.1+00:00 R4 RM/6/RMDEBUG: # Attached Neighbors: 0
The preceding information shows that the subnet mask carried in the Hello packets sent from 10.0.75.3 is 255.255.255.128. View the topology. The subnet mask of R3 is incorrectly configured. [R3-GigabitEthernet0/0/0]display this [V200R001C00SPC200] # interface GigabitEthernet0/0/0 ip address 10.0.75.3 255.255.255.128 # return [R3-GigabitEthernet0/0/0]ip address 10.0.75.3 24
Reset the OSPF counter again and check for errors. reset ospf counters
display ospf error
OSPF Process 1 with Router ID 10.0.3.3 OSPF error statistics
General packet errors: 158
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures 0
: IP: received my own packet
0
: Bad packet
0
: Bad version
0
: Bad checksum
0
: Bad area id
0
: Drop on unnumbered interface
0
: Bad virtual link
0
: Bad authentication type
0
: Bad authentication key
0
: Packet too small
0
: Packet size > ip length
0
: Transmit error
0
: Interface down
0
: Unknown neighbor
HELLO packet errors: 0
: Netmask mismatch
0
: Hello timer mismatch
0
: Dead timer mismatch
0
: Extern option mismatch
0
: Router id confusion
0
: Virtual neighbor unknown
0
: NBMA neighbor unknown
0
: Invalid Source Address
View the neighbor list of R3. All neighbors are in normal status. [R3]display ospf peer brief
OSPF Process 1 with Router ID 10.0.3.3 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
0.0.0.0
GigabitEthernet0/0/0
Neighbor id 10.1.4.4
State Full
0.0.0.0
GigabitEthernet0/0/0
10.0.5.5
Full
0.0.0.1
Serial2/0/0
10.0.2.2
Full
----------------------------------------------------------------------------
Change the interval for R4 to send Hello packets through the G0/0/0 interface to 5 seconds and observe whether neighbor relationships are established. [R4]interface GigabitEthernet 0/0/0 [R4-GigabitEthernet0/0/0]ospf timer hello 5
After about 30 seconds, the neighbors of R4 disappear. [R4]display ospf peer brief
OSPF Process 1 with Router ID 10.1.4.4 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
State
----------------------------------------------------------------------------
HC Series
HUAWEI TECHNOLOGIES
159
HCNP-IERN Chapter 2 Implementing OSPF design structures
View OSPF errors. [R4]display ospf error
OSPF Process 1 with Router ID 10.1.4.4 OSPF error statistics
General packet errors: 0
: IP: received my own packet
2
: Bad packet
0
: Bad version
0
: Bad checksum
0
: Bad area id
0
: Drop on unnumbered interface
0
: Bad virtual link
0
: Bad authentication type
0
: Bad authentication key
0
: Packet too small
0
: Packet size > ip length
0
: Transmit error
0
: Interface down
0
: Unknown neighbor
HELLO packet errors: 0
: Netmask mismatch
2
: Hello timer mismatch
0
: Dead timer mismatch
0
: Extern option mismatch
0
: Router id confusion
0
: Virtual neighbor unknown
0
: NBMA neighbor unknown
0
: Invalid Source Address
The preceding information shows that the interval for sending Hello packets is incorrect on a router. This indicates that the interval for sending Hello packets must be set to the same value on neighbor routers. Cancel the change of the interval for R4 to send Hello packets. View the neighbor list of R4. [R4-GigabitEthernet0/0/0]undo ospf timer hello [R4]display ospf peer brief
OSPF Process 1 with Router ID 10.1.4.4 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
State
0.0.0.0
GigabitEthernet0/0/0
10.0.3.3
Full
0.0.0.0
GigabitEthernet0/0/0
10.0.5.5
Full
----------------------------------------------------------------------------
The neighbor relationships with other routers resume.
160
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Step 4 Troubleshoot OSPF authentication faults. Configure interface-based authentication on R1 and R2. R1 uses plain text authentication and the key is 123. R2 uses MD5 authentication and the key is huawei. [R1]interface Serial 1/0/0 [R1-Serial1/0/0]ospf authentication-mode simple plain 123
[R2]interface Serial 1/0/0 [R2-Serial1/0/0]ospf authentication-mode md5 1 plain huawei
An OSPF error is found on R1. [R1-Serial1/0/0]display ospf error
OSPF Process 1 with Router ID 10.1.1.1 OSPF error statistics
General packet errors: 0
: IP: received my own packet
15
: Bad packet
0
: Bad version
0
: Bad checksum
0
: Bad area id
0
: Drop on unnumbered interface
0
: Bad virtual link
15
: Bad authentication type
0
: Bad authentication key
0
: Packet too small
0
: Packet size > ip length
0
: Transmit error
0
: Interface down
0
: Unknown neighbor
Configure R1 to use MD5 authentication and then check for errors. [R1]interface Serial 1/0/0 [R1-Serial1/0/0]ospf authentication-mode md5 1 plain 123 [R1-Serial1/0/0]return reset ospf counters display ospf error
OSPF Process 1 with Router ID 10.1.1.1 OSPF error statistics
General packet errors: 0
: IP: received my own packet
1
: Bad packet
0
: Bad version
0
: Bad checksum
0
: Bad area id
0
: Drop on unnumbered interface
HC Series
HUAWEI TECHNOLOGIES
161
HCNP-IERN Chapter 2 Implementing OSPF design structures 0
: Bad virtual link
1
: Bad authentication type
0
: Bad authentication key
0
: Packet too small
0
: Packet size > ip length
0
: Transmit error
0
: Interface down
0
: Unknown neighbor
The OSPF error still exists. Change the key to huawei for R1 and then view the neighbor relationships. [R1]interface Serial 1/0/0 [R1-Serial1/0/0] ospf authentication-mode md5 1 plain huawei [R1-Serial1/0/0]quit [R1]display ospf peer brief
OSPF Process 1 with Router ID 10.1.1.1 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
State
0.0.0.2
Serial1/0/0
10.0.2.2
Full
----------------------------------------------------------------------------
The preceding information shows that R1 establishes a neighbor relationship with R2.
Step 5 Troubleshoot VC faults. Configure a VC between R2 and R3 for communication between area 2 and area 0. [R2]ospf 1 [R2-ospf-1]area 1 [R2-ospf-1-area-0.0.0.1]vlink-peer 10.0.3.3
[R3]ospf 1 [R3-ospf-1]area 1 [R3-ospf-1-area-0.0.0.1]vlink-peer 10.0.2.2
Check whether the VC is configured successfully and whether R1 learns the routes of the entire network. [R2]display ospf vlink
OSPF Process 1 with Router ID 10.0.2.2
162
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Virtual Links
Virtual-link Neighbor-id -> 10.0.3.3, Neighbor-State: Full
Interface: 10.0.23.2 (Serial2/0/0) Cost: 1562 State: P-2-P Type: Virtual Transit Area: 0.0.0.1 Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1 GR State: Normal
[R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 5
Routes : 5
OSPF routing table status : Destinations : 5
Destination/Mask
Routes : 5
Proto
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 OSPF
10
1562
D
10.0.12.2
Serial1/0/0
10.0.3.0/24 OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.5.0/24 OSPF
10
3125
D
10.0.12.2
Serial1/0/0
10.0.23.0/24 OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.75.0/24 OSPF
10
3125
D
10.0.12.2
Serial1/0/0
OSPF routing table status : Destinations : 0
Routes : 0
Test the route from R1 to R5 and it is found that this route is reachable. [R1]ping -c 1 10.0.5.5 PING 10.0.5.5: 56 data bytes, press CTRL_C to break Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=253 time=81 ms
--- 10.0.5.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 81/81/81 ms
HC Series
HUAWEI TECHNOLOGIES
163
HCNP-IERN Chapter 2 Implementing OSPF design structures
Disable the Loopback 0 interface of R2. [R2]undo interface LoopBack 0
R2 restarts due to an accident. Simulate a restart of R2 by restarting the OSPF process on R2. reset ospf process Warning: The OSPF process will be reset. Continue? [Y/N]:y
Users connected to R1 cannot access routers in other areas. Log in to R1 and it is found that R1 cannot communicate with the Loopback 0 interface of R5. [R1]ping -c 1 10.0.5.5 PING 10.0.5.5: 56 data bytes, press CTRL_C to break Request time out
--- 10.0.5.5 ping statistics --1 packet(s) transmitted 0 packet(s) received 100.00% packet loss
Check the VC between R2 and R3. The VC is in abnormal status and the router ID of R2 changes. [R2]display ospf vlink
OSPF Process 1 with Router ID 10.0.23.2 Virtual Links
Virtual-link Neighbor-id -> 10.0.3.3, Neighbor-State: Down
Interface: 10.0.23.2 (Serial2/0/0) Cost: 1562 State: P-2-P Type: Virtual Transit Area: 0.0.0.1 Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1 GR State: Normal
The VC is established based on the router ID of R2. The VC is faulty because the router ID of R2 changes. Typically, the ID of a router is specified when the OSPF process is started on the router. This is to ensure that the router ID does not change. 164
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Set the router ID of R2 to 10.0.2.2 and enable the Loopback 0 interface of R2. Then restart the OSPF process. [R2]ospf 1 router-id 10.0.2.2 Info: The configuration succeeded. You need to restart the OSPF process to validate the new router ID. [R2-ospf-1]interface LoopBack 0 [R2-LoopBack0]ip address 10.0.2.2 24 [R2-LoopBack0]quit reset ospf process Warning: The OSPF process will be reset. Continue? [Y/N]:y
View the status of the VC. [R2]display ospf vlink
OSPF Process 1 with Router ID 10.0.2.2 Virtual Links
Virtual-link Neighbor-id -> 10.0.3.3, Neighbor-State: Full
Interface: 10.0.23.2 (Serial2/0/0) Cost: 1562 State: P-2-P Type: Virtual Transit Area: 0.0.0.1 Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1 GR State: Normal
The VC resumes normal. To ensure security, area-based authentication is enabled in area 0 and MD5 is used to encrypt packets. The key is huawei. [R3]ospf 1 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain huawei
[R4]ospf 1 [R4-ospf-1]area 0 [R4-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain huawei
[R5]ospf 1 [R5-ospf-1]area 0 [R5-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain huawei
It is found that users in area 2 cannot access routers in other areas. HC Series
HUAWEI TECHNOLOGIES
165
HCNP-IERN Chapter 2 Implementing OSPF design structures
Check the VC and it is found faulty. [R2]dis ospf vlink
OSPF Process 1 with Router ID 10.0.2.2 Virtual Links
Virtual-link Neighbor-id -> 10.0.3.3, Neighbor-State: Down
Interface: 10.0.23.2 (Serial2/0/0) Cost: 1562 State: P-2-P Type: Virtual Transit Area: 0.0.0.1 Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1
Check for OSPF errors and an authentication error is found. [R2]display ospf error
OSPF Process 1 with Router ID 10.0.2.2 OSPF error statistics
General packet errors: 0
: IP: received my own packet
2
: Bad packet
0
: Bad version
0
: Bad checksum
0
: Bad area id
0
: Drop on unnumbered interface
0
: Bad virtual link
2
: Bad authentication type
0
: Bad authentication key
0
: Packet too small
0
: Packet size > ip length
0
: Transmit error
0
: Interface down
0
: Unknown neighbor
HELLO packet errors: 0
: Netmask mismatch
0
: Hello timer mismatch
0
: Dead timer mismatch
0
: Extern option mismatch
0
: Router id confusion
0
: Virtual neighbor unknown
0
: NBMA neighbor unknown
0
: Invalid Source Address
The OSPF VC belongs to area 0. If area-based authentication is enabled in area 0, it must also be enabled on the VC. [R2]ospf [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]authentication-mode md5 1 plain huawei
The VC resumes normal and R1 can access other areas. 166
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures [R2]display ospf vlink
OSPF Process 1 with Router ID 10.0.2.2 Virtual Links
Virtual-link Neighbor-id -> 10.0.3.3, Neighbor-State: Full
Interface: 10.0.23.2 (Serial2/0/0) Cost: 1562 State: P-2-P Type: Virtual Transit Area: 0.0.0.1 Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1 GR State: Normal
[R1]ping -c 1 10.0.5.5 PING 10.0.5.5: 56 data bytes, press CTRL_C to break Reply from 10.0.5.5: bytes=56 Sequence=1 ttl=253 time=73 ms
--- 10.0.5.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 73/73/73 ms
Step 6 Troubleshoot OSPF route summarization faults. On R4, import the IP address of the Loopback 0 interface as an external route and summarize the route. The subnet mask of the summarized route contains 16 binary digits. [R4]ospf [R4-ospf-1]import-route direct [R4-ospf-1]asbr-summary 10.1.0.0 255.255.0.0
After a period of time, configure inter-area route summarization on R2 so that the network segment to which the Loopback 0 interface of R1 connects is summarized as a route with a 16-bit subnet mask. [R2]ospf [R2-ospf-1]area 2 [R2-ospf-1-area-0.0.0.2]abr-summary 10.1.0.0 255.255.0.0
Except the users connected to R4, other users cannot access the Loopback 0 interface (IP address: 10.1.4.4) of R4. HC Series
HUAWEI TECHNOLOGIES
167
HCNP-IERN Chapter 2 Implementing OSPF design structures
View the routing table of R5, which is in the same area as R4. It is found that the route to 10.1.4.4 is 10.1.0.0/16, but the next hop of this route is 10.0.75.3. Why is this incorrect route added to the routing table of R5? [R5]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 5
Routes : 5
OSPF routing table status : Destinations : 5
Destination/Mask
Proto
Routes : 5
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 OSPF
10
1563
D
10.0.75.3
GigabitEthernet0/0/0
10.0.3.0/24 OSPF
10
1
D
10.0.75.3
GigabitEthernet0/0/0
10.0.12.0/24 OSPF
10
3125
D
10.0.75.3
GigabitEthernet0/0/0
10.0.23.0/24 OSPF
10
1563
D
10.0.75.3
GigabitEthernet0/0/0
10.1.0.0/16 OSPF
10
3125
D
10.0.75.3
GigabitEthernet0/0/0
OSPF routing table status : Destinations : 0
Routes : 0
View the link state database (LSDB) of R5. [R5]display ospf lsdb
OSPF Process 1 with Router ID 10.0.5.5 Link State Database
Area: 0.0.0.0 Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
Router
10.0.5.5
10.0.5.5
214 48
80000025
0
Router
10.0.3.3
10.0.3.3
1246 48
80000024
1
Router
10.0.2.2
10.0.2.2
1247 36
80000005
1562
Router
10.1.4.4
10.1.4.4
648 36
8000000D
Network
10.0.75.4
10.1.4.4
206 36
1
80000004
0
Sum-Net
10.0.12.0
10.0.2.2
916 28
80000002
Sum-Net
10.0.3.0
10.0.3.3
893 28
80000008
0
Sum-Net
10.0.3.0
10.0.2.2
916 28
80000002
1562
Sum-Net
10.0.2.0
10.0.3.3
919 28
80000003
1562
168
HUAWEI TECHNOLOGIES
1562
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures Sum-Net
10.0.2.0
10.0.2.2
916 28
80000002
0
Sum-Net
10.1.0.0
10.0.2.2
538 28
80000001
1562
Sum-Net
10.0.23.0
10.0.3.3
893 28
80000008
1562
Sum-Net
10.0.23.0
10.0.2.2
917 28
80000002
1562
AS External Database Type
LinkState ID
AdvRouter
Age Len
Sequence
Metric
External
10.0.75.0
10.1.4.4
649 36
80000001
1
External
10.1.0.0
10.1.4.4
620 36
80000001
2
There are two LSAs that describe 10.1.0.0. View details about the LSAs. The following Type 3 LSA is originated from R2 and the Type 5 LSA is originated from R5. The two LSAs describe the same network segment. [R5]display ospf lsdb summary 10.1.0.0
OSPF Process 1 with Router ID 10.0.5.5 Area: 0.0.0.0 Link State Database
Type
: Sum-Net
Ls id
: 10.1.0.0
Adv rtr
: 10.0.2.2
Ls age
: 767
Len
: 28
Options
: E
seq#
: 80000001
chksum
: 0xa380
Net mask : 255.255.0.0 Tos 0 metric: 1562 Priority : Low
[R5]display ospf lsdb ase 10.1.0.0
OSPF Process 1 with Router ID 10.0.5.5 Link State Database
Type
: External
Ls id
: 10.1.0.0
Adv rtr
: 10.1.4.4
HC Series
HUAWEI TECHNOLOGIES
169
HCNP-IERN Chapter 2 Implementing OSPF design structures Ls age
: 871
Len
: 36
Options
: E
seq#
: 80000001
chksum
: 0xe3cd
Net mask : 255.255.0.0 TOS 0 Metric: 2 E type
: 2
Forwarding Address : 0.0.0.0 Tag
: 1
Priority : Low
In OSPF, Type 3 LSAs always take precedence over Type 5 LSAs. Therefore, the next hop of the route 10.1.0.0/16 in the routing table of R5 is R3. To avoid such problems, disable the function of summarizing external routes on R4. Then, this route is added to the routing tables of other routers. [R4-ospf-1]undo asbr-summary 10.1.0.0 255.255.0.0
[R5]display ip routing-table protocol os Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 6
Routes : 6
OSPF routing table status : Destinations : 6
Destination/Mask
Proto
Routes : 6
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 OSPF
10
1563
D
10.0.75.3
GigabitEthernet0/0/0
10.0.3.0/24 OSPF
10
1
D
10.0.75.3
GigabitEthernet0/0/0
10.0.12.0/24 OSPF
10
3125
D
10.0.75.3
GigabitEthernet0/0/0
10.0.23.0/24 OSPF
10
1563
D
10.0.75.3
GigabitEthernet0/0/0
10.1.0.0/16 OSPF
10
3125
D
10.0.75.3
GigabitEthernet0/0/0
10.1.4.4/24 O_ASE
150 1
D
10.0.75.4
GigabitEthernet0/0/0
OSPF routing table status : Destinations : 0
170
Routes : 0
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
The preceding information shows that R5 learns the route 10.1.4.4/24 correctly. On R1, test whether the route is reachable. [R1]ping -c 1 10.1.4.4 PING 10.1.4.4: 56 data bytes, press CTRL_C to break Reply from 10.1.4.4: bytes=56 Sequence=1 ttl=253 time=71 ms
--- 10.1.4.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 71/71/71 ms
The preceding information shows that the network resumes normal.
Additional Exercises: Analyzing and Verifying Figure out whether area-based authentication and interface-based authentication can be enabled concurrently in an area. Figure out whether area IDs of non-backbone areas can be the same.
Final Configurations display current-configuration [V200R001C00SPC200] # sysname R1 # interface Serial1/0/0 link-protocol ppp ip address 10.0.12.1 255.255.255.0 ospf authentication-mode md5 1 plain huawei # interface LoopBack0 ip address 10.1.1.1 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.1.1.1 area 0.0.0.2 network 10.0.12.1 0.0.0.0 network 10.1.1.1 0.0.0.0 #
HC Series
HUAWEI TECHNOLOGIES
171
HCNP-IERN Chapter 2 Implementing OSPF design structures return display current-configuration [V200R001C00SPC200] # sysname R2 # interface Serial1/0/0 link-protocol ppp ip address 10.0.12.2 255.255.255.0 ospf authentication-mode md5 1 plain huawei # interface LoopBack0 ip address 10.0.2.2 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.2.2 area 0.0.0.0 authentication-mode md5 1 plain huawei area 0.0.0.1 network 10.0.23.2 0.0.0.0 network 10.0.2.2 0.0.0.0 vlink-peer 10.0.3.3 area 0.0.0.2 abr-summary 10.1.0.0 255.255.0.0 network 10.0.12.2 0.0.0.0 # return display current-configuration [V200R001C00SPC200] # sysname R3 # interface Serial2/0/0 link-protocol ppp ip address 10.0.23.3 255.255.255.0 # interface GigabitEthernet0/0/0 ip address 10.0.75.3 255.255.255.0 # interface LoopBack0
172
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures ip address 10.0.3.3 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.3.3 area 0.0.0.0 authentication-mode md5 1 plain huawei network 10.0.75.3 0.0.0.0 area 0.0.0.1 network 10.0.23.3 0.0.0.0 network 10.0.3.3 0.0.0.0 vlink-peer 10.0.2.2 # return display current-configuration [V200R001C00SPC200] # sysname R4 # interface GigabitEthernet0/0/0 ip address 10.0.75.4 255.255.255.0 # interface LoopBack0 ip address 10.1.4.4 255.255.255.0 # ospf 1 router-id 10.1.4.4 import-route direct area 0.0.0.0 authentication-mode md5 1 plain huawei network 10.0.75.4 0.0.0.0 # return display current-configuration [V200R001C00SPC200] # sysname R5 # interface GigabitEthernet0/0/0 ip address 10.0.75.5 255.255.255.0 # interface LoopBack0 ip address 10.0.5.5 255.255.255.0
HC Series
HUAWEI TECHNOLOGIES
173
HCNP-IERN Chapter 2 Implementing OSPF design structures ospf network-type broadcast # ospf 1 router-id 10.0.5.5 area 0.0.0.0 authentication-mode md5 1 plain huawei network 10.0.75.5 0.0.0.0 network 10.0.5.5 0.0.0.0 # Return
174
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Lab 2-7 Advanced OSPF Features Learning Objectives The objectives of this lab are to learn and understand how to perform the following operations: •
Configure OSPF neighbors on the non-broadcast multi-access
(NBMA) network. •
Control designated router (DR) election on the NBMA network.
•
Configure OSPF to work in NBMA mode.
•
Configure OSPF to work in Broadcast mode on a frame relay (FR)
network. •
Configure OSPF to work in point-to-multipoint (P2MP) mode on
an FR network. •
Configure OSPF to work in P2MP-P2P hybrid mode.
•
Configure OSPF to work in point-to-point (P2P) mode.
HC Series
HUAWEI TECHNOLOGIES
175
HCNP-IERN Chapter 2 Implementing OSPF design structures
Topology
Figure 2-7 Advanced OSPF features
Scenario Assume that you are a network administrator of a company that uses OSPF for its network. The company has three branches, in which R1, R2, and R3 are deployed respectively. A virtual circuit (VC) is rent between R1 and R2, and between R1 and R3 to reduce the costs. No VC is rent between R2 and R3. Enable OSPF on the NBMA network and observe the running status of OSPF. Then change the network type to Broadcast, P2MP, P2MP-P2P hybrid, and P2P, and observe the running status of OSPF.
Tasks Step 1 Perform FR interconnection configurations and IP addressing. Configure IP addresses and subnet masks for all routers. The subnet masks of all loopback interfaces contain 24 binary digits to simulate an independent network segment.
176
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
By default, the inverse FR Address Resolution Protocol (ARP) feature is enabled on routers. Disable this feature manually and establish APR mapping between R1 and R2, and between R1 and R3. By default, the FR line does not allow broadcast packets to pass through. To enable OSPF neighbor discovery, add the Broadcast parameter when mapping the FR address. This is to allow broadcast packets to pass through an FR line. system-view Enter system view, return user view with Ctrl+Z. [R1]interface Serial 2/0/0 [R1-Serial2/0/0]link-protocol fr Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y [R1-Serial2/0/0]ip address 10.0.123.1 24 [R1-Serial2/0/0]undo fr inarp [R1-Serial2/0/0]fr map ip 10.0.123.2 102 broadcast [R1-Serial2/0/0]fr map ip 10.0.123.3 103 broadcast [R1-Serial2/0/0]interface LoopBack 0 [R1-LoopBack0]ip address 10.0.1.1 24
system-view Enter system view, return user view with Ctrl+Z. [R2]interface Serial 3/0/0 [R2-Serial3/0/0]link-protocol fr Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y [R2-Serial3/0/0]ip address 10.0.123.2 24 [R2-Serial3/0/0]undo fr inarp [R2-Serial3/0/0]fr map ip 10.0.123.1 201 broadcast [R2-Serial3/0/0]interface LoopBack 0 [R2-LoopBack0]ip address 10.0.2.2 24
system-view Enter system view, return user view with Ctrl+Z. [R3]interface s1/0/0 [R3-Serial1/0/0]link-protocol fr Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y [R3-Serial1/0/0]ip address 10.0.123.3 24 [R3-Serial1/0/0]undo fr inarp [R3-Serial1/0/0]fr map ip 10.0.123.1 301 broadcast [R3-Serial1/0/0]interface LoopBack 0 [R3-LoopBack0]ip address 10.0.3.3 24
Run the display fr map-info command to view the FR address HC Series
HUAWEI TECHNOLOGIES
177
HCNP-IERN Chapter 2 Implementing OSPF design structures
mapping table. Then test the link connectivity. [R1]display fr map-info Map Statistics for interface Serial2/0/0 (DTE) DLCI = 102, IP 10.0.123.2, Serial2/0/0 create time = 2011/11/30 09:06:43, status = ACTIVE encapsulation = ietf, vlink = 3, broadcast DLCI = 103, IP 10.0.123.3, Serial2/0/0 create time = 2011/11/30 09:06:53, status = ACTIVE encapsulation = ietf, vlink = 4, broadcast
[R1]ping -c 1 10.0.123.2 PING 10.0.123.2: 56 data bytes, press CTRL_C to break Reply from 10.0.123.2: bytes=56 Sequence=1 ttl=255 time=66 ms
--- 10.0.123.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 66/66/66 ms
[R1]ping -c 1 10.0.123.3 PING 10.0.123.3: 56 data bytes, press CTRL_C to break Reply from 10.0.123.3: bytes=56 Sequence=1 ttl=255 time=56 ms
--- 10.0.123.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 56/56/56 ms
Step 2 Configure OSPF to work in NBMA mode. Configure 10.0.123.0/24 and the Loopback 0 interfaces of all routers to belong to OSPF area 0. Change the network type of the Loopback 0 interfaces of all routers to Broadcast. The IP addresses of the Loopback 0 interfaces are used as router IDs. Note that the wildcard mask 0.0.0.0 is used when you use the network command. According to OSPF, the default network type is NBMA on an FR
178
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
network. OSPF neighbors must be manually configured on an NBMA network. After configuration, check the neighbor relationships between routers. [R1]ospf 1 router-id 10.0.123.1 [R1-ospf-1]area 0 [R1-ospf-1-area-0.0.0.0]network 10.0.123.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]quit [R1-ospf-1]peer 10.0.123.2 [R1-ospf-1]peer 10.0.123.3 [R1-ospf-1]interface LoopBack 0 [R1-LoopBack0]ospf network-type broadcast
[R2]ospf 1 router-id 10.0.2.2 [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]network 10.0.123.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]quit [R2-ospf-1]peer 10.0.123.1 [R2-ospf-1]int LoopBack 0 [R2-LoopBack0]ospf network-type broadcast
[R3]ospf 1 router-id 10.0.3.3 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 10.0.123.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]quit [R3-ospf-1]peer 10.0.123.1 [R3-ospf-1]interface LoopBack 0 [R3-LoopBack0]ospf network-type broadcast
R1 is the DR on the network segment 10.0.123.0 because OSPF is enabled on R1 first. Run the reset ospf process command to restart the OSPF process on R1. reset ospf process Warning: The OSPF process will be reset. Continue? [Y/N]:y
[R2]display ospf peer
OSPF Process 1 with Router ID 10.0.2.2 Neighbors
HC Series
HUAWEI TECHNOLOGIES
179
HCNP-IERN Chapter 2 Implementing OSPF design structures Area 0.0.0.0 interface 10.0.123.2(Serial3/0/0)'s neighbors Router ID: 10.0.123.1
Address: 10.0.123.1
State: Full Mode:Nbr is Master Priority: 1 DR: 10.0.123.2 BDR: 10.0.123.1 MTU: 0 Dead timer due in 93 sec Retrans timer interval: 6 Neighbor is up for 00:01:23 Authentication Sequence: [ 0 ]
The preceding information shows that R2 becomes the DR. View the routing table of R2. [R2]dis ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 1
Routes : 1
OSPF routing table status : Destinations : 1
Destination/Mask
Proto
10.0.1.0/24 OSPF
Routes : 1
Pre Cost
10
Flags NextHop
1562
D
10.0.123.1
Interface
Serial3/0/0
OSPF routing table status : Destinations : 0
Routes : 0
The routing table of R2 contains only one OSPF route, that is, the route to the network segment where the Loopback 0 interface of R1 resides. R2 does not learn the route to the network segment where the Loopback 0 interface of R3 resides. The reasons are described as follows: In this experiment, no VC is configured between R2 and R3 and they do not have a direct neighbor relationship. R2 is the DR and the routing information about R3 cannot be forwarded to R2. Therefore, R1 must be the DR all the time. Change the OSPF priorities of the interfaces of R2 and R3 to ensure that R1 is always the DR. In OSPF, a router whose interface priority is 0 cannot be elected as the DR or BDR. [R2]interface s3/0/0 [R2-Serial3/0/0]ospf dr-priority 0
180
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
[R3]interface Serial 1/0/0 [R3-Serial1/0/0]ospf dr-priority 0
View the routing table of R2 and check for missing routes. [R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 2
Routes : 2
OSPF routing table status : Destinations : 2
Destination/Mask
Routes : 2
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
1562
D
10.0.123.1
Serial3/0/0
10.0.3.0/24 OSPF
10
1562
D
10.0.123.3
Serial3/0/0
OSPF routing table status : Destinations : 0
Routes : 0
The route to the network segment where the Loopback 0 interface of R3 resides is found in the routing table of R2. Then test whether this route is reachable on R2. [R2]ping -c 1 10.0.3.3 PING 10.0.3.3: 56 data bytes, press CTRL_C to break Request time out
--- 10.0.3.3 ping statistics --1 packet(s) transmitted 0 packet(s) received 100.00% packet loss
R2 cannot access the Loopback 0 interface of R3. View the routing table of R2. The next hop of the route to 10.0.3.3 is 10.0.123.3. Test whether the IP address (10.0.123.3) of the next hop is reachable. [R2]ping -c 1 10.0.123.3 PING 10.0.123.3: 56 data bytes, press CTRL_C to break
HC Series
HUAWEI TECHNOLOGIES
181
HCNP-IERN Chapter 2 Implementing OSPF design structures Request time out
--- 10.0.123.3 ping statistics --1 packet(s) transmitted 0 packet(s) received 100.00% packet loss
The IP address 10.0.123.3 is on the same network segment as the interface IP address 10.0.123.2 of R1. View the FR address mapping table. [R2]display fr map-info Map Statistics for interface Serial3/0/0 (DTE) DLCI = 201, IP 10.0.123.1, Serial3/0/0 create time = 2011/11/30 10:03:37, status = ACTIVE encapsulation = ietf, vlink = 1, broadcast
Only the mapping to 10.0.123.1 is found. Add the mapping from R2 to R3 and from R3 to R2 to the FR address mapping table. [R2]interface Serial 3/0/0 [R2-Serial3/0/0]fr map ip 10.0.123.3 201 [R2-Serial3/0/0]quit
[R3]interface Serial 1/0/0 [R3-Serial1/0/0]fr map ip 10.0.123.2 301 [R3-Serial1/0/0]quit
Test whether R2 can access R3. [R2]ping -c 1 10.0.3.3 PING 10.0.3.3: 56 data bytes, press CTRL_C to break Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=122 ms
--- 10.0.3.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 122/122/122 ms
R2 can access R3.
182
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
Step 3 Configure OSPF to work in broadcast mode. By default, the FR line does not allow broadcast packets to pass through. To transmit Broadcast packets in OSPF areas, the Broadcast parameter is added when interface IP addresses of routers are mapped to FR addresses. This is to allow broadcast packets to pass through an FR line. Configure the network type to Broadcast so that OSPF runs in broadcast mode over FR. [R1]interface Serial 2/0/0 [R1-Serial2/0/0]ospf network-type broadcast
[R2]interface Serial 3/0/0 [R2-Serial3/0/0]ospf network-type broadcast
[R3]interface Serial 1/0/0 [R3-Serial1/0/0]ospf network-type broadcast
Neighbors do not need to be manually configured on the broadcast network. Delete the neighbors manually configured for the OSPF process. [R1]ospf 1 [R1-ospf-1]undo peer 10.0.123.2 [R1-ospf-1]undo peer 10.0.123.3
[R2]ospf 1 [R2-ospf-1]undo peer 10.0.123.1
[R3]ospf 1 [R3-ospf-1]undo peer 10.0.123.1
Check neighbor relationships on R1 and view the routing table of R2. Then test the connectivity between R1 and R2. [R1]display ospf peer brief
OSPF Process 1 with Router ID 10.0.123.1 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
State
0.0.0.0
Serial2/0/0
10.0.2.2
Full
HC Series
HUAWEI TECHNOLOGIES
183
HCNP-IERN Chapter 2 Implementing OSPF design structures 0.0.0.0
Serial2/0/0
10.0.3.3
Full
----------------------------------------------------------------------------
[R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 2
Routes : 2
OSPF routing table status : Destinations : 2
Destination/Mask
Routes : 2
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
1562
D
10.0.123.1
Serial3/0/0
10.0.3.0/24 OSPF
10
1562
D
10.0.123.3
Serial3/0/0
OSPF routing table status : Destinations : 0
Routes : 0
The network resumes normal. The next hop of the route to 10.0.3.0/24 is 10.0.123.3. This is the same as the result of setting the network type to NBMA for OSPF. Therefore, FR address mapping between R2 and R3 must be configured for the broadcast network. On R2, test whether the network is normal. [R2]ping -c 1 10.0.3.3 PING 10.0.3.3: 56 data bytes, press CTRL_C
to break
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=114 ms
--- 10.0.3.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 114/114/114 ms
Step 4 Configure OSPF to work in P2MP mode. OSPF neighbors do not need to be manually configured on the P2MP
184
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
network. Change the network type to P2MP for all interfaces and delete the priority configurations for them. The election of the DR and BDR is not required on the P2MP network. [R1]interface Serial 2/0/0 [R1-Serial2/0/0]ospf network-type p2mp
[R2]interface Serial 3/0/0 [R2-Serial3/0/0]undo ospf dr-priority [R2-Serial3/0/0]ospf network-type p2mp
[R3]interface Serial 1/0/0 [R3-Serial1/0/0]undo ospf dr-priority [R3-Serial1/0/0]ospf network-type p2mp
View neighbor relationships on R1. [R1]display ospf peer brief
OSPF Process 1 with Router ID 10.0.123.1 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
State
0.0.0.0
Serial2/0/0
10.0.2.2
Full
0.0.0.0
Serial2/0/0
10.0.3.3
Full
----------------------------------------------------------------------------
View the routing tables of R1 and R2. It is found that routing information is transmitted properly between R1 and R2. [R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 4
Routes : 4
OSPF routing table status : Destinations : 2
Destination/Mask
Proto
10.0.2.0/24 OSPF
HC Series
Routes : 2
Pre Cost
10
1562
Flags NextHop
D
10.0.123.2
HUAWEI TECHNOLOGIES
Interface
Serial2/0/0
185
HCNP-IERN Chapter 2 Implementing OSPF design structures 10.0.3.0/24 OSPF
10
1562
D
10.0.123.3
Serial2/0/0
OSPF routing table status : Destinations : 2
Destination/Mask
Routes : 2
Proto
Pre Cost
Flags NextHop
Interface
10.0.123.2/32 OSPF
10
1562
10.0.123.2
Serial2/0/0
10.0.123.3/32 OSPF
10
1562
10.0.123.3
Serial2/0/0
[R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 4
Routes : 4
OSPF routing table status : Destinations : 2
Destination/Mask
Routes : 2
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
1562
D
10.0.123.1
Serial3/0/0
10.0.3.0/24 OSPF
10
3124
D
10.0.123.1
Serial3/0/0
OSPF routing table status : Destinations : 2
Destination/Mask
Proto
Routes : 2
Pre Cost
Flags NextHop
Interface
10.0.123.1/32 OSPF
10
1562
10.0.123.1
Serial3/0/0
10.0.123.3/32 OSPF
10
3124
10.0.123.1
Serial3/0/0
In the routing table of R2, the next hop of the route to the network segment 10.0.3.0/24 is 10/0/123.1. Therefore, only the FR mapping to this IP address is required. Delete unwanted IP address mapping from R2 and test whether the route is reachable. [R2]interface Serial 3/0/0 [R2-Serial3/0/0]undo fr map ip 10.0.123.3 201
[R3]interface Serial 1/0/0
186
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures [R3-Serial1/0/0]undo fr map ip 10.0.123.2 301
On R2, test whether the route to 10.0.3.0/24 is reachable. If yes, R2 communicates with R3 properly. [R2]ping -c 1 10.0.3.3 PING 10.0.3.3: 56 data bytes, press CTRL_C to break Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=119 ms
--- 10.0.3.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 119/119/119 ms
View the changes in the routing table of R2 after the FR mapping to 10.0.123.3 is deleted. [R2-Serial3/0/0]disp ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 4
Routes : 4
OSPF routing table status : Destinations : 3
Destination/Mask
Routes : 3
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24
OSPF
10
1562
D
10.0.123.1
Serial3/0/0
10.0.3.0/24
OSPF
10
3124
D
10.0.123.1
Serial3/0/0
10.0.123.3/32
OSPF
10
3124
D
10.0.123.1
Serial3/0/0
OSPF routing table status : Destinations : 1
Destination/Mask
Proto
10.0.123.1/32 OSPF
Routes : 1
Pre Cost
10
1562
Flags NextHop
10.0.123.1
Interface
Serial3/0/0
The route 10.0.123.1/32 is inactive because it is a direct route in the routing table. After the FR mapping to 10.0.123.3 is deleted from the FR, this route becomes an OSPF route in the routing table.
HC Series
HUAWEI TECHNOLOGIES
187
HCNP-IERN Chapter 2 Implementing OSPF design structures
Step 5 Configure OSPF to work in P2MP-P2P hybrid mode. P2MP and P2P can coexist. Change the network type to P2P for R2 and R3. The network type of R1 remains unchanged, that is, P2MP. [R2]interface Serial 3/0/0 [R2-Serial3/0/0]ospf network-type p2p
[R3]interface Serial 1/0/0 [R3-Serial1/0/0]ospf network-type p2p
The preceding information shows that the neighbor relationships between routers disappear and are not established after a period of time. Check for OSPF errors. The intervals for sending Hello packets are different on routers. Nov 30 2011 14:16:10+00:00 R2 %%01OSPF/3/NBR_CHG_DOWN(l)[0]:Neighbor event:neighbor state changed to Down. (ProcessId=1, NeighborAddress=10.0.123.1, NeighborEvent=KillNbr, NeighborPreviousState=Full, NeighborCurrentState=Down)
[R2]display ospf error
OSPF Process 1 with Router ID 10.0.2.2 OSPF error statistics
General packet errors: 0
: IP: received my own packet
6
: Bad packet
0
: Bad version
0
: Bad checksum
0
: Bad area id
0
: Drop on unnumbered interface
0
: Bad virtual link
0
: Bad authentication type
0
: Bad authentication key
0
: Packet too small
0
: Packet size > ip length
0
: Transmit error
7
: Interface down
0
: Unknown neighbor
HELLO packet errors: 0
: Netmask mismatch
6
: Hello timer mismatch
0
: Dead timer mismatch
0
: Extern option mismatch
0
: Router id confusion
0
: Virtual neighbor unknown
0
: NBMA neighbor unknown
0
: Invalid Source Address
The default interval for sending Hello packets is 30 seconds on the 188
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
P2MP network, and is 10 seconds on the P2P network. Change the interval for sending Hello packets on R1. [R1]interface Serial 2/0/0 [R1-Serial2/0/0]ospf timer hello 10
Observe whether neighbor relationships are established after about 30 seconds. [R1]display ospf peer brief
OSPF Process 1 with Router ID 10.0.123.1 Peer Statistic Information ---------------------------------------------------------------------------Area Id
Interface
Neighbor id
State
0.0.0.0
Serial2/0/0
10.0.2.2
Full
0.0.0.0
Serial2/0/0
10.0.3.3
Full
----------------------------------------------------------------------------
The preceding information shows that neighbor relationships are established again. Check whether routing information is properly transmitted between the routers. First view the routing table of R1. [R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 3
Routes : 4
OSPF routing table status : Destinations : 2
Destination/Mask
Proto
Routes : 2
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 OSPF
10
1562
D
10.0.123.2
Serial2/0/0
10.0.3.0/24 OSPF
10
1562
D
10.0.123.3
Serial2/0/0
OSPF routing table status : Destinations : 1
Destination/Mask
HC Series
Proto
Routes : 2
Pre Cost
Flags NextHop
HUAWEI TECHNOLOGIES
Interface
189
HCNP-IERN Chapter 2 Implementing OSPF design structures 10.0.123.0/24 OSPF
10
3124
10.0.123.2
Serial2/0/0
10.0.123.0/24 OSPF
10
3124
10.0.123.3
Serial2/0/0
The routing table of R1 contains the routes to the network segments where the Loopback 0 interfaces of R2 and R3 reside. View the routing table of R2. [R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 3
Routes : 3
OSPF routing table status : Destinations : 2
Destination/Mask
Routes : 2
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
1562
D
10.0.123.1
Serial3/0/0
10.0.3.0/24 OSPF
10
3124
D
10.0.123.1
Serial3/0/0
OSPF routing table status : Destinations : 1
Destination/Mask
Routes : 1
Proto
10.0.123.1/32 OSPF
Pre Cost
10
1562
Flags NextHop
10.0.123.1
Interface
Serial3/0/0
The routing table of R2 contains the routes to R1 and R3. Test whether these routes are reachable. [R2]ping -c 1 10.0.3.3 PING 10.0.3.3: 56 data bytes, press CTRL_C to break Request time out
--- 10.0.3.3 ping statistics --1 packet(s) transmitted 0 packet(s) received 100.00% packet loss
[R2]ping -c 1 10.0.1.1 PING 10.0.1.1: 56 data bytes, press CTRL_C to break Reply from 10.0.1.1: bytes=56 Sequence=1 ttl=255 time=63 ms
190
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
--- 10.0.1.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 63/63/63 ms
R2 cannot access R3 directly but can access R1. Find the next hop where packets bound for 10.0.3.3 are discarded. [R2]tracert 10.0.3.3 traceroute to 10.0.3.3(10.0.3.3), max hops: 30 ,packet length: 40,press CTRL_C to break 1 10.0.123.1 61 ms 42 ms 42 ms 2 * * * ...
The preceding information shows that the packets arrive at R1 but are discarded after arriving at R3. View the global routing table of R3. [R3]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 13
Destination/Mask
Routes : 13
Proto
Pre Cost
Flags NextHop
Interface
10.0.1.0/24
OSPF
10
1562
D
10.0.123.1
Serial1/0/0
10.0.2.0/24
OSPF
10
3124
D
10.0.123.1
Serial1/0/0
10.0.3.0/24
Direct 0
0
D
10.0.3.3
LoopBack0
10.0.3.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.3.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.0/24
Direct 0
0
D
10.0.123.3
Serial1/0/0
10.0.123.1/32
Direct 0
0
D
10.0.123.1
Serial1/0/0
10.0.123.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.123.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
When a ping packet is sent from R2 to the Loopback 0 interface of R3, the source IP address carried in the Layer 3 header of the packet is the HC Series
HUAWEI TECHNOLOGIES
191
HCNP-IERN Chapter 2 Implementing OSPF design structures
interface IP address of R2, that is, 10.0.123.2. This packet is discarded because the routing table of R3 does not contain the route to 10.0.123.2/32. After the network type is changed from P2MP to P2P, R2 and R3 cannot learn the IP addresses of the direct interfaces of each other. This does not affect the communication between users connected to R2 and R3. The source IP address can be used to test the connectivity between R2 and R3. R2 can communicate with R3 if the source IP address of the ping packet is set to the IP address of the Loopback 0 interface of R2. [R2]ping -c 1 -a 10.0.2.2 10.0.3.3 PING 10.0.3.3: 56 data bytes, press CTRL_C to break Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=123 ms
--- 10.0.3.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 123/123/123 ms
Step 6 Configure OSPF to work in P2P mode.
192
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures
If the network type is set to P2P, IP addresses need to be re-planned. As shown in the preceding figure, R1 interconnects with R2 on 10.0.12.0/24 and with R3 on 10.0.13.0/24. Configure subinterfaces and their IP addresses. Set the interface type to P2P when configuring subinterfaces. [R1]interface s2/0/0 [R1-Serial2/0/0]undo fr map ip 10.0.123.2 102 [R1-Serial2/0/0]undo fr map ip 10.0.123.3 103 [R1-Serial2/0/0]undo ospf network-type [R1-Serial2/0/0]undo ospf timer hello [R1-Serial2/0/0]interface Serial 2/0/0.102 p2p [R1-Serial2/0/0.102]ip address 10.0.12.1 24 [R1-Serial2/0/0.102]ospf network-type p2p [R1-Serial2/0/0.102]fr dlci 102 [R1-fr-dlci-Serial2/0/0.102-102]interface Serial 2/0/0.103 p2p [R1-Serial2/0/0.103]ip address 10.0.13.1 24 [R1-Serial2/0/0.103]ospf network-type p2p [R1-Serial2/0/0.103]fr dlci 103
[R2]interface Serial 3/0/0 [R2-Serial3/0/0]undo fr map ip 10.0.123.1 201 [R2-Serial3/0/0]undo ip address [R2-Serial3/0/0]undo ospf network-type [R2-Serial3/0/0]interface Serial 3/0/0.201 p2p [R2-Serial3/0/0.201]ip address 10.0.12.2 24 [R2-Serial3/0/0.201]ospf network-type p2p [R2-Serial3/0/0.201]fr dlci 201
[R3]interface Serial 1/0/0 [R3-Serial1/0/0]undo ip address [R3-Serial1/0/0]undo fr map ip 10.0.123.1 301 [R3-Serial1/0/0]undo ospf network-type [R3-Serial1/0/0]interface Serial 1/0/0.301 p2p [R3-Serial1/0/0.301]ip address 10.0.13.3 24 [R3-Serial1/0/0.301]ospf network-type p2p [R3-Serial1/0/0.301]fr dlci 301
Test the network connectivity. [R1]ping -c 1 10.0.12.2 PING 10.0.12.2: 56 data bytes, press CTRL_C to break Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=59 ms
HC Series
HUAWEI TECHNOLOGIES
193
HCNP-IERN Chapter 2 Implementing OSPF design structures
--- 10.0.12.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 59/59/59 ms
[R1]ping -c 1 10.0.13.3 PING 10.0.13.3: 56 data bytes, press CTRL_C to break Reply from 10.0.13.3: bytes=56 Sequence=1 ttl=255 time=59 ms
--- 10.0.13.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 59/59/59 ms
Modify the network segment to be advertised in OSPF. [R1]ospf 1 [R1-ospf-1]area 0 [R1-ospf-1-area-0.0.0.0]undo network 10.0.123.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]network 10.0.12.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]network 10.0.13.1 0.0.0.0
[R2]ospf 1 [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]undo network 10.0.123.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 10.0.12.2 0.0.0.0
[R3]ospf 1 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]undo network 10.0.123.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]network 10.0.13.3 0.0.0.0
View the OSPF neighbor list. [R1]display ospf peer brief
OSPF Process 1 with Router ID 10.0.123.1 Peer Statistic Information ---------------------------------------------------------------------------Area Id
194
Interface
Neighbor id
HUAWEI TECHNOLOGIES
State
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures 0.0.0.0
Serial2/0/0.102
10.0.2.2
Full
0.0.0.0
Serial2/0/0.103
10.0.3.3
Full
----------------------------------------------------------------------------
View the routing tables of R1 and R2. [R1]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 2
Routes : 2
OSPF routing table status : Destinations : 2
Destination/Mask
Proto
Routes : 2
Pre Cost
Flags NextHop
Interface
10.0.2.0/24 OSPF
10
1562
D
10.0.12.2
Serial2/0/0.102
10.0.3.0/24 OSPF
10
1562
D
10.0.13.3
Serial2/0/0.103
OSPF routing table status : Destinations : 0
Routes : 0
[R2]display ip routing-table protocol ospf Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Public routing table : OSPF Destinations : 3
Routes : 3
OSPF routing table status : Destinations : 3
Destination/Mask
Proto
Routes : 3
Pre Cost
Flags NextHop
Interface
10.0.1.0/24 OSPF
10
1562
D
10.0.12.1
Serial3/0/0.201
10.0.3.0/24 OSPF
10
3124
D
10.0.12.1
Serial3/0/0.201
10.0.13.0/24 OSPF
10
3124
D
10.0.12.1
Serial3/0/0.201
OSPF routing table status : Destinations : 0
Routes : 0
Test the network connectivity. [R2]ping -c 1 10.0.1.1
HC Series
HUAWEI TECHNOLOGIES
195
HCNP-IERN Chapter 2 Implementing OSPF design structures PING 10.0.1.1: 56 data bytes, press CTRL_C to break Reply from 10.0.1.1: bytes=56 Sequence=1 ttl=255 time=65 ms
--- 10.0.1.1 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 65/65/65 ms
[R2]ping -c 1 10.0.3.3 PING 10.0.3.3: 56 data bytes, press CTRL_C to break Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=255 time=95 ms
--- 10.0.3.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 95/95/95 ms
Additional Exercises: Analyzing and Verifying Figure out the precautions to be taken if the NBMA network type is used when not all routers on the network are interconnected.
Figure out the differences between NBMA, P2MP, and P2P.
Final Configurations display current-configuration [V200R001C00SPC200] # sysname R1 # interface Serial2/0/0 link-protocol fr undo fr inarp # interface Serial2/0/0.102 p2p
196
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 2 Implementing OSPF design structures fr dlci 102 ip address 10.0.12.1 255.255.255.0 ospf network-type p2p # interface Serial2/0/0.103 p2p fr dlci 103 ip address 10.0.13.1 255.255.255.0 ospf network-type p2p # interface LoopBack0 ip address 10.0.1.1 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.123.1 area 0.0.0.0 network 10.0.1.1 0.0.0.0 network 10.0.12.1 0.0.0.0 network 10.0.13.1 0.0.0.0 # return
display current-configuration [V200R001C00SPC200] # sysname R2 # interface Serial3/0/0 link-protocol fr undo fr inarp # interface Serial3/0/0.201 p2p fr dlci 201 ip address 10.0.12.2 255.255.255.0 ospf network-type p2p # interface LoopBack0 ip address 10.0.2.2 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.2.2 area 0.0.0.0 network 10.0.2.2 0.0.0.0 network 10.0.12.2 0.0.0.0
HC Series
HUAWEI TECHNOLOGIES
197
HCNP-IERN Chapter 2 Implementing OSPF design structures # return
display current-configuration [V200R001C00SPC200] # sysname R3 # interface Serial1/0/0 link-protocol fr fr map ip 10.0.13.1 301 broadcast ip address 10.0.13.3 255.255.255.0 ospf network-type p2p # interface LoopBack0 ip address 10.0.3.3 255.255.255.0 ospf network-type broadcast # ospf 1 router-id 10.0.3.3 area 0.0.0.0 network 10.0.3.3 0.0.0.0 network 10.0.13.3 0.0.0.0 # Return
198
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management
Chapter 3 BGP application and management Lab 3-1 IBGP and EBGP Learning Objectives The objectives of this lab are to learn and understand how to perform the following operations: •
Configure single-area Border Gateway Protocol (BGP).
•
Configure multi-area BGP.
•
View the BGP neighbor list and database.
•
Configure BGP update sources.
•
Configure multi-hop external BGP (EBGP).
•
Observe change of the next hops of Internal BGP (IBGP) routes
and EBGP routes. •
Configure the next hops for IBGP routes.
•
Configure the network command in BGP.
HC Series
HUAWEI TECHNOLOGIES
199
HCNP-IERN Chapter 3 BGP application and management
Topology
Figure 3-1 IBGP and EBGP
Scenario Assume that you are a network administrator of a company that uses BGP for its network. The network serving the company consists of multiple autonomous systems (ASs). Different branches use different AS IDs. The task is to complete network construction. In the headquarters, Open Shortest Path First (OSPF) is used as the Interior Gateway Protocol (IGP). The branches use private BGP AS IDs. After network construction, observe the transmission of BGP routing information.
Tasks Step 1 Perform basic configurations and IP addressing. Configure IP addresses and subnet masks for all routers. The subnet masks of the Loopback 1 interfaces of R4 and R5 contain 24 binary digits to simulate the user network. system-view
200
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management Enter system view, return user view with Ctrl+Z. [R1]interface Serial 1/0/0 [R1-Serial1/0/0]ip address 10.0.12.1 24 [R1-Serial1/0/0]interface Serial 3/0/0 [R1-Serial3/0/0]ip address 10.0.14.1 24 [R1-Serial3/0/0]interface LoopBack 0 [R1-LoopBack0]ip address 10.0.1.1 32
system-view Enter system view, return user view with Ctrl+Z. [R2]interface Serial 1/0/0 [R2-Serial1/0/0]ip address 10.0.12.2 24 [R2-Serial1/0/0]interface Serial 2/0/0 [R2-Serial2/0/0]ip address 10.0.23.2 24 [R2-Serial2/0/0]interface LoopBack 0 [R2-LoopBack0]ip address 10.0.2.2 32
system-view Enter system view, return user view with Ctrl+Z. [R3]interface Serial 2/0/0 [R3-Serial2/0/0]ip address 10.0.23.3 24 [R3-Serial2/0/0]interface Serial 3/0/0 [R3-Serial3/0/0]ip address 10.0.35.3 24 [R3-Serial3/0/0]interface LoopBack 0 [R3-LoopBack0]ip address 10.0.3.3 32
system-view Enter system view, return user view with Ctrl+Z. [R4]interface Serial 1/0/0 [R4-Serial1/0/0]ip address 10.0.14.4 24 [R4-Serial1/0/0]interface LoopBack 0 [R4-LoopBack0]ip address 10.0.4.4 32
system-view Enter system view, return user view with Ctrl+Z. [R5]interface Serial 1/0/0 [R5-Serial1/0/0]ip address 10.0.35.5 24 [R5-Serial1/0/0]interface LoopBack 0 [R5-LoopBack0]ip address 10.0.5.5 32
Test the connectivity of direct links. ping -c 1 10.0.12.2
HC Series
HUAWEI TECHNOLOGIES
201
HCNP-IERN Chapter 3 BGP application and management PING 10.0.12.2: 56 data bytes, press CTRL_C to break Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=34 ms
--- 10.0.12.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 34/34/34 ms
ping -c 1 10.0.14.4 PING 10.0.14.4: 56 data bytes, press CTRL_C to break Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=40 ms
--- 10.0.14.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 40/40/40 ms
ping -c 1 10.0.23.2 PING 10.0.23.2: 56 data bytes, press CTRL_C to break Reply from 10.0.23.2: bytes=56 Sequence=1 ttl=255 time=33 ms
--- 10.0.23.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 33/33/33 ms
ping -c 1 10.0.35.5 PING 10.0.35.5: 56 data bytes, press CTRL_C to break Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=35 ms
--- 10.0.35.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 35/35/35 ms
The preceding information shows that the direct links are reachable.
202
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management
Step 2 Configure single-area IGP. Configure AS 64512 to use OSPF as IGP to advertise the network segments where the Loopback 0 interfaces reside to OSPF. Enable OSPF on the network segment where the S1/0/0 interface of R1 resides. [R1]router id 10.0.1.1 [R1]ospf 1 [R1-ospf-1]area 0 [R1-ospf-1-area-0.0.0.0]network 10.0.12.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0
Enable OSPF on the network segment where the S1/0/0 and S2/0/0 interfaces of R2 reside. [R2]router id 10.0.2.2 [R2]ospf 1 [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]network 10.0.12.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 10.0.23.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]network 10.0.2.2 0.0.0.0
Enable OSPF on the network segment where the S2/0/0 interface of R3 resides. [R3]router id 10.0.3.3 [R3]ospf 1 [R3-ospf-1]area 0 [R3-ospf-1-area-0.0.0.0]network 10.0.23.3 0.0.0.0 [R3-ospf-1-area-0.0.0.0]network 10.0.3.3 0.0.0.0
Note that the wildcard mask 0.0.0.0 is used when you use the network command. Check whether OSPF neighbor relationships are established. [R2]display ospf peer
OSPF Process 1 with Router ID 10.0.2.2 Neighbors
Area 0.0.0.0 interface 10.0.12.2(Serial1/0/0)'s neighbors Router ID: 10.0.1.1
Address: 10.0.12.1
State: Full Mode:Nbr is Slave Priority: 1
HC Series
HUAWEI TECHNOLOGIES
203
HCNP-IERN Chapter 3 BGP application and management DR: None
BDR: None
MTU: 0
Dead timer due in 31 sec Retrans timer interval: 4 Neighbor is up for 00:00:29 Authentication Sequence: [ 0 ]
Neighbors
Area 0.0.0.0 interface 10.0.23.2(Serial2/0/0)'s neighbors Router ID: 10.0.3.3
Address: 10.0.23.3
State: Full Mode:Nbr is Master Priority: 1 DR: None
BDR: None
MTU: 0
Dead timer due in 34 sec Retrans timer interval: 4 Neighbor is up for 00:00:06 Authentication Sequence: [ 0 ]
View the routing table of each router. Check whether a router learns the route to the network segment where the Loopback 0 interface of the peer router resides. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 15
Destination/Mask
Routes : 15
Proto
Pre Cost
Flags NextHop
10.0.1.1/32
Direct
0
0
D
10.0.2.2/32
OSPF
10
1562
D
10.0.12.2
Serial1/0/0
10.0.3.3/32
OSPF
10
3124
D
10.0.12.2
Serial1/0/0
127.0.0.1
Interface
InLoopBack0
10.0.12.0/24
Direct 0
0
D
10.0.12.1
Serial1/0/0
10.0.12.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.12.2/32
Direct 0
0
D
10.0.12.2
Serial1/0/0
10.0.12.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.14.0/24
Direct 0
0
D
10.0.14.1
Serial3/0/0
10.0.14.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.14.4/32
Direct 0
0
D
10.0.14.4
Serial3/0/0
10.0.14.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.23.0/24
OSPF
3124
D
10.0.12.2
Serial1/0/0
127.0.0.0/8
Direct 0
0
D
127.0.0.1
InLoopBack0
127.0.0.1/32
Direct 0
0
204
10
D
127.0.0.1
HUAWEI TECHNOLOGIES
InLoopBack0
HC Series
HCNP-IERN Chapter 3 BGP application and management 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
[R2]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 15
Destination/Mask
Proto
10.0.1.1/32
OSPF
10.0.2.2/32
10
Routes : 15
Pre Cost
Flags NextHop
Interface
1562
D
10.0.12.1
Serial1/0/0
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.3.3/32
OSPF
1562
D
10.0.23.3
Serial2/0/0
10.0.12.0/24
Direct 0
0
D
10.0.12.2
Serial1/0/0
10.0.12.1/32
Direct 0
0
D
10.0.12.1
Serial1/0/0
10.0.12.2/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.12.255/32 Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.23.0/24
0
D
10.0.23.2
Serial2/0/0
10
Direct 0
10.0.23.2/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.23.3/32
Direct 0
0
D
10.0.23.3
Serial2/0/0
10.0.23.255/32 Direct 0
0
D
127.0.0.1
InLoopBack0
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
[R3]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 16
Destination/Mask
Routes : 16
Proto
Pre Cost
10.0.1.1/32
OSPF
10
3124
D
10.0.23.2
Serial2/0/0
10.0.2.2/32
OSPF
10
1562
D
10.0.23.2
Serial2/0/0
10.0.3.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.12.0/24
OSPF
3124
D
10.0.23.2
Serial2/0/0
10.0.23.0/24
Direct 0
0
D
10.0.23.3
Serial2/0/0
10.0.23.2/32
Direct 0
0
D
10.0.23.2
Serial2/0/0
10.0.23.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.23.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
HC Series
10
Flags NextHop
HUAWEI TECHNOLOGIES
Interface
205
HCNP-IERN Chapter 3 BGP application and management 10.0.35.0/24
Direct 0
0
D
10.0.35.3
Serial3/0/0
10.0.35.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.35.5/32
Direct 0
0
D
10.0.35.5
Serial3/0/0
10.0.35.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
The preceding information shows that each of R1, R2, and R3 can learn the routes to the network segments where the Loopback 0 interfaces of the other two routers reside.
Step 3 Establish IBGP peers. Configure full-mesh IBGP interconnection on R1, R2, and R3. Use the Loopback 0 interfaces as update sources. [R1]bgp 64512 [R1-bgp]peer 10.0.2.2 as-number 64512 [R1-bgp]peer 10.0.2.2 connect-interface LoopBack 0 [R1-bgp]peer 10.0.3.3 as-number 64512 [R1-bgp]peer 10.0.3.3 connect-interface LoopBack 0
[R2]bgp 64512 [R2-bgp]peer 10.0.1.1 as-number 64512 [R2-bgp]peer 10.0.1.1 connect-interface loopback 0 [R2-bgp]peer 10.0.3.3 as-number 64512 [R2-bgp]peer 10.0.3.3 connect-interface LoopBack 0
[R3]bgp 64512 [R3-bgp]peer 10.0.1.1 as-number 64512 [R3-bgp]peer 10.0.1.1 connect-interface loopback 0 [R3-bgp]peer 10.0.2.2 as-number 64512 [R3-bgp]peer 10.0.2.2 connect-interface LoopBack 0
Run the display tcp status command to view the status of Transmission Control Protocol (TCP) ports. [R2]display tcp status TCPCB
Tid/Soid Local Add:port
Foreign Add:por
VPNID State
194a3c7c 8 /2
0.0.0.0:22
0.0.0.0:0
23553
Listening
194a3b18 8 /1
0.0.0.0:23
0.0.0.0:0
23553
Listening
206
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management 194a3850 106/1
0.0.0.0:80
0.0.0.0:0
0
Listening
19ec2bb8 234/2
0.0.0.0:179
10.0.1.1:0
0
Listening
19ec2360 234/5
0.0.0.0:179
10.0.3.3:0
0
Listening
194a3de0 8 /3
0.0.0.0:830
0.0.0.0:0
23553
Listening
194a39b4 6 /1
0.0.0.0:7547
0.0.0.0:0
0
Listening
19ec3410 234/11
10.0.2.2:179
10.0.3.3:49663
0
Established
19ec2a54 234/4
10.0.2.2:50151
10.0.1.1:179
0
Established
The value of Local Add is 10.0.2.2, which is the IP address of the Loopback 0 interface of R2, and the port number is 179, which is the TCP port number of BGP. The status of the TCP connections between 10.0.2.2 and 10.0.3.3, and between 10.0.2.2 and 10.0.1.1 is Established. This indicates that TCP connections are established between R2 and R1, and between R2 and R3. Run the display bgp peer command to view the BGP neighbor relationships on the routers. [R1]display bgp peer
BGP local router ID : 10.0.1.1 Local AS number : 64512 Total number of peers : 2
Peer
V
Peers in established state : 2
AS MsgRcvd MsgSent OutQ Up/Down
State PrefRcv
10.0.2.2
4
64512
273
277
0 02:15:53 Established
0
10.0.3.3
4
64512
276
276
0 02:15:53 Established
0
[R2]display bgp peer
BGP local router ID : 10.0.2.2 Local AS number : 64512 Total number of peers : 2
Peer
V
Peers in established state : 2
AS MsgRcvd MsgSent OutQ Up/Down
10.0.1.1
4
64512
38
10.0.3.3
4
64512
1000
State
PrefRcv
38
0 00:18:02 Established
0
1000
0 16:38:38 Established
0
[R3]display bgp peer
BGP local router ID : 10.0.3.3
HC Series
HUAWEI TECHNOLOGIES
207
HCNP-IERN Chapter 3 BGP application and management Local AS number : 64512 Total number of peers : 2
Peer
V
Peers in established state : 2
AS MsgRcvd MsgSent OutQ Up/Down
10.0.1.1
4
64512
39
10.0.2.2
4
64512
1001
State PrefRcv
39
0 00:18:35 Established
0
1001
0 16:39:11 Established
0
The preceding information shows that BGP neighbor relationships are established between the three routers. On R1, run the timer command to change the keepalive time of BGP to 30 seconds, and the hold time to 90 seconds. Run the display bgp peer verbose command to view the negotiated interval after a peer relationship is established between R1 and R2. [R1-bgp] timer keepalive 30 hold 90
Note that the BGP neighbors of R1 will restart if the keepalive time and hold time are changed. [R2]display bgp peer verbose
BGP Peer is 10.0.1.1, remote AS 64512 Type: IBGP link BGP version 4, Remote router ID 10.0.1.1 Update-group ID: 1 BGP current state: Established, Up for 00h07m19s BGP current event: KATimerExpired BGP last state: OpenConfirm BGP Peer Up count: 2 Received total routes: 0 Received active routes total: 0 Advertised total routes: 0 Port: Local - 50117
Remote - 179
Configured: Connect-retry Time: 32 sec Configured: Active Hold Time: 180 sec
Keepalive Time:60 sec
Received : Active Hold Time: 90 sec Negotiated: Active Hold Time: 90 sec
Keepalive Time:30 sec
Peer optional capabilities: Peer supports bgp multi-protocol extension Peer supports bgp route refresh capability Peer supports bgp 4-byte-as capability Address family IPv4 Unicast: advertised and received
208
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management Received: Total 16 messages Update messages
0
Open messages
1
KeepAlive messages
15
Notification messages
0
Refresh messages
0
Sent: Total 16 messages Update messages
0
Open messages
1
KeepAlive messages
15
Notification messages
0
Refresh messages
0
Authentication type configured: None Last keepalive received: 2011/12/07 08:33:52 Minimum route advertisement interval is 15 seconds Optional capabilities: Route refresh capability has been enabled 4-byte-as capability has been enabled Connect-interface has been configured Peer Preferred Value: 0 Routing policy configured: No routing policy is configured
BGP Peer is 10.0.3.3, remote AS 64512 Type: IBGP link BGP version 4, Remote router ID 10.0.3.3 Update-group ID: 1 BGP current state: Established, Up for 16h28m14s BGP current event: RecvKeepalive BGP last state: OpenConfirm BGP Peer Up count: 1 Received total routes: 0 Received active routes total: 0 Advertised total routes: 0 Port: Local - 179
Remote - 49663
Configured: Connect-retry Time: 32 sec Configured: Active Hold Time: 180 sec
Keepalive Time:60 sec
Received : Active Hold Time: 180 sec Negotiated: Active Hold Time: 180 sec
Keepalive Time:60 sec
Peer optional capabilities: Peer supports bgp multi-protocol extension Peer supports bgp route refresh capability Peer supports bgp 4-byte-as capability
HC Series
HUAWEI TECHNOLOGIES
209
HCNP-IERN Chapter 3 BGP application and management Address family IPv4 Unicast: advertised and received Received: Total 990 messages Update messages
0
Open messages
1
KeepAlive messages
989
Notification messages
0
Refresh messages
0
Sent: Total 990 messages Update messages
0
Open messages
1
KeepAlive messages
989
Notification messages
0
Refresh messages
0
Authentication type configured: None Last keepalive received: 2011/12/07 08:34:17 Minimum route advertisement interval is 15 seconds Optional capabilities: Route refresh capability has been enabled 4-byte-as capability has been enabled Connect-interface has been configured Peer Preferred Value: 0 Routing policy configured: No routing policy is configured
On R2, Active Hold Time is set to 180 seconds and Keepalive Time to 60 seconds by default. After the keepalive time and hold time are changed for R1, the value of Active Hold Time carried in the packets received by R2 is 90 sec. During negotiation, the smaller values take effect. Therefore, the negotiated value of Active Hold Time is 90 sec, and that of Keepalive Time is 30 sec. The default values of the two parameters are retained for R3. The same as R3, Active Hold Time is set to 180 sec and Keepalive Time to 60 sec by default on R2.
Step 4 Configure EBGP peers. Configure BGP on R4 and configure the local AS ID to 64513. Establish a peer relationship between R4 and R1. When establishing the peer relationship, set the IP address of the Loopback 0 interface as the
210
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management
update source and set ebgp-max-hop to 2. Add a static route with a 32-bit subnet mask to the IP address of the peer Loopback 0 interface so that the peer relationship can be established successfully. [R1]ip route-static 10.0.4.4 32 10.0.14.4 [R4]ip route-static 10.0.1.1 32 10.0.14.1
[R1]bgp 64512 [R1-bgp]peer 10.0.4.4 as-number 64513 [R1-bgp]peer 10.0.4.4 ebgp-max-hop 2 [R1-bgp]peer 10.0.4.4 connect-interface LoopBack0
[R4]bgp 64513 [R4-bgp]peer 10.0.1.1 as-number 64512 [R4-bgp]peer 10.0.1.1 ebgp-max-hop 2 [R4-bgp]peer 10.0.1.1 connect-interface LoopBack0
Run the display bgp peer command to view the peer relationship. [R4]display bgp peer
BGP local router ID : 10.0.4.4 Local AS number : 64513 Total number of peers : 1
Peer
V
10.0.1.1
Peers in established state : 1
AS MsgRcvd
4
64512
MsgSent
4
5
OutQ
Up/Down State PrefRcv
0 00:01:18
Established
0
On R4, run the debugging ip packet verbose command to view the time to live (TTL) of keepalive packets. debugging ip packet verbose Dec 7 2011 09:09:07.240.2+00:00 R4 IP/7/debug_case: Delivering, interface = S1/0/0, version = 4, headlen = 20, tos = 192, pktlen = 40, pktid = 11346, offset = 0, ttl = 2, protocol = 6, checksum = 29370, s = 10.0.1.1, d = 10.0.4.4 prompt: Packet is before IP_Reass before really deliver to up.
45 c0 00 28 2c 52 00 00 02 06 72 ba 0a 00 01 01 0a 00 04 04 c7 cd 00 b3 91 99 51 7b 2b aa b0 8f 50 10 40 00 cf 00 00 00
Dec 7 2011 09:11:07.640.3+00:00 R4 IP/7/debug_case:
HC Series
HUAWEI TECHNOLOGIES
211
HCNP-IERN Chapter 3 BGP application and management Delivering, interface = S1/0/0, version = 4, headlen = 20, tos = 192, pktlen = 40, pktid = 11383, offset = 0, ttl = 2, protocol = 6, checksum = 29333, s = 10.0.1.1, d = 10.0.4.4 prompt: IP packet is delivering up!
The TTL of the received packets is 2. Establish an EBGP peer relationship between R3 and R5 using their physical interface. [R3]bgp 64512 [R3-bgp]peer 10.0.35.5 as-number 64514
[R5]bgp 64514 [R5-bgp]peer 10.0.35.3 as-number 64512 [R5-bgp]display bgp peer
BGP local router ID : 10.1.5.5 Local AS number : 64514 Total number of peers : 1
Peer
10.0.35.3
V
AS
4
Peers in established state : 1
MsgRcvd MsgSent
64512
2
2
OutQ Up/Down
0 00:00:57
State
PrefRcv
Established
0
Step 5 Advertise routing information using the network command. Set the IP address to 10.1.4.4/24 for the Loopback 1 interface of R4. Run the network command to advertise this network segment to BGP. [R4]interface LoopBack 1 [R4-LoopBack1]ip address 10.1.4.4 24 [R4-LoopBack1]bgp 64513 [R4-bgp]network 10.1.4.4 24
Check whether the route 10.1.4.4/24 exists in the global routing tables of R1 and R3. View the BGP routing table of R3 to find the next hop of this route. [R1]display ip routing-table
212
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 18
Destination/Mask
Proto
Routes : 18
Pre Cost
Flags NextHop
Interface
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.2.2/32
OSPF
10
1562
D
10.0.12.2
Serial1/0/0
10.0.3.3/32
OSPF
10
3124
D
10.0.12.2
Serial1/0/0
10.0.4.4/32
Static 60
0
RD
10.0.14.4
Serial3/0/0
10.0.12.0/24
Direct 0
0
D
10.0.12.1
Serial1/0/0
10.0.12.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.12.2/32
Direct 0
0
D
10.0.12.2
Serial1/0/0
10.0.12.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.14.0/24
Direct 0
0
D
10.0.14.1
Serial3/0/0
10.0.14.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.14.4/32
Direct 0
0
D
10.0.14.4
Serial3/0/0
10.0.14.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.23.0/24
OSPF
10
3124
10.1.4.0/24
EBGP
255 0
10.0.12.2
Serial1/0/0
RD
D
10.0.4.4
Serial3/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/3
0
D
127.0.0.1
InLoopBack0
Direct 0
E1 learns the EBGP route 10.1.4.0/24. Check whether the routing table of R3 contains the route 10.1.4.0/24. [R3]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 16
Destination/Mask
Routes : 16
Proto
Pre Cost
10.0.1.1/32
OSPF
10
3124
D
10.0.23.2
Serial2/0/0
10.0.2.2/32
OSPF
10
1562
D
10.0.23.2
Serial2/0/0
10.0.3.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.12.0/24
OSPF
3124
D
10.0.23.2
Serial2/0/0
10.0.23.0/24
Direct 0
0
D
10.0.23.3
Serial2/0/0
10.0.23.2/32
Direct 0
0
D
10.0.23.2
Serial2/0/0
HC Series
10
Flags NextHop
HUAWEI TECHNOLOGIES
Interface
213
HCNP-IERN Chapter 3 BGP application and management 10.0.23.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.23.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.35.0/24
Direct 0
0
D
10.0.35.3
Serial3/0/0
10.0.35.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.35.5/32
Direct 0
0
D
10.0.35.5
Serial3/0/0
10.0.35.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
The routing table of R3 does not contain the route 10.1.4.0/24. View the BGP routing table of R3. [R3]display bgp routing-table
BGP Local router ID is 10.0.3.3 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 1 Network
i 10.1.4.0/24
NextHop
MED
10.0.4.4
0
LocPrf
100
PrefVal Path/Ogn
0
64513i
The route 10.1.4.0/24 is found in the BGP routing table of R3 but it does not have an asterisk (*). This indicates that this route is not the optimal route and therefore not used. This is because the next hop of this route is 10.0.4.4 but R3 does not have a route to 10.0.4.4. According to BGP, a route is not used if its next hop is unreachable. Configure next-hop-local on R1 and then view the routing table of R3. [R1]bgp 64512 [R1-bgp]peer 10.0.3.3 next-hop-local [R1-bgp]peer 10.0.2.2 next-hop-local [R1-bgp]quit [R3]display bgp routing-table
214
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management BGP Local router ID is 10.0.3.3 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 1 Network
NextHop
*>i 10.1.4.0/24
MED
10.0.1.1
LocPrf
0
100
PrefVal Path/Ogn
0
64513i
The next hop of the BGP route 10.1.4.0/24 is 10.0.1.1 and this route has an asterisk (*) and a greater-than sign (>). This indicates that the route is correct and optimal. View the routing table of R3. [R3]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 17
Destination/Mask
Routes : 17
Proto
Pre Cost
10.0.1.1/32
OSPF
10
3124
D
10.0.23.2
Serial2/0/0
10.0.2.2/32
OSPF
10
1562
D
10.0.23.2
Serial2/0/0
10.0.3.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.12.0/24
OSPF
3124
D
10.0.23.2
Serial2/0/0
10.0.23.0/24
Direct 0
0
D
10.0.23.3
Serial2/0/0
10.0.23.2/32
Direct 0
0
D
10.0.23.2
Serial2/0/0
10.0.23.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.23.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.35.0/24
Direct 0
0
D
10.0.35.3
Serial3/0/0
10.0.35.3/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.35.5/32
Direct 0
0
D
10.0.35.5
Serial3/0/0
10.0.35.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
255 0
RD
10.0.1.1
Serial2/0/0
10.1.4.0/24
IBGP
10
Flags NextHop
Interface
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
The route 10.1.4.0/24 is found. HC Series
HUAWEI TECHNOLOGIES
215
HCNP-IERN Chapter 3 BGP application and management
Set the IP address to 10.1.5.5/24 for the Loopback 1 interface of R5. Advertise this route to BGP and configure next-hop-local on R3. [R5]interface LoopBack 1 [R5-LoopBack1]ip address 10.1.5.5 24 [R5-LoopBack1]quit
[R5]bgp 64514 [R5-bgp]network 10.1.5.0 24
[R3]bgp 64512 [R3-bgp]peer 10.0.1.1 next-hop-local [R3-bgp]peer 10.0.2.2 next-hop-local
Check whether R4 learns the route to the network segment where the Loopback 1 interface of R5 resides. Analyze the output of the display bgp routing-table command. [R4]display bgp routing-table
BGP Local router ID is 10.0.4.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 2 Network
NextHop
*>
10.1.4.0/24
0.0.0.0
*>
10.1.5.0/24
10.0.1.1
MED
LocPrf
0
PrefVal Path/Ogn
0
i
0
64512 64514i
On R5, ping the Loopback 1 interface of R4 from the Loopback 1 interface of R5. [R5]ping -c 1 -a 10.1.5.5 10.1.4.4 PING 10.1.4.4: 56 data bytes, press CTRL_C to break Reply from 10.1.4.4: bytes=56 Sequence=1 ttl=252 time=125 ms
--- 10.1.4.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss
216
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management round-trip min/avg/max = 125/125/125 ms
Additional Exercises: Analyzing and Verifying Figure out when physical interfaces should be used to establish EBGP neighbor relationships. Figure out why the TTL of the packets sent to EBGP neighbors is 1. Figure out the default value of hop-count in the peer group_name ebgp-max-hop [hop-count] command.
Final Configurations [R1]display current-configuration [V200R001C00SPC200] # sysname R1 # router id 10.0.1.1 # interface Serial1/0/0 link-protocol ppp ip address 10.0.12.1 255.255.255.0 # interface Serial3/0/0 link-protocol ppp ip address 10.0.14.1 255.255.255.0 # interface LoopBack0 ip address 10.0.1.1 255.255.255.255 # bgp 64512 timer keepalive 30 hold 90 peer 10.0.2.2 as-number 64512 peer 10.0.2.2 connect-interface LoopBack0 peer 10.0.3.3 as-number 64512 peer 10.0.3.3 connect-interface LoopBack0 peer 10.0.4.4 as-number 64513 peer 10.0.4.4 ebgp-max-hop 2 peer 10.0.4.4 connect-interface LoopBack0 # ipv4-family unicast
HC Series
HUAWEI TECHNOLOGIES
217
HCNP-IERN Chapter 3 BGP application and management undo synchronization peer 10.0.2.2 enable peer 10.0.2.2 next-hop-local peer 10.0.3.3 enable peer 10.0.3.3 next-hop-local peer 10.0.4.4 enable # ospf 1 area 0.0.0.0 network 10.0.12.0 0.0.0.255 network 10.0.1.1 0.0.0.0 # ip route-static 10.0.4.4 255.255.255.255 10.0.14.4 return
[R2]display current-configuration [V200R001C00SPC200] # sysname R2 # router id 10.0.2.2 # interface Serial1/0/0 link-protocol ppp ip address 10.0.12.2 255.255.255.0 # interface Serial2/0/0 link-protocol ppp ip address 10.0.23.2 255.255.255.0 # interface LoopBack0 ip address 10.0.2.2 255.255.255.255 # bgp 64512 peer 10.0.1.1 as-number 64512 peer 10.0.1.1 connect-interface LoopBack0 peer 10.0.3.3 as-number 64512 peer 10.0.3.3 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 10.0.1.1 enable peer 10.0.3.3 enable
218
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management # ospf 1 area 0.0.0.0 network 10.0.12.0 0.0.0.255 network 10.0.23.0 0.0.0.255 network 10.0.2.2 0.0.0.0 return
[R3]display current-configuration [V200R001C00SPC200] # sysname R3 # router id 10.0.3.3 # interface Serial2/0/0 link-protocol ppp ip address 10.0.23.3 255.255.255.0 # interface Serial3/0/0 link-protocol ppp ip address 10.0.35.3 255.255.255.0 # interface LoopBack0 ip address 10.0.3.3 255.255.255.255 # bgp 64512 peer 10.0.1.1 as-number 64512 peer 10.0.1.1 connect-interface LoopBack0 peer 10.0.2.2 as-number 64512 peer 10.0.2.2 connect-interface LoopBack0 peer 10.0.35.5 as-number 64514 # ipv4-family unicast undo synchronization peer 10.0.1.1 enable peer 10.0.1.1 next-hop-local peer 10.0.2.2 enable peer 10.0.2.2 next-hop-local peer 10.0.35.5 enable # ospf 1 area 0.0.0.0
HC Series
HUAWEI TECHNOLOGIES
219
HCNP-IERN Chapter 3 BGP application and management network 10.0.23.0 0.0.0.255 network 10.0.3.3 0.0.0.0 return
[R4]display current-configuration [V200R001C00SPC200] # sysname R4 # interface Serial1/0/0 link-protocol ppp ip address 10.0.14.4 255.255.255.0 # interface LoopBack0 ip address 10.0.4.4 255.255.255.255 # interface LoopBack1 ip address 10.1.4.4 255.255.255.0 # bgp 64513 peer 10.0.1.1 as-number 64512 peer 10.0.1.1 ebgp-max-hop 2 peer 10.0.1.1 connect-interface LoopBack0 # ipv4-family unicast undo synchronization network 10.0.4.0 255.255.255.0 network 10.1.4.0 255.255.255.0 peer 10.0.1.1 enable # ip route-static 10.0.1.1 255.255.255.255 10.0.14.1 return
[R5]display current-configuration [V200R001C00SPC200] # sysname R5 # interface Serial1/0/0 link-protocol ppp ip address 10.0.35.5 255.255.255.0 # interface LoopBack0
220
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management ip address 10.0.5.5 255.255.255.255 # interface LoopBack1 ip address 10.1.5.5 255.255.255.0 # bgp 64514 peer 10.0.35.3 as-number 64512 # ipv4-family unicast undo synchronization network 10.1.5.0 255.255.255.0 peer 10.0.35.3 enable return
HC Series
HUAWEI TECHNOLOGIES
221
HCNP-IERN Chapter 3 BGP application and management
Lab 3-2 BGP Route Aggregation Learning Objectives The objectives of this lab are to learn and understand: •
Method used to configure BGP route aggregation by using the network command
•
Method used to configure aggregation suppression of a specific BGP route
•
Method used to modify attributes of summarized routes
•
Method of using the AS-SET attribute during route aggregation
Topology
Figure 3-2 BGP route aggregation
222
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management
Scenario Assume that you are a network engineer of a company. The network of the company uses BGP as the routing protocol. The network comprises of multiple Autonomous Systems (AS). Different branches use different AS numbers. Routing tables of routers increase with growth of the company. Therefore, BGP route aggregation is pressing. You select a proper route aggregation method after several tests.
Tasks Step 1 Configure IP addresses. Configure IP addresses and masks for the physical interfaces and loopback interfaces of all routers. Loopback interfaces use 32-bit masks. system-view Enter system view, return user view with Ctrl+Z. [R1]interface Serial 1/0/0 [R1-Serial1/0/0]ip address 10.0.12.1 255.255.255.0 [R1-Serial1/0/0]interface Serial 3/0/0 [R1-Serial3/0/0]ip address 10.0.14.1 255.255.255.0 [R1-Serial3/0/0]interface GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ip add 10.0.15.1 255.255.255.0 [R1-GigabitEthernet0/0/0]interface LoopBack 0 [R1-LoopBack0]ip address 10.1.1.1 255.255.255.255
system-view Enter system view, return user view with Ctrl+Z. [R2]interface Serial 1/0/0 [R2-Serial1/0/0]ip address 10.0.12.2 255.255.255.0 [R2-Serial1/0/0]interface Serial 2/0/0 [R2-Serial2/0/0]ip address 10.0.23.2 255.255.255.0 [R2-Serial2/0/0]interface loopback 0 [R2-LoopBack0]ip address 10.1.2.2 255.255.255.255
system-view Enter system view, return user view with Ctrl+Z. [R3]interface Serial 2/0/0 [R3-Serial2/0/0]ip address 10.0.23.3 255.255.255.0 [R3-Serial2/0/0]interface loopback 1
HC Series
HUAWEI TECHNOLOGIES
223
HCNP-IERN Chapter 3 BGP application and management [R3-LoopBack1]ip address 10.1.3.3 255.255.255.255
system-view Enter system view, return user view with Ctrl+Z. [R4]interface Serial 1/0/0 [R4-Serial1/0/0]ip address 10.0.14.4 255.255.255.0 [R4-Serial1/0/0]interface loopback 0 [R4-LoopBack0]ip address 10.0.4.4 255.255.255.255
system-view Enter system view, return user view with Ctrl+Z. [R5]interface GigabitEthernet 0/0/0 [R5-GigabitEthernet0/0/0]ip address 10.0.15.5 255.255.255.0 [R5-GigabitEthernet0/0/0]interface loopback 0 [R5-LoopBack0]ip address 10.1.5.5 255.255.255.255
After you have configured IP addresses and masks for the interfaces, test the connectivity of direct links. [R1]ping -c 1 10.0.12.2 PING 10.0.12.2: 56 data bytes, press CTRL_C to break Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=41 ms
--- 10.0.12.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 41/41/41 ms
[R1]ping -c 1 10.0.14.4 PING 10.0.14.4: 56 data bytes, press CTRL_C to break Reply from 10.0.14.4: bytes=56 Sequence=1 ttl=255 time=41 ms
--- 10.0.14.4 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 41/41/41 ms
[R1]ping -c 1 10.0.15.5 PING 10.0.15.5: 56 data bytes, press CTRL_C to break Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=34 ms
224
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management --- 10.0.15.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 34/34/34 ms
[R1]ping -c 1 10.0.23.3 PING 10.0.23.3: 56 data bytes, press CTRL_C to break Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=34 ms
--- 10.0.23.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 34/34/34 ms
Step 2 Configure EBGP and advertise routes. Establish BGP peer relationships between direct routers by using the IP addresses of physical interfaces. [R1]bgp 64513 [R1-bgp]peer 10.0.12.2 as-number 64514 [R1-bgp]peer 10.0.14.4 as-number 64512 [R1-bgp]peer 10.0.15.5 as-number 64516
[R2]bgp 64514 [R2-bgp]peer 10.0.12.1 as-number 64513 [R2-bgp]peer 10.0.23.3 as-number 64515
[R3]bgp 64515 [R3-bgp]peer 10.0.23.2 as-number 64514
[R4]bgp 64512 [R4-bgp]peer 10.0.14.1 as-number 64513
[R5]bgp 64516 [R5-bgp]peer 10.0.15.1 as-number 64513
After you have completed the configuration, check the peer relationships.
HC Series
HUAWEI TECHNOLOGIES
225
HCNP-IERN Chapter 3 BGP application and management [R1]display bgp peer BGP local router ID : 10.0.12.1 Local AS number : 64513 Total number of peers : 3
Peer
V
Peers in established state : 3
AS MsgRcvd MsgSent OutQ
Up/Down
State
PrefRcv
10.0.12.2
4
64514
3
3
0 00:01:55 Established
0
10.0.14.4
4
64512
3
3
0 00:01:03 Established
0
10.0.15.5
4
64516
2
3
0 00:00:03 Established
0
[R2]display bgp peer
BGP local router ID : 10.0.12.2 Local AS number : 64514 Total number of peers : 2
Peer
V
Peers in established state : 2
AS MsgRcvd MsgSent OutQ Up/Down
State PrefRcv
10.0.12.1
4
64513
4
6
0 00:02:51 Established
0
10.0.23.3
4
64515
6
6
0 00:04:42 Established
0
[R3]display bgp peer
BGP local router ID : 10.0.23.3 Local AS number : 64515 Total number of peers : 1
Peer
V
10.0.23.2
4
Peers in established state : 1
AS MsgRcvd MsgSent OutQ Up/Down
64514
6
6
State PrefRcv
0 00:04:54 Established
0
[R4]display bgp peer
BGP local router ID : 10.0.14.4 Local AS number : 64512 Total number of peers : 1
Peer
V
10.0.14.1
4
Peers in established state : 1
AS MsgRcvd MsgSent OutQ Up/Down
64513
4
4
State PrefRcv
0 00:02:46 Established
[R5]display bgp peer
226
HUAWEI TECHNOLOGIES
HC Series
0
HCNP-IERN Chapter 3 BGP application and management
BGP local router ID : 10.0.15.5 Local AS number : 64516 Total number of peers : 1
Peer
V
10.0.15.1
4
Peers in established state : 1
AS MsgRcvd MsgSent OutQ Up/Down
64513
3
3
State PrefRcv
0 00:01:26 Established
0
Currently, all BGP peer relationships are in the Established state. Run the network command to advertise to BGP the routes for the network segment where the routers’ loopback interfaces reside.. [R1]bgp 64513 [R1-bgp]network 10.1.1.1 255.255.255.255
[R2]bgp 64514 [R2-bgp]network 10.1.2.2 255.255.255.255
[R3]bgp 64515 [R3-bgp]network 10.1.3.3 255.255.255.255
[R4]bgp 64512 [R4-bgp]network 10.0.4.4 255.255.255.255
[R5]bgp 64516 [R5-bgp]network 10.1.5.5 255.255.255.255
View the BGP routing table of R4 to verify the AS-PATH attribute. [R4]display bgp routing-table
BGP Local router ID is 10.0.14.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 5 Network
NextHop
MED
LocPrf
PrefVal Path/Ogn
*>
10.0.4.4/32
0.0.0.0
0
0
i
*>
10.1.1.1/32
10.0.14.1
0
0
64513i
*>
10.1.2.2/32
10.0.14.1
0
64513 64514i
HC Series
HUAWEI TECHNOLOGIES
227
HCNP-IERN Chapter 3 BGP application and management *>
10.1.3.3/32
10.0.14.1
0
64513 64514
10.0.14.1
0
64513 64516i
64515i *>
10.1.5.5/32
Step 3 Run the network command to summarize BGP routes. Summarize routes on R1. Add the static route 10.1.0.0/16 to the Null0 interface on R1 and run the network command to advertise the route. [R1]ip route-static 10.1.0.0 16 NULL 0 [R1]bgp 64513 [R1-bgp]network 10.1.0.0 255.255.0.0
View the routing table of R4 to check whether the summarized route is available. display bgp routing-table
BGP Local router ID is 10.0.14.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 6 Network
NextHop
MED
LocPrf
PrefVal Path/Ogn
*>
10.0.4.4/32
0.0.0.0
0
0
i
*>
10.1.0.0/16
10.0.14.1
0
0
64513i
*>
10.1.1.1/32
10.0.14.1
0
0
64513i
*>
10.1.2.2/32
10.0.14.1
0
64513 64514i
*>
10.1.3.3/32
10.0.14.1
0
64513 64514
10.0.14.1
0
64513 64516i
64515i *>
10.1.5.5/32
Configure a prefix list pref_detail_control to filter routes sent to the peer R4 and prevent specific route information contained in the summarized route from being sent. 228
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management [R1]ip ip-prefix pref_detail_control index 10 permit 10.1.0.0 8 less-equal 24 [R1]bgp 64513 [R1-bgp]peer 10.0.14.4 ip-prefix pref_detail_control export
View the BGP routing table of R4 to check the AS-PATH attribute of the summarized route. display bgp routing-table
BGP Local router ID is 10.0.14.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 2 Network
NextHop
MED
LocPrf
PrefVal Path/Ogn
*>
10.0.4.4/32
0.0.0.0
0
0
i
*>
10.1.0.0/16
10.0.14.1
0
0
64513i
Step 4 Run the aggregate command to summarize BGP routes. Delete the prefix list used in step 3 and the summarized route advertised through the network command. Run the aggregate command to summarize the route 10.1.0.0/16 by using the default mode. [R1]undo ip ip-prefix pref_detail_control [R1]bgp 64513 [R1-bgp]undo network 10.1.0.0 255.255.0.0 [R1-bgp]undo peer 10.0.14.4 ip-prefix pref_detail_control export [R1-bgp]aggregate 10.1.0.0 255.255.0.0
View the routing tables of R1 and R4 to check the Origin attribute of the summarized route. [R1]display bgp routing-table
BGP Local router ID is 10.0.12.1 Status codes: * - valid, > - best, d - damped,
HC Series
HUAWEI TECHNOLOGIES
229
HCNP-IERN Chapter 3 BGP application and management h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 6 Network
NextHop
MED
*>
10.0.4.4/32
10.0.14.4
*>
10.1.0.0/16
127.0.0.1
*>
10.1.1.1/32
0.0.0.0
*>
10.1.2.2/32
10.0.12.2
*>
10.1.3.3/32
10.0.12.2
*>
10.1.5.5/32
10.0.15.5
LocPrf
PrefVal Path/Ogn
0
0
64512i
0
i
0
0
i
0
0
64514i
0
64514 64515i
0
64516i
0
display bgp routing-table
BGP Local router ID is 10.0.14.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 6 Network
NextHop
MED
*>
10.0.4.4/32
0.0.0.0
*>
10.1.0.0/16
10.0.14.1
*>
10.1.1.1/32
10.0.14.1
*>
10.1.2.2/32
*>
10.1.3.3/32
LocPrf
0
PrefVal Path/Ogn
0
i
0
64513i
0
64513i
10.0.14.1
0
64513 64514i
10.0.14.1
0
64513 64514
10.0.14.1
0
64513 64516i
0
64515i *>
10.1.5.5/32
The Origin attribute of the summarized route is not modified. It is still IGP. Prevent specific routes from being advertised when configuring route aggregation on R1. Advertise only the summarized route. [R1-bgp]aggregate 10.1.0.0 255.255.0.0 detail-suppressed
View the BGP routing table of R4. [R4]display bgp routing-table
230
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management
BGP Local router ID is 10.0.14.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total Number of Routes: 2 Network
NextHop
MED
*>
10.0.4.4/32
0.0.0.0
*>
10.1.0.0/16
10.0.14.1
LocPrf
0
PrefVal Path/Ogn
0
i
0
64513i
No specific route is available on R4. View the global routing table of R1 to check the next hop of the route 10.1.0.0/16. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 21
Destination/Mask
10.0.4.4/32
Routes : 21
Proto
Pre Cost
EBGP
255 0
Flags NextHop
Interface
D
10.0.14.4
Serial3/0/0
10.0.12.0/24
Direct 0
0
D
10.0.12.1
Serial1/0/0
10.0.12.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.12.2/32
Direct 0
0
D
10.0.12.2
Serial1/0/0
10.0.12.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.14.0/24
Direct 0
0
D
10.0.14.1
Serial3/0/0
10.0.14.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.14.4/32
Direct 0
0
D
10.0.14.4
Serial3/0/0
10.0.14.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.15.0/24
Direct 0
0
D
10.0.15.1
10.0.15.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.15.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.1.0.0/16
Static 60
0
D
0.0.0.0
NULL0
10.1.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.1.2.2/32
EBGP
255 0
D
10.0.12.2
Serial1/0/0
10.1.3.3/32
EBGP
255 0
D
10.0.12.2
Serial1/0/0
10.1.5.5/32
EBGP
255 0
D
10.0.15.5
GigabitEthernet0/0/0
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
HC Series
HUAWEI TECHNOLOGIES
231
HCNP-IERN Chapter 3 BGP application and management 255.255.255.255/32 Direct 0
0
D
127.0.0.1
InLoopBack0
The summarized route is configured on R1; therefore, the outbound interface is Null0. Route aggregation can avoid routing loops. View the BGP routing table of R1 to check specific routes. [R1]display bgp routing-table
BGP Local router ID is 10.0.12.1 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 6 Network
NextHop
MED
*>
10.0.4.4/32
10.0.14.4
*>
10.1.0.0/16
127.0.0.1
s>
10.1.1.1/32
0.0.0.0
s>
10.1.2.2/32
10.0.12.2
s>
10.1.3.3/32
10.0.12.2
s>
10.1.5.5/32
10.0.15.5
LocPrf
0
PrefVal Path/Ogn
0
64512i
0
i
0
0
i
0
0
64514i
0
64514 64515i
0
64516i
0
The detail-suppressed parameter is used; therefore, only the summarized route is sent. The letter "s" is added before each specific route, which indicates that the specific routes are suppressed during route aggregation.
Step 5 Modify the attributes of a summarized route. By default, BGP does not advertise the community attribute to any peer. Enable R5 to advertise the community attribute to R1 and enable R1 to advertise the community attribute to R4. [R5]bgp 64516 [R5-bgp]peer 10.0.15.1 advertise-community
[R1]bgp 64513 [R1-bgp]peer 10.0.14.4 advertise-community
232
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management
Verify that the community attribute will be lost after route aggregation. Add the community attribute with the value 100 to the route 10.1.5.5/32 on R5 and advertise the route to R1. [R5]acl number 2000 [R5-acl-basic-2000]rule 0 permit source 10.1.5.5 0 [R5-acl-basic-2000]route-policy set_comm permit node 10 [R5-route-policy]if-match acl 2000 [R5-route-policy]apply community 100 [R5-route-policy]bgp 64516 [R5-bgp]peer 10.0.15.1 route-policy set_comm export
Check whether the summarized route carries the community attribute on R1. display bgp routing-table community
BGP Local router ID is 10.0.14.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 2 Network
*>
10.1.5.0/24
NextHop
MED
LocPrf
PrefVal Community
10.0.15.5
0
<0:100>
Check whether the summarized route carries the community attribute on R4. display bgp routing-table community
Total Number of Routes: 0
No route carrying the community attribute is available on R4. Create the routing policy dd_comm on R1 and add the community attribute with the value 100:2 to the summarized route. [R1]acl number 2000 [R1-acl-basic-2000]rule 0 permit source 10.1.0.0 0.0.255.255 [R1-acl-basic-2000]route-policy add_comm permit node 10 [R1-route-policy]if-match acl 2000
HC Series
HUAWEI TECHNOLOGIES
233
HCNP-IERN Chapter 3 BGP application and management [R1-route-policy]apply community 100:2 [R1-route-policy]bgp 64513 [R1-bgp]aggregate 10.1.0.0 255.255.0.0 attribute-policy add_comm
Check whether the summarized route carries the community attribute with the value 100:2 on R4. display bgp routing-table community BGP Local router ID is 10.0.14.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 1 Network
*>
NextHop
10.1.0.0/16
MED
LocPrf
10.0.14.1
PrefVal Community
0
<100:2>
The summarized route learned by R4 carries the community attribute.
Step 6 Configure the AS-PATH attribute by using the AS-SET attribute. A summarized route discards the AS-PATH attribute by default. Loss of the AS-PATH attribute may cause loops. To avoid information loss, add the AS-SET attribute to summarized routes. Add the AS-SET attribute to a summarized route on R1. [R1]bgp 64513 [R1-bgp]aggregate 10.1.0.0 255.255.0.0 detail-suppressed as-set
View the AS-PATH attribute of the summarized route in the BGP routing tables on R1 and R4. [R1]display bgp routing-table
BGP Local router ID is 10.0.12.1 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
234
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management Total Number of Routes: 6 Network
NextHop
MED
*>
10.0.4.4/32
10.0.14.4
*>
10.1.0.0/16
127.0.0.1
LocPrf
0
PrefVal Path/Ogn
0
64512i
0
{64514 64515
64516}i s>
10.1.1.1/32
0.0.0.0
0
0
i
s>
10.1.2.2/32
10.0.12.2
0
0
64514i
s>
10.1.3.3/32
10.0.12.2
0
64514 64515i
s>
10.1.5.5/32
10.0.15.5
0
64516i
0
display bgp routing-table
BGP Local router ID is 10.0.14.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 2 Network
NextHop
MED
*>
10.0.4.4/32
0.0.0.0
*>
10.1.0.0/16
10.0.14.1
LocPrf
0
PrefVal Path/Ogn
0
i
0
64513 {64514
64515 64516}i
After the AS-SET attribute is added, the AS-PATH attribute of a summarized route contains AS path information about detailed routes. Stop advertising the route 10.1.3.3/32 on R3 to reset the peer relationship. [R3]bgp 64515 [R3-bgp]undo network 10.1.3.3 255.255.255.255 [R3-bgp]return reset bgp all
After the peer relationship is re-established, view the AS-PATH attribute of the summarized route learned by R4. display bgp routing-table
BGP Local router ID is 10.0.14.4 Status codes: * - valid, > - best, d - damped, h - history, i - internal, s - suppressed, S - Stale
HC Series
HUAWEI TECHNOLOGIES
235
HCNP-IERN Chapter 3 BGP application and management Origin : i - IGP, e - EGP, ? - incomplete
Total Number of Routes: 2 Network
NextHop
MED
*>
10.0.4.4/32
0.0.0.0
*>
10.1.0.0/16
10.0.14.1
LocPrf
0
PrefVal Path/Ogn
0
i
0
64513 {64514
64516}i
The AS-PATH attribute does not contain the AS number 64515.
Additional Exercises: Analyzing and Verifying After you complete step 6 in the preceding example, can R5 access the loopback address of R3?
What are the differences between the aggregate and summary automatic commands?
Final Configurations display current-configuration [V200R001C00SPC200] # sysname R1 # acl number 2000 rule 0 permit source 10.1.0.0 0.0.255.255 # interface Serial1/0/0 link-protocol ppp ip address 10.0.12.1 255.255.255.0 # interface Serial3/0/0 link-protocol ppp ip address 10.0.14.1 255.255.255.0 # interface GigabitEthernet0/0/0 ip address 10.0.15.1 255.255.255.0 #
236
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management interface LoopBack0 ip address 10.1.1.1 255.255.255.255 # bgp 64513 peer 10.0.12.2 as-number 64514 peer 10.0.14.4 as-number 64512 peer 10.0.15.5 as-number 64516 # ipv4-family unicast undo synchronization aggregate 10.1.0.0 255.255.0.0 as-set detail-suppressed network 10.1.1.1 255.255.255.255 peer 10.0.12.2 enable peer 10.0.14.4 enable peer 10.0.14.4 advertise-community peer 10.0.15.5 enable # route-policy add_comm permit node 10 if-match acl 2000 apply community 100:2 # ip route-static 10.1.0.0 255.255.0.0 NULL0 # return
display current-configuration [V200R001C00SPC200] # sysname R2 # interface Serial1/0/0 link-protocol ppp ip address 10.0.12.2 255.255.255.0 # interface Serial2/0/0 link-protocol ppp ip address 10.0.23.2 255.255.255.0 # interface LoopBack0 ip address 10.1.2.2 255.255.255.255 # bgp 64514 peer 10.0.12.1 as-number 64513
HC Series
HUAWEI TECHNOLOGIES
237
HCNP-IERN Chapter 3 BGP application and management peer 10.0.23.3 as-number 64515 # ipv4-family unicast undo synchronization network 10.1.2.2 255.255.255.255 peer 10.0.12.1 enable peer 10.0.23.3 enable # return
display current-configuration [V200R001C00SPC200] # sysname R3 # interface Serial2/0/0 link-protocol ppp ip address 10.0.23.3 255.255.255.0 # interface LoopBack1 ip address 10.1.3.3 255.255.255.255 # bgp 64515 peer 10.0.23.2 as-number 64514 # ipv4-family unicast undo synchronization peer 10.0.23.2 enable # return
display current-configuration [V200R001C00SPC200] # sysname R4 # interface Serial1/0/0 link-protocol ppp ip address 10.0.14.4 255.255.255.0 # interface LoopBack0 ip address 10.0.4.4 255.255.255.255 #
238
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management bgp 64512 peer 10.0.14.1 as-number 64513 # ipv4-family unicast undo synchronization network 10.0.4.4 255.255.255.255 peer 10.0.14.1 enable # return
display current-configuration [V200R001C00SPC200] # sysname R5 # acl number 2000 rule 0 permit source 10.1.5.5 0 # interface GigabitEthernet0/0/0 ip address 10.0.15.5 255.255.255.0 # interface LoopBack0 ip address 10.1.5.5 255.255.255.255 # bgp 64516 peer 10.0.15.1 as-number 64513 # ipv4-family unicast undo synchronization network 10.1.5.5 255.255.255.255 peer 10.0.15.1 enable peer 10.0.15.1 advertise-community peer 10.0.15.1 route-policy set_comm export # route-policy set_comm permit node 10 if-match acl 2000 apply community 100 # Return
HC Series
HUAWEI TECHNOLOGIES
239
HCNP-IERN Chapter 3 BGP application and management
Lab 3-3 BGP Attributes and Path Selection 1 Learning Objectives The objectives of this lab are to learn and understand: •
Method used to change path selection by configuring the AS-PATH attribute
•
Method used to change path selection by configuring the Origin attribute
•
Method used to change path selection by configuring the Local-Pref attribute
•
Method used to change path selection by configuring the MED attribute
Topology
Figure 3-3 BGP attributes and path selection
240
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management
Scenario Assume that you are a network engineer of a company. The network of the company uses BGP to access two service providers. The company uses the private AS 64512. The AS number for ISP1 is 100, and 200 for ISP2. The company provides two links for access to ISP1 and rents a line for access to ISP2. Certain Internet subscribers complain that the network speed of the company is too slow. Therefore, you modify BGP attributes to adjust route directions.
Tasks Step 1 Configure IP addresses. Configure IP addresses and masks for the physical interfaces and loopback interfaces of all routers. Loopback0 interfaces use 32-bit masks. system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R1 [R1]interface Serial 1/0/0 [R1-Serial1/0/0]ip address 10.0.12.1 255.255.255.0 [R1-Serial1/0/0]interface GigabitEthernet 0/0/2 [R1-GigabitEthernet0/0/2]ip address 10.0.15.1 255.255.255.0 [R1-GigabitEthernet0/0/2]interface GigabitEthernet 0/0/1 [R1-GigabitEthernet0/0/1]ip address 10.0.111.1 255.255.255.0 [R1-GigabitEthernet0/0/1]interface LoopBack 0 [R1-LoopBack0]ip address 10.0.1.1 255.255.255.255
system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R2 [R2]interface Serial 1/0/0 [R2-Serial1/0/0]ip address 10.0.12.2 255.255.255.0 [R2-Serial1/0/0]int Serial 2/0/0 [R2-Serial2/0/0]ip address 10.0.23.2 255.255.255.0 [R2-Serial2/0/0]interface LoopBack 0 [R2-LoopBack0]ip address 10.0.2.2 255.255.255.0
system-view
HC Series
HUAWEI TECHNOLOGIES
241
HCNP-IERN Chapter 3 BGP application and management Enter system view, return user view with Ctrl+Z. [Huawei]sysname R3 [R3]interface GigabitEthernet 0/0/2 [R3-GigabitEthernet0/0/2]ip address 10.0.15.3 255.255.255.0 [R3-GigabitEthernet0/0/2]interface Serial 2/0/0 [R3-Serial2/0/0]ip address 10.0.23.3 255.255.255.0 [R3-Serial2/0/0]interface Serial 3/0/0 [R3-Serial3/0/0]ip address 10.0.35.3 255.255.255.0 [R3-Serial3/0/0]interface loopback 0 [R3-LoopBack0]ip address 10.0.3.3 255.255.255.255
system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R4 [R4]interface GigabitEthernet 0/0/1 [R4-GigabitEthernet0/0/1]ip address 10.0.114.4 255.255.255.0 [R4-GigabitEthernet0/0/1]interface GigabitEthernet 0/0/0 [R4-GigabitEthernet0/0/0]ip address 10.0.45.4 255.255.255.0 [R4-GigabitEthernet0/0/0]interface loopback 0 [R4-LoopBack0]ip address 10.0.4.4 255.255.255.255
system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R5 [R5]interface Serial 1/0/0 [R5-Serial1/0/0]ip address 10.0.35.5 255.255.255.0 [R5-Serial1/0/0]interface GigabitEthernet 0/0/0 [R5-GigabitEthernet0/0/0]ip address 10.0.45.5 255.255.255.0 [R5-GigabitEthernet0/0/0]interface loopback 0 [R5-LoopBack0]ip address 10.0.5.5 255.255.255.255
After you have configured IP addresses and masks, test the connectivity of direct links. ping -c 1 10.0.12.2 PING 10.0.12.2: 56 data bytes, press CTRL_C to break Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=29 ms
--- 10.0.12.2 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 29/29/29 ms
242
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management
[R1]ping -c 1 10.0.15.3 PING 10.0.15.3: 56 data bytes, press CTRL_C to break Reply from 10.0.15.3: bytes=56 Sequence=1 ttl=255 time=59 ms
--- 10.0.15.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 59/59/59 ms
ping -c 1 10.0.23.3 PING 10.0.23.3: 56 data bytes, press CTRL_C to break Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=255 time=32 ms
--- 10.0.23.3 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 32/32/32 ms
[R3]ping -c 1 10.0.35.5 PING 10.0.35.5: 56 data bytes, press CTRL_C to break Reply from 10.0.35.5: bytes=56 Sequence=1 ttl=255 time=36 ms
--- 10.0.35.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 36/36/36 ms
ping -c 1 10.0.45.5 PING 10.0.45.5: 56 data bytes, press CTRL_C to break Reply from 10.0.45.5: bytes=56 Sequence=1 ttl=255 time=11 ms
--- 10.0.45.5 ping statistics --1 packet(s) transmitted 1 packet(s) received 0.00% packet loss round-trip min/avg/max = 11/11/11 ms
HC Series
HUAWEI TECHNOLOGIES
243
HCNP-IERN Chapter 3 BGP application and management
Step 2 Configure IGP and BGP. Configure AS 64512 to use OSPF as the IGP and add all devices in AS 64512 to area 0. Enable OSPF on the network segments of both G0/0/1 and Loopback0 of R1. [R1]ospf [R1-ospf-1]area 0 [R1-ospf-1-area-0.0.0.0]network 10.0.111.1 0.0.0.0 [R1-ospf-1-area-0.0.0.0]network 10.0.1.1 0.0.0.0
Create VLAN 111 on S1 and configure a Vlanif IP address for interconnection with R1. Create VLAN 114 on S1 and configure a Vlanif IP address for interconnection with R4. Set the working mode of the interconnected interfaces to Access and enable OSPF overVlanif 111 and Vlanif 114 of S1 and the Loopback0 interface. [S1]vlan 111 [S1-vlan111]vlan 114 [S1]interface vlan 111 [S1-Vlanif111]ip address 10.0.111.11 255.255.255.0 [S1-Vlanif111]int vlan 114 [S1-Vlanif114]ip address 10.0.114.11 255.255.255.0 [S1]interface loopback 0 [S1-LoopBack0]ip address 10.0.11.11 255.255.255.255 [S1-LoopBack0]interface GigabitEthernet 0/0/1 [S1-GigabitEthernet0/0/1]port link-type access [S1-GigabitEthernet0/0/1]port default vlan 111 [S1-GigabitEthernet0/0/1]interface GigabitEthernet 0/0/4 [S1-GigabitEthernet0/0/4]port link-type access [S1-GigabitEthernet0/0/4]port default vlan 114 [S1-GigabitEthernet0/0/4]ospf [S1-ospf-1]area 0 [S1-ospf-1-area-0.0.0.0]network 10.0.111.11 0.0.0.0 [S1-ospf-1-area-0.0.0.0]network 10.0.114.11 0.0.0.0 [S1-ospf-1-area-0.0.0.0]network 10.0.11.11 0.0.0.0
Enable OSPF on the network segments of both G0/0/1 and 244
HUAWEI TECHNOLOGIES
HC Series
HCNP-IERN Chapter 3 BGP application and management
Loopback0 of R4. [R4]ospf [R4-ospf-1]area 0 [R4-ospf-1-area-0.0.0.0]network 10.0.114.4 0.0.0.0 [R4-ospf-1-area-0.0.0.0]network 10.0.4.4 0.0.0.0
Check whether the routers have learned the routes associated with the Loopback0 interfaces of other devices. [R1]display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 23
Destination/Mask
Proto
Routes : 23
Pre Cost
Flags NextHop
Interface
10.0.1.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.4.4/32
OSPF
10
2
D
10.0.111.11 GigabitEthernet0/0/1
10.0.11.11/32
OSPF
10
1
D
10.0.111.11 GigabitEthernet0/0/1
10.0.12.0/24
Direct 0
0
D
10.0.12.1
Serial1/0/0
10.0.12.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.12.2/32
Direct 0
0
D
10.0.12.2
Serial1/0/0
10.0.12.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.14.0/24
Direct 0
0
D
10.0.14.1
Serial3/0/0
10.0.14.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.14.4/32
Direct 0
0
D
10.0.14.4
Serial3/0/0
10.0.14.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.15.0/24
Direct 0
0
D
10.0.15.1
Serial2/0/0
10.0.15.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.15.3/32
Direct 0
0
D
10.0.15.3
Serial2/0/0
10.0.15.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.111.0/24
Direct 0
0
D
10.0.111.1 GigabitEthernet0/0/1
10.0.111.1/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.111.255/32
Direct 0
0
D
127.0.0.1
InLoopBack0
OSPF
2
D
10.0.111.11 GigabitEthernet0/0/1
10.0.114.0/24
10
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
[S1]display ip routing-table Route Flags: R - relay, D - download to fib
HC Series
HUAWEI TECHNOLOGIES
245
HCNP-IERN Chapter 3 BGP application and management ---------------------------------------------------------------------------Routing Tables: Public Destinations : 11
Destination/Mask
Routes : 11
Proto Pre Cost
Flags NextHop
Interface
10.0.1.1/32
OSPF
10
1
D
10.0.111.1
Vlanif111
10.0.4.4/32
OSPF
10
1
D
10.0.114.4
Vlanif114
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.11.11/32 10.0.111.0/24
Direct 0
0
D
10.0.111.11
Vlanif111
10.0.111.11/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.0.114.0/24
Direct 0
0
D
10.0.114.11
Vlanif114
10.0.114.11/32
Direct 0
0
D
127.0.0.1
InLoopBack0
10.1.11.0/24
Direct 0
0
D
10.1.11.11
LoopBack1
10.1.11.11/32
Direct 0
0
D
127.0.0.1
InLoopBack0
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
display ip routing-table Route Flags: R - relay, D - download to fib ---------------------------------------------------------------------------Routing Tables: Public Destinations : 18