"Theoretical Preparation"
The way the OSPF default route is published depends on the type of zone that introduces the default route, mainly for common areas, stub regions and complete stub regions, Nssa regions, and fully nssa areas.
OSPF default route Publishing method:
L Configure a specific area for automatic generation, stub/totally stub/totally Nssa
L Configure commands to generate default routes: Normal area default-route-advertise [always]
Nssa Area Nssa Default-route-advertise
OSPF default routes are typically applied to the following two scenarios: Regional boundary Router (ABR) publishing and autonomous system boundary router (ASBR) publishing.
Table 1 OSPF missing default routing summary table
A key command default-route-advertise [[always | cost | route-policy route-policy-name | type Type] * | Summary cost CO St]undo default-route-advertise view OSPF view parameters always: If there is no default route in the routing table for the current router, use this parameter to produce a Type-5 LSA publication that describes the default route. If you do not specify this keyword, only a default route in the local router's routing table can produce a Type-5 LSA that describes the default route. Cost: The measure of the default route, with a value range of 0~16777214, and if not specified, the default route's measure will take the value that is configured by the default cost command. Route-policy Route-policy-name: A string of 1~19 characters for the routing policy name. Only a default route exists in the routing table of the current router, and a route matching route-policy-name the specified routing policy can produce a Type-5 LSA publishing that describes the default route, and the specified routing policy affects the values in the Type-5 LSA. If you specify the always parameter at the same time, regardless of whether there is a default route in the current router's routing table, a Type-5 LSA that describes the default route will be published as long as there is a route matching the specified routing policy, and the specified routing policy affects the value in the Type-5 LSA. Type type: This is the Type-5 LSA, with a value range of 1~2, and if not specified, the default type of the TYPE-5 LSA will take the value configured by the default-type command. Summary: Publishes the Type-3 summary LSA that specifies the default route. Describes the default-route-advertise command used to introduce a default route into the OSPF routing area. The Undo Default-route-advertise command is used to cancel the introduction of the default route. By default, default routes are not introduced. You cannot introduce a default route using the Import-route command, which you must use if you want to introduce a default route. When there is no default route in the routing table for the local router, a Type-5 LSA that describes the default route should use the Always keyword. The default-route-advertise Summary cost command is only applied in the VPN to introduce the default route to the Type-3 LSA, and the PE router will introduce the default pathIssued to the CE router. Related configuration can refer to command Import-route and default. Example # Regardless of whether a default route exists in the local router's routing table, the resulting default route is introduced into the OSPF routing area (the local router does not have a default route). If you do not add always, you must configure a default route before you can introduce the default route into the zone. <Sysname> System-view[sysname] OSPF 100[sysname-ospf-100] default-route-advertise always "topology and experimental Software" The switch used in this paper is H3C Simulator, the download address is as follows: http://forum.h3c.com/forum.php?mod=viewthread&tid=109740&highlight=H3C%E6%A8% A1%e6%8b%9f%e5%99%a8 interested friends can download on the forum. The topology is as follows:
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Network/lyjs/
OSPF configuration "will be followed by a detailed configuration" BGP configuration "<r1><r1>dis BGP peer BGP Local router id:10.1.1.2 local as number:100 total num ber of peers:1 peers in established state:1 peer & nbsp v as msgrcvd msgsent outq prefrcv up/down state. 3.2 4 0 6 00:19:18 Established<r1><r1><r1>dis IP rorouting tables:public des Tinations:14 routes:14destination/mask proto pre cost &NBS P Nexthop INTERFACE1.1.1.1/32 &NBSP;OSPF 156 2 2.2.2.2 S0/6/32.2.2.0/30 &NBSP;DIREC T 0 &nbsP;0 2.2.2.1 S0/6/32.2.2.1/32 &NB Sp direct 0 0 127.0.0.1 INLOOP02.2.2.2/32 &N Bsp direct 0 0 2.2.2.2 & nbsp S0/6/33.3.3.0/30 direct 0 0 3.3.3. 1 S0/6/03.3.3.1/32 direct 0 0 &NB Sp 127.0.0.1 INLOOP03.3.3.2/32 direct 0 &NB Sp;0 3.3.3.2 S0/6/04.4.4.0/30 &N Bsp &NBSP;BGP 255 0 3.3.3.2 s0/6/04.4.4.2/32 &NBSP;BGP 255 0 3.3.3.2 &NB Sp S0/6/05.5.5.1/32 &NBSP;BGP 255 1562 &NBS P 3.3.3.2 S0/6/010.1.1.2/32 Direct 0 0 &N Bsp 127.0.0.1 INLOOP010.1.1.3/32 BGP 255 0 3.3.3.2 S0/6/0127.0.0.0/8 & nbsp Direct 0 0 127.0.0.1 INLOOP0127.0.0.1/32 direct 0 0 127.0.0.1 &NBSP ; Inloop0<r2>dis IP rorouting tables:public destinations:14 Routes : 14Destination/mask proto pre cost nexthop I NTERFACE1.1.1.1/32 &NBSP;BGP 255 1562 3.3.3.1 & nbsp S0/6/02.2.2.0/30 &NBSP;BGP 255 0 3.3.3.1 S0/6/02.2.2.2/32 &NBSP;BGP &NBS p;255 0 3.3.3.1 S0/6/03.3.3.0/30 direct 0 0 3.3.3.2 S 0/6/03.3.3.1/32 direct 0 0 3.3.3.1 S0/6/03.3.3.2/32 direct 0 0 &NBS P 127.0.0.1 INLOOP04.4.4.0/30 direct 0 0 &NB Sp 4.4.4.1 S0/6/14.4.4.1/32 direct 0 0 127.0.0.1 INLOOP04.4.4.2/32 &N Bsp direct 0 0 4.4.4.2 S0/6/15. 5.5.1/32 &NBSP;OSPF 1562 4.4.4.2 &N Bsp S0/6/110.1.1.2/32 BGP 255 0 &NBSP ; 3.3.3.1 S0/6/010.1.1.3/32 Direct 0 0 & nbsp 127.0.0.1 INLOOP0127.0.0.0/8 Direct 0 0 &nbsP 127.0.0.1 INLOOP0127.0.0.1/32 direct 0 & nbsp 0 127.0.0.1 Inloop0<r5>dis IP rorouting Tables: Public destinations:7 routes:7destination/mask prot o pre cost nexthop INTERFACE1.1.1.1/32 & nbsp direct 0 0 127.0.0.1 InLoop02.2.2. 0/30 direct 0 0 2.2.2.2 &NB Sp S0/6/32.2.2.1/32 direct 0 0 &NBSP ; 2.2.2.1 S0/6/32.2.2.2/32 direct 0 0   ;   127.0.0.1 INLOOP010.1.1.1/32 Direct 0 & Nbsp;0 127.0.0.1 INLOOP0127.0.0.0/8 &NB Sp Direct 0 0 127.0.0.1 INLOOP0127.0.0.1/32 direct 0 0 127.0.0.1 Inloo P0<r4>dis IP ro Routing tables:public destinations:7 routes : 7destination/mask proto pre cost nexthop &NBS P Interface4.4.4.0/30 direct 0 0 4.4 .4.2 S0/6/14.4.4.1/32 direct 0 0 &NBSP 4.4.4.1 S0/6/14.4.4.2/32 direct 0 0 127.0.0.1 INLOOP05.5.5.1/32 &N Bsp;direct 0 0 127.0.0.1 INLOOP010.1.1.4/32 &NB Sp Direct 0 0 127.0.0.1 Inloo P0127.0.0.0/8 Direct 0 0 127.0.0.1   ; INLOOP0127.0.0.1/32 direct 0 0 &N bsp;127.0.0.1 INLOOP0 but viewing the R5 and R4 routing tables found that they did not learn the full network route, but only learned the routing within as, and the analysis found that we had just introduced OSPF and direct-link routing to BGP, which is That we have passed the as internal route through the BGP protocol between as 100 and as 200, so R1 and R2 learned the routing of the whole network, and OSPF as IGP route did not learn from BGP to any routes, there are two ways to solve this problem: method one: The B GP routing is introduced to OSPFBecause BGP is aware of full network routing this time, if the BGP route is introduced to OSPF, then OSPF will know the whole network route. Method Two: Using the default route, Router B and Router C as ASBR are aware of the full network routing, and if they can post a default route internally, the problem will result. We use on R1 &NBSP;[R1]OSPF [R1-ospf-1]import-route BGP [R1-ospf-1]import-route direct We use [r2]ip on R2 route-static 0.0.0.0 0.0.0.0 3.3.3.1 [r2]ospf &NBSP ; [r2-ospf-1]default-route-advertise &NBSP;R1 After placement, R1 and R5 Routing and LSDB conditions are as follows: <r1>dis IP rorouting tables:public destinations:14 Routes:14destination/mask proto pre cost Nexthop &NBS P INTERFACE1.1.1.1/32 &NBSP;OSPF 1562 2.2.2.2 S0/6/32.2.2.0/30 direct 0 0 &NBS P 2.2.2.1 S0/6/32.2.2.1/32 direct 0 0 127.0.0.1 INLOOP02.2.2.2/32 &N Bsp direct 0 0 2.2.2.2 S0/6/33. 3.3.0/30 direct 0 0 3.3.3.1 S0/6/03.3.3.1/32 direct 0 0 &NBS P 127.0.0.1 INLOOP03.3.3.2/32 direct 0 0 &N Bsp 3.3.3.2 S0/6/04.4.4.0/30 &NBSP;B GP 255 0 3.3.3.2 S0/6/04.4.4.2/32 &NB Sp &NBSP;BGP 255 0 3.3.3.2 &NB Sp S0/6/05.5.5.1/32 &NBSP;BGP 255 1562 3.3.3.2 &NB Sp S0/6/010.1.1.2/32 Direct 0 0 &NB Sp 127.0.0.1 INLOOP010.1.1.3/32 BGP 255 0 &N Bsp 3.3.3.2 S0/6/0127.0.0.0/8 Direct 0 &nbs P 0 127.0.0.1 INLOOP0127.0.0.1/32 & Nbsp;direct 0 0 127.0.0.1 INLOOP0<R1>DIs OSPF ro OSPF Process 1 with Router ID 10.1.1.2 &NB Sp routing Tables Routing for network destination cost Type &NBS P Nexthop advrouter area 2.2.2.0/30 1562 Stub 2.2.2.1 10.1.1.2 0.0.0.0 1.1.1.1/32   ; 1562 Stub 2.2.2.2 10.1.1.1 &NBSP ; 0.0.0.0 Total nets:2 Intra area:2 inter area:0 ase:0 nssa:0 <r1>dis OSPF lsdb &N Bsp OSPF Process 1 with Router ID 10.1.1.2 Link S Tate Database area:0.0.0.0 Type   ; linkstate ID advrouter age len Sequence Metric Ro Uter 10.1.1.2 10.1.1.2 1307 48 &nbs p;80000004 0 Router 10.1.1.1 10.1.1.1 &N Bsp 444 60 80000004 0 A S External Database Type linkstate ID advrouter age &NB Sp Len Sequence Metric External 5.5.5.1 10.1.1.2 1307 36 80000001 1 External 4.4.4.0 10.1.1 .2 1307 36 80000001 1 External 4.4.4.2 &NB Sp &NBSP; 10.1.1.2 1307 36 80000001 1 External &nbs p;3.3.3.0 10.1.1.2 1304 36 80000001   ; 1 External 3.3.3.2 10.1.1.2 1304 3 6 80000001 1 External 2.2.2.0 10.1.1.2 & nbsp 1304 36 80000001 1 External 2.2.2.2 10.1.1.2 1304 36 80000001 1 External 10.1 .1.3 10.1.1.2 1307 36 80000001 &NBS P 1 External 10.1.1.2 10.1.1.2 1304 36   ; 80000001 1<r5>dis IP rorouting tables:public destinations:14 routes:14destination/mask proto pre cost Nexthop &nbs P INTERFACE1.1.1.1/32 direct 0 0 &N Bsp 127.0.0.1 INLOOP02.2.2.0/30 direct 0 0 &N Bsp 2.2.2.2 S0/6/32.2.2.1/32 &NBSP;D Irect 0 0 2.2.2.1 S0/6/32.2.2.2/32   ; direct 0 0 127.0.0.1 Inloop03.3.3.0/30 o_ase 150 1 2.2. 2.1 S0/6/33.3.3.2/32 o_ase 150 1 &NBSP ; 2.2.2.1 S0/6/34.4.4.0/30 o_ase 150 1 2.2.2.1 S0/6/34.4.4.2/32 &NBSP ; o_ase 150 1 2.2.2.1 S0/6/35.5.5.1/3 2 o_ase 150 1 2.2.2.1 S0/6/310.1.1.1/32 Direct 0 0 &N bsp;127.0.0.1 INLOOP010.1.1.2/32 o_ase 150 1 &N Bsp 2.2.2.1 S0/6/310.1.1.3/32 O_ase 150 &nbs P;1 &NBsp 2.2.2.1 S0/6/3127.0.0.0/8 Direct 0 &nbs P 0 127.0.0.1 INLOOP0127.0.0.1/32 & Nbsp;direct 0 0 127.0.0.1 Inloop0<r5>dis OSPF ro OSPF Process 1 with Router ID 10.1.1.1 &NBSP ; routing Tables Routing for network destination cost Type &NBS P Nexthop advrouter area 2.2.2.0/30 1562 Stub 2.2.2.2 10.1.1.1 0.0.0.0 1.1.1.1/32   ; 0 stub 1.1.1.1 10.1.1.1 &N Bsp 0.0.0.0 Routing for ASEs destination cost Type tag &NBS P nexthop Advrouter 5.5.5.1/32 1 type2 1 2.2.2.1 10.1.1.2 4.4.4.0/30 &NB Sp 1 type2 1 2.2.2.1 10.1.1.2 4.4.4.2/32 1 type2 1 &N Bsp 2.2.2.1 10.1.1.2 3.3.3.0/30 1 ty Pe2 1 2.2.2.1 10.1.1.2 3.3.3.2/32 &NBS P 1 type2 1 2.2.2.1 10.1.1.2 10.1.1.2/32 1 type2 1 2. 2.2.1 10.1.1.2 10.1.1.3/32 1 type2   ; 1 2.2.2.1 10.1.1.2 2.2.2.2/32 1 type2 1 2.2.2.1 10.1.1.2 Total Nets:10 Intra area:2 inter area:0 ase:8 nssa:0 <r5>dis OSPF lsdb OSPF Process 1 with Router IDs 10.1.1.1 Link State Database area:0.0.0.0 Type &NBSP ; Linkstate ID advrouter age len Sequence Metric Router & nbsp 10.1.1.2 10.1.1.2 1400 48 80000004 &N Bsp 0 Router 10.1.1.1 10.1.1.1 535 60 80000004 0 as External Database Type &N Bsp linkstate ID advrouter age len Sequence Me Tric External 5.5.5.1 10.1.1.2 1400 36 &N bsp;80000001 1 External 4.4.4.0 10.1.1.2 &NBSP ; 1400 36 80000001 1 External 4.4.4.2 10.1.1 .2 1400 36 80000001 1 External 3.3.3.0 &NB Sp   10.1.1.2 1396 36 80000001 1 External &nbs p;3.3.3.2 10.1.1.2 1396 36 80000001   ; 1 External 2.2.2.0 10.1.1.2 1396 3 6 80000001 1 External 2.2.2.2 10.1.1.2 & nbsp 1396 36 80000001 1 External 10.1.1.3 &NBSP ; 10.1.1.2 1400 36 80000001 1 External 10.1 .1.2 10.1.1.2 1396 36 80000001 &NBS P 1<r5>
-----------------------------------------------------------------------------