Article From:https://www.cnblogs.com/ricksteves/p/9688318.html

4、Detailed explanation of special area

To make our presentation easier to understand, let’s take a look at the topology above, which is an OSPF network covered by a client’s business logic structure, with three areas (in fact, far more than that), backbone area Area0 being deployed for primary and secondary rows, and *** rows being deployed for OSPFNormal areas, in order to ensure the smooth flow of the network, we declare all corners of the network into OSPF, feel very comfortable, but in fact, the router is very depressed, after all, as more and more devices, more and more network prefixes, routing entries will gradually increase, then the router Alexander, after all, PangLarge routing tables and LSA consume resources of routers.
From the point of view of network optimization, we have been trying to reduce the number of routing entries and LSAs in the network under the condition of guaranteeing the smooth flow of the network. Route aggregation is a good way. Of course, from the point of view of OSPF design and planning, we also have special areas for our flexible use. Let’s take a look at OHow does SPF special area help us reduce LSA flooding?
Let’s take area1 as the reference area. When area1 is the normal area, how many kinds of LSAs will be flooding in the area? The 1 category is bound to exist, because there are Ethernet links in area1, so there are 2 kinds of LSA. In addition, 3 other types of LSA in other regions have been injected into the ABR.Area. Furthermore, as area2’s ASBR introduces external routing (Class 5 LSA), LSA5 will also be flooded into area1, and of course the Class 4 LSA will follow. In this way, there are 1, 2, 3, 4, 5 in area1, and 5 types of LSA.I live. But when we think about it, we find that area1, as a “leaf” area, doesn’t need to know the details of the external routing. I just need to know that there is a way to get out of the domain, so the first special area: the stub area at the end.

Introduction of experimental environment
 

This content explains the experimental environment used as follows:

  • R1、R2、R3、R4Run OSPF;
  • The device interconnection address IP is shown in the figure.
  • All devices are configured with Loopback0 port, IP is x.x.x.x/32, and X is the device number. For example, the Loopback0 address of R1 is 1.1.1.1/32, which does not network into OSPF, only as device OSPF Route.RID use;
  • R4The Loopback1 interface is configured, the IP subnet is 44.44.44.0/24, and R4 connects the direct routing import into OSPF.

 

R1The configuration is as follows (omitting the configuration of the interface Ip address): [R1] OSPF 1 router-id 1.1.1.1
[R1-ospf-1] area 1
[R1-ospf-1-area-0.0.0.1] network 10.1.12.1 0.0.0.0

R2The configuration is as follows (omitting the configuration of the interface Ip address):
[R2] ospf 1 router-id 2.2.2.2
[R2-ospf-1] area 1
[R2-ospf-1-area-0.0.0.1] network 10.1.12.2 0.0.0.0
[R2-ospf-1] area 0
[R2-ospf-1-area-0.0.0.0] network 10.1.23.2 0.0.0.0

R3The configuration is as follows (omitting the configuration of the interface Ip address):
[R3] ospf 1 router-id 3.3.3.3
[R3-ospf-1] area 0
[R3-ospf-1-area-0.0.0.0] network 10.1.23.3 0.0.0.0
[R3-ospf-1] area 2
[R3-ospf-1-area-0.0.0.2] network 10.1.34.3 0.0.0.0

R4The configuration is as follows (omitting the configuration of the interface Ip address):
[R4] acl 2000
[R4- acl-basic-2000] rule permit source 44.44.44.0 0
[R4- acl-basic-2000] quit
[R4] route-policy RP permit node 10
[R4-route-policy] if-match acl 2000
[R4-route-policy] quit
[R4] ospf 1 router-id 4.4.4.4
[R4-ospf-1] import-route direct route-policy RP
[R4-ospf-1] area 2
[R4-ospf-1-area-0.0.0.2] network 10.1.34.4 0.0.0.0

Now let’s start with a variety of special areas.

1.Stub areaTerminal area

By configuring, we can set a regular area to the stub area. For example, in the following figure, configure area1 as stub area. The Stub area will prohibit 4 or 5 types of LSA from entering the area, and the ABR in that area will automatically issue a default route (3 types of LSA)A) enter the area to ensure that there is no problem of routing access outside the region. You don’t have to tell me the details, just let me go out. This is the design idea of stub area. When a large number of external routes are introduced into OSPF, properly planning some areas as stubs, can play a good role in network optimization, greatly reducing the number of routing entries that routers need to maintain.
It’s important to note that you can’t configure the backbone area Area0 as a stub area, and at the same time, you can assign an area as a stub area, where you won’t be allowed to inject external routes, that is, you can’t do a redistribution.

In the initial case, the routing table of R1 is as follows:
[R1] display ip routing-table
Route Flags: R – relay, D – download to fib
——————————————————————————
Routing Tables: Public
Destinations : 11       Routes : 11
Destination/Mask Proto  Pre  Cost  Flags NextHop         Interface
10.1.23.0/24   OSPF 10   2 D   10.1.12.2      GigabitEthernet0/0/0
10.1.34.0/24  OSPF  10   3 D   10.1.12.2      GigabitEthernet0/0/0
44.44.44.0/24  O_ASE150  1  D   10.1.12.2         GigabitEthernet0/0/0
……
We see routing in other areas, as well as external routing 44.44.44.0/24.
Look at R1’s LSDB again.
[R1] display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.1
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
Router    2.2.2.2         2.2.2.2           1723  36    80000005       1
Router    1.1.1.1         1.1.1.1            116  36    80000007       1
Network   10.1.12.1       1.1.1.1            116  32    80000004       0
Sum-Net   10.1.23.0       2.2.2.2           1710  28    80000002       1
Sum-Net   10.1.34.0       2.2.2.2           1655  28    80000002       2
Sum-Asbr  4.4.4.4         2.2.2.2           1572  28    80000002       2

AS External Database
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
External  44.44.44.0      4.4.4.4           1673  36    80000002       1
From above, we can see that there are 1, 2, 3, 4 and 5 types of LSA in LSDB of R1.

Now configure area1 to stub area:
R1The configuration changes are as follows:
[R1] ospf 1 router-id 1.1.1.1
[R1-ospf-1] area 1
[R1-ospf-1-area-0.0.0.1] stub
[R1-ospf-1-area-0.0.0.1] network 10.1.12.1 0.0.0.0
R2The configuration changes are as follows:
[R2] ospf 1 router-id 2.2.2.2
[R2-ospf-1] area 1
[R2-ospf-1-area-0.0.0.1] stub
[R2-ospf-1-area-0.0.0.1] network 10.1.12.1 0.0.0.0
[R2-ospf-1-area-0.0.0.1] area 0
[R2-ospf-1-area-0.0.0.0] network 10.1.23.2 0.0.0.0
Note that this command is configured on all routers in the stub area, and if one router is not configured, it will not be able to establish a neighborhood to other stub area routers.
Achieving results:

Area1There will be no four or five classes of LSA, which are redistributed in area2, filtered out by ABR (R2), and the router in area1 will get a default route for the three classes of LSA issued under ABR (R2).

[R1] display ip routing-table
Destination/Mask    Proto   Pre  Cost  Flags NextHop         Interface
0.0.0.0/0   OSPF   10   2     D  10.1.12.2       GigabitEthernet0/0/0
10.1.23.0/24  OSPF   10   2    D  10.1.12.2       GigabitEthernet0/0/0
10.1.34.0/24  OSPF   10   3    D  10.1.12.2       GigabitEthernet0/0/0
We found that the previous 44.44.44.0/24 external route was gone, and there was an additional OSPF default route, which was generated by ABR R2 and described by the three types of LSA. R1 can still connect Ping to 44.44.44.44 at this time.

[R1]display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.1
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
Router    2.2.2.2         2.2.2.2            106  36    80000005       1
Router    1.1.1.1         1.1.1.1            109  36    80000004       1
Network  10.1.12.2       2.2.2.2            106  32    80000002       0
Sum-Net 0.0.0.0         2.2.2.2            158  28    80000001       1
Sum-Net  10.1.23.0       2.2.2.2            158  28    80000001       1
Sum-Net  10.1.34.0       2.2.2.2            158  28    80000001       2
Looking at R1’s LSDB, we find that 4 or 5 types of LSA are gone, leaving only 1, 2 and 3 LSA.

 

2. Totally stub areatotally stub area

By planning the area as a stub area, you can optimize the network to a certain extent, but it doesn’t feel thorough enough. In fact, I don’t need to know much about other areas’routing (LSAs) except external routing. It’s OK to replace them with a default routing. So you canArea1 is configured as a totally stub area, and when an area is configured as a totally stub area, this area will:

  • Blocking 3, 4 and 5 LSA entry into the region
  • The ABR of the area automatically sends a default route of 3 types of LSA to this area.

As a result, the LSA received by the router in area1 will be further reduced, and the resource consumption will naturally be reduced when the LSA is stored and the SPF algorithm is performed. In addition, when the topology outside the area changes, the impact on the area will be minimized.
Similar to the stub area, you can’t configure the backbone area Area0 as a totally stub area. Of course, if an area is designated as a totally stub area, you won’t be able to do routing redistribution on the routers in the area.
Now configure area1 as Totally stub area:

R1The configuration changes are as follows:
[R1] ospf 1 router-id 1.1.1.1
[R1-ospf-1] area 1
[R1-ospf-1-area-0.0.0.1] stub
[R1-ospf-1-area-0.0.0.1] network 10.1.12.1 0.0.0.0

R2(ABR)The configuration changes are as follows:
[R2] ospf 1 router-id 2.2.2.2
[R2-ospf-1] area 1
[R2-ospf-1] stub no-summary
[R2-ospf-1-area-0.0.0.1] network 10.1.12.1 0.0.0.0
[R2-ospf-1-area-0.0.0.1] area 0
[R2-ospf-1-area-0.0.0.0] network 10.1.23.2 0.0.0.0

Achieving results:
When the above configuration is completed, the routers in area1 (except ABR) will have only the routes in the area, and all will have access to the default routes of the three classes issued by ABR. That is to say, the routing of other areas and the routing of external injection are blocked by ABR and replaced by a default routing.
[R1] display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.1
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
Router    2.2.2.2         2.2.2.2             27  36    80000008       1
Router    1.1.1.1         1.1.1.1             29  36    80000007       1
Network   10.1.12.1       1.1.1.1             25  32    80000002       0
Sum-Net   0.0.0.0         2.2.2.2            572  28    80000001       1

 

3. Not-So-Stubby Area Incomplete peripheral area (NSSA)

On the basis of previous knowledge, we have learned that, with network connectivity guaranteed, we can configure specific areas as endpoints or complete endpoints by reducing LSA flooding and streamlining routing tables. Look at the topology below. We configure area2 as stub, then this area.Domain 1 will block class 4 or 5 LSAs from other regions, and routers in the region prohibit redistribution of external routes. What if I expect this region to maintain the feature of “blocking class 4 or 5 LSAs from other regions” and allow me to redistribute routes locally in the region?

 

For example, suppose that area2 was originally run as a terminal area, but suddenly there was an external network that needed to be connected to our OSPF network and connected to area2, then in order to ensure the availability of the route, it was necessary to inject an external route into area2.And this violates the rules of stub area.
The concept of not-so-stubby-area is introduced here. When you configure an area as NSSA, the area will block the backbone of the four or five types of LSA, while allowing the area.Local import-route external routing, which floods in NSSA with a special LSA type, class 7 LSA, and class 7 LSA does not allow access to backbone or regular areas. NSSA’s ABR is responsible for “converting” the seven LSAs into five types of LSAIt further floods in the conventional area. The above “Allow Local Injection” means that the router configuration for this area of NSSA is redistributed, as shown below.

Now configure area2 to NSSA.
R3The configuration changes are as follows:
[R3] ospf 1 router-id 3.3.3.3
[R3-ospf-1] area 2
[R3-ospf-1-area-0.0.0.2] nssa
[R3-ospf-1-area-0.0.0.2] network 10.1.34.3 0.0.0.0
[R3-ospf-1-area-0.0.0.2] area 0
[R3-ospf-1-area-0.0.0.0] network 10.1.23.3 0.0.0.0

R4(ASBR)The configuration changes are as follows:
[R4] acl 2000
[R4- acl-basic-2000] rule permit source 44.44.44.0 0
[R4- acl-basic-2000] quit
[R4] route-policy RP permit node 10
[R4-route-policy] if-match acl 2000
[R4-route-policy] quit
[R3] ospf 1 router-id 4.4.4.4
[R3-ospf-1] import-route direct route-policy RP
[R3-ospf-1] area 2
[R3-ospf-1-area-0.0.0.2] network 10.1.34.4 0.0.0.0
[R3-ospf-1-area-0.0.0.2] nssa

Achieving results:
When area2 is configured as nssa, class 4 and 5 LSAs from the backbone area will not be able to enter NSSA, that is, if area1 is republished, then these republished external routes will not be able to enter NSSA (because five types of LSAs are not allowed in NSSA).At the same time, area2 allows local routers to do redistribute actions, redistribute incoming routes, flooding with LSA7 in NSSA, marking these external routes as “O_NSSA” in the routing table, and these seven types of LSA in “traversing” the NSSA’s ABR (R)3) before entering the backbone area, ABR (R3) is responsible for converting the 7 types of LSA into 5 types of LSA. Eventually, both Area0 and area1 can learn about these external routes, except that their routing tables display the “O_ASE” tag.
Let’s verify it on R3:
[R3] display ip routing-table
Destination/Mask    Proto     Pre   Cost   Flags NextHop         Interface
10.1.12.0/24  OSPF     10    2       D   10.1.23.2    GigabitEthernet0/0/0
44.44.44.0/24  O_NSSA  150   1        D   10.1.34.4    GigabitEthernet0/0/1
……
We see that R3 learns 44.44.44.0/24, and the protocol type “O_NSSA” indicates that this is a route computed by LSA7.
[R3] display ospf lsdb
OSPF Process 1 with Router ID 3.3.3.3
Link State Database
Area: 0.0.0.0
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
Router    2.2.2.2         2.2.2.2            141  36    80000014       1
Router    3.3.3.3         3.3.3.3            143  36    80000012       1
Network   10.1.23.2       2.2.2.2            141  32    80000002       0
Sum-Net 10.1.34.0       3.3.3.3            151  28    80000001       1
Sum-Net  10.1.12.0       2.2.2.2            160  28    80000006       1

Area: 0.0.0.2
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
Router    4.4.4.4         4.4.4.4            106  36    80000004      99
Router    3.3.3.3         3.3.3.3            110  36    80000003       1
Network   10.1.34.4       4.4.4.4            111  32    80000001       0
Sum-Net 10.1.23.0       3.3.3.3            151  28    80000001       1
Sum-Net  10.1.12.0       3.3.3.3            144  28    80000001       2
NSSA    0.0.0.0         3.3.3.3            145  36    80000001       1
NSSA    44.44.44.0      4.4.4.4            158  36    80000001       1

AS External Database
Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
External  44.44.44.0      3.3.3.3            106  36    80000001       1
We see that in R3’s LSDB, there are 7 types of LSA generated by R4 in area2. At the same time, the R3 did its own 7-to-5 action, converting the 7-class LSA into 5-class LSA, and then flooded the 5-class LSA 44.44.0/24 into the backbone area0.
So on R2, the type of routing is O_ASE, because LSA, which describes 44.44.44.0/24 external routing, is now a five-class LSA:
[R2] display ip routing-table
Destination/Mask    Proto     Pre  Cost    Flags   NextHop         Interface
10.1.34.0/24       OSPF     10   2        D     10.1.23.3       GigabitEthernet0/0/1
44.44.44.0/24      O_ASE   150  1        D     10.1.23.3        GigabitEthernet0/0/1
……
Now let’s take a look at R4:
[R4] display ip routing-table
Destination/Mask    Proto  Pre  Cost     Flags NextHop         Interface
0.0.0.0/0   O_NSSA 150  1           D  10.1.34.3       GigabitEthernet0/0/0
10.1.12.0/24  OSPF   10   101         D  10.1.34.3       GigabitEthernet0/0/0
10.1.23.0/24  OSPF   10   100         D  10.1.34.3       GigabitEthernet0/0/0
R4In the routing table, there are LSA 3 routes passed from the backbone area area0: 10.1.12.0/24 and 10.1.23.0/24. At the same time, there are 7 types of LSA default routing 0.0.0.0/0 automatically issued by ABR (R3) of NSSA..
So, since R4 has the default route of ABR download, it can actually reach the network under R1 and R2, in fact, it does not need the routing of other areas, so it can be further configured on ABR (R3), filter out the three types of LSA, and further reduce the number of LSA in NSSA.The configuration changes of R3 are as follows:
[R3] ospf 1 router-id 3.3.3.3
[R3-ospf-1] area 2
[R3-ospf-1-area-0.0.0.2] nssa no-summary
[R3-ospf-1-area-0.0.0.2] network 10.1.34.3 0.0.0.0
[R3-ospf-1-area-0.0.0.2] area 0
[R3-ospf-1-area-0.0.0.0] network 10.1.23.3 0.0.0.0
In this way, the routing table of R4:
[R4] display ip routing-table
Destination/Mask    Proto  Pre  Cost     Flags   NextHop           Interface
0.0.0.0/0   O_NSSA  150   1        D     10.1.34.3       GigabitEthernet0/0/0
There are only 7 kinds of default routes issued by R3. Of course, R3 can access the whole network at this time.

Four.OSPFConfiguration

1、Basic configuration

Create the OSPF process and specify the OSPF process number and RouterID
[Router] ospf [ process-id | router-id router-id ]

Where process-id is the process number, the detailed description of the process number is shown below. In addition, the Router-ID keyword specifies the outer-ID of ospf, the local router. It is recommended to manually configure Router-ID when creating OSPF processes.ID.

 

Declare the specified interface in Area0
[Router-ospf] area area-id
[Router-ospf-area] network ip-address wildcard-mask
The above network command is used to activate OSPF on specific interfaces.

OSPFProcessor ID

The process number ranges from 1 to 65535 and identifies only one process within the OSPF router, which is locally valid. Multiple OSPF processes can be run on the same router without affecting each other and being independent of each other. Routing interaction between different OSPF processesIt is equivalent to routing interaction among different routing protocols.
The process number is locally valid. If OSPF is docked between different routers, the OSPF process number of the two routers can be different. This is no problem. However, in order to ensure the normalization and standardization of network configuration, the same process number is recommended.

Wildcard mask wildcard-mask:
A wildcard is a 32-bit value used to determine which IP address bits this exact match (0 represents exact match) and which address bits are ignored. A wildcard mask is usually used to handle network notifications for routing protocols such as Access Control List (ACL), OSPF, and EIGRP. Let’s take a look at the network mask n.The difference between etmask and wildcard mask wildcard-mask is:

Let’s take a look at some examples.

In the example above, the IP we associate with after the network command is 172.16.1.0, and the wildcard mask is 0.0.0.255, so turn these two numbers into binary, where the wildcard mask bit is 0, and must be strictly matched. The bit of 1 does not matter. So weLook at the router’s local interface IP, do the corresponding, if matched, the interface will activate OSPF, otherwise it will not activate.

In the same topology, if we change the wildcard mask to 0.0.255.255, then the last two octets do not matter, and eventually all three interfaces of the router activate OSPF.

2、Example (single area)

The network topology consists of three routers and two PC.
For a more intuitive view of the implementation, each router uses the address of x.x.x.x as the Outer ID of OSPF, where x is the device number, such as R1’s Outer ID of 1.1.1.1, with the device’s interface number and IP address as shown in the figure.

R1The configuration is as follows:
#Complete the configuration of interface IP.
[R1] interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0] ip address 192.168.12.1 24
[R1] interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1] ip address 192.168.1.254 24

#Create OSPF process 1 and set router-ID to 1.1.1.1; activate OSPF on GE0/0/0 and GE0/0/1 ports of R1:
[R1] ospf 1 router-id 1.1.1.1
[R1-ospf-1] area 0
[R1-ospf-1-area-0.0.0.0] network 192.168.12.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255

 

R2The configuration is as follows:
#Complete the configuration of interface IP.
[R2] interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0] ip address 192.168.12.2 24
[R2] interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1] ip address 192.168.23.2 24

#Create OSPF process 1 and set router-ID to 2.2.2.2; activate OSPF on GE0/0/0 and GE0/0/1 ports of R1:
[R2] ospf 1 router-id 2.2.2.2
[R2-ospf-1] area 0
[R2-ospf-1-area-0.0.0.0] network 192.168.12.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0] network 192.168.23.0 0.0.0.255

 

R3The configuration is as follows:
#Complete the configuration of interface IP.
[R3] interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0] ip address 192.168.23.3 24
[R3] interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1] ip address 192.168.2.254 24

#Create OSPF process 1 and set router-ID to 3.3.3.3; activate OSPF on GE0/0/0 and GE0/0/1 ports of R3.
[R3] ospf 1 router-id 3.3.3.3
[R3-ospf-1] area 0
[R3-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0] network 192.168.23.0 0.0.0.255

After configuring, let’s take a look at the neighborhood relationship of OSPF, which is the basis of OSPF routing convergence. If the neighborhood relationship is not in the right state, then the routing will not be known properly. Let’s do a look at R1 first.

[R1] display ospf peer
OSPF Process 1 with Router ID 1.1.1.1
Neighbors
#The following is the OSPF neighbor of G0/0/0’s mouth at R1.
Area 0.0.0.0 interface 192.168.12.1(GigabitEthernet0/0/0)’s neighbors
Router ID: 2.2.2.2          Address: 192.168.12.2
State: Full  Mode:Nbr is  Master  Priority: 1
DR: 192.168.12.2  BDR: 192.168.12.1  MTU: 0
Dead timer due in 34  sec
Retrans timer interval: 5
Neighbor is up for 01:53:16
Authentication Sequence: [ 0 ]

Using the display OSPF peer command, you can see the OSPF neighborhood. The output above is R1’s OSPF neighborhood. We see that R1 finds an OSPF neighbor, which is connected to R1’s GE0/0/0 port, and its RouTerID is 2.2.2.2 and interface IP is 192.168.12.2. Most importantly, the state is Full, which means that the OSPF neighbor relationship between R1 and R2 is already full adjoining state.
Similarly, you should see two OSPF neighbors on R2, and you can see a OSPF neighbor on R3.
Next, look at the routing table.

[R1] display ip routing-table
Route Flags: R – relay, D – download to fib
——————————————————————————
Routing Tables: Public
Destinations : 12       Routes : 12
Destination/Mask    ProtoPre  CostFlags NextHop            Interface
192.168.1.0/24  Direct 0    0   D   192.168.1.254   GigabitEthernet0/0/1
192.168.1.254/32  Direct  0    0    D   127.0.0.1       GigabitEthernet0/0/1
192.168.1.255/32  Direct  0    0    D   127.0.0.1       GigabitEthernet0/0/1
192.168.2.0/24  OSPF10   3 D   192.168.12.2    GigabitEthernet0/0/0
192.168.12.0/24  Direct  0    0    D   192.168.12.1    GigabitEthernet0/0/0
192.168.12.1/32  Direct  0    0    D   127.0.0.1       GigabitEthernet0/0/0
192.168.12.255/32  Direct  0    0    D   127.0.0.1       GigabitEthernet0/0/0
192.168.23.0/24  OSPF 10   2    D   192.168.12.2    GigabitEthernet0/0/0
255.255.255.255/32  Direct  0    0    D   127.0.0.1       InLoopBack0

In the above output, we see that R1 has learned two OSPF routes, 192.168.2.0/24 and 192.168.23.0/24; similarly, we can see the corresponding OSPF routes on R2 and R3. Now PC1 and PC2 can communicate with each other.That’s right.

 

3、Example (multi region)

The network consists of three routers and two PC.
For a more intuitive view of the implementation, each router uses the address of x.x.x.x as the Outer ID of OSPF, where x is the device number, such as R1’s Outer ID of 1.1.1.1; the OSPF area is planned as shown in the figure;
R1The configuration is as follows:
#Complete the configuration of interface IP.
[R1] interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0] ip address 192.168.12.1 24
[R1] interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1] ip address 192.168.1.254 24

#Activate OSPF on GE0/0/0 and GE0/0/1 ports of R1
[R1] ospf 1 router-id 1.1.1.1
[R1-ospf-1] area 0
[R1-ospf-1-area-0.0.0.0] network 192.168.12.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255

 

R2The configuration is as follows:
#Complete the configuration of interface IP.
[R2] interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0] ip address 192.168.12.2 24
[R2] interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1] ip address 192.168.23.2 24

#Activate OSPF on the GE0/0/0 and GE0/0/1 ports of R2. Note that R2 is an ABR, so pay attention to the area where the OSPF interface is activated.
[R2] ospf 1 router-id 2.2.2.2
[R2-ospf-1] area 0
[R2-ospf-1-area-0.0.0.0] network 192.168.12.0 0.0.0.255
[R2-ospf-1] area 1
[R2-ospf-1-area-0.0.0.1] network 192.168.23.0 0.0.0.255

 

R3The configuration is as follows:
#Complete the configuration of interface IP.
[R3] interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0] ip address 192.168.23.3 24
[R3] interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1] ip address 192.168.2.254 24

#Activate OSPF on GE0/0/0 and GE0/0/1 ports of R3
[R3] ospf 1 router-id 3.3.3.3
[R3-ospf-1] area 0
[R3-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0] network 192.168.23.0 0.0.0.255

After completing the configuration, PC1 and PC2 can communicate with each other through Ping.

4、View and verify

View the operation parameters of OSPF protocol
display ospf brief
View the OSPF neighbor table
display ospf peer
View the LSDB table
display ospf lsdb
View OSPF routing
display ospf routing

Leave a Reply

Your email address will not be published. Required fields are marked *