当前位置:网站首页>[when OSPF introduces direct connection routes, it makes a summary by using static black hole routes]

[when OSPF introduces direct connection routes, it makes a summary by using static black hole routes]

2022-06-29 06:51:00 GLAB-Mary

The topology is outlined below :
1、SW1 and SW2 All are three-layer switches , Between them OSPF agreement , The interconnection interface is declared in area 0 in .
2、SW2 As an access device , In the form of direct connection , Convergence of different businesses , And introduce these direct routes into OSPF in , Interworking with the Internet .

The problem is :
1、 In business , Each small network segment of direct connection route is introduced in the form of direct connection route OSFP, cause SW2 There are too many routing entries .
2、 In blue frame , Each small routing network segment can be sorted and summarized ; In purple frame , The size routing network segment cannot be sorted and summarized .

( notes :ENSP in OSPF The domain device uses S5700 simulation ; For the customer side PC simulation . The actual environment may be friendly equipment , The customer side may be firewall equipment, etc . None of these are discussed in this article , I simplified it .)
 Insert picture description here

The experiment purpose
(1) Summarize the service direct routes in the blue box ,SW2 Only the summary route is learned .

(2) The service direct connection route in the purple box remains the same ,SW2 Still learn detailed routing .

Experimental process
The first 1 Step , Build the experiment topology
SW1 Main configuration :

Pull through OSPF part

interface Vlanif1

ip address 12.1.1.1 255.255.255.0

ospf 1

area 0.0.0.0

network 12.1.1.1 0.0.0.0

# Batch creation VLAN

vlan batch 11 to 16

Business direct connection part ( The following are examples , Other analogies )

interface Vlanif11

ip address 10.0.0.1 255.255.255.248

interface GigabitEthernet0/0/11

port link-type access

port default vlan 11

interface Vlanif12

ip address 10.0.0.9 255.255.255.248

interface GigabitEthernet0/0/12

port link-type access

port default vlan 12

……

SW2 Main configuration :

interface Vlanif1

ip address 12.1.1.2 255.255.255.0

ospf 1

area 0.0.0.0

network 12.1.1.2 0.0.0.0

The realization effect is that each PC can ping Connect your own gateway , You can't ping through SW2 Interface address of 12.1.1.2. Insert picture description here

The first 2 Step ,SW1 in OSPF Introducing direct routing
Come on , We are OSPF In progress , Directly introduce direct connection routes .

SW1

ospf 1

import-route direct

If they are executed correctly , Now we're here SW2 You can see the service direct connection route on the OSPF The external route is added to the route table , After that, they communicate with each other .
 Insert picture description here

Now we see , What is the business direct connection route , What will happen after the introduction . There may be hundreds or thousands of such short routes in the actual environment , In addition to the increase SW2 Outside the gauge pressure , When a service terminal goes online or offline at any time, it will cause frequent route jitter and other adverse effects .

The first 3 Step , Use asbr-summary Summary
SW1 yes OSPF One in the domain ASBR, In order to solve the problem in the previous step , We can do it in OSPF Do manual route summary under the process . We assume that 10.0.0.0/24 It is planned , Address space that does not conflict with other places .

SW1

ospf 1

asbr-summary 10.0.0.0 255.255.255.0

After that we ran to SW2 Look at the routing table , You will see 10.0.0.0/24 Completed summary for segment , The directly connected network segments that are not involved still exist in the routing table in the form of details .
 Insert picture description here

After that, the whole network will still be tested , It seems that our goal has been achieved , I can “ Crosshair ” 了 .

The first 4 Step , Use static route introduction for summary
Burning goose , My colleagues have raised new questions . He referred to similar configurations elsewhere , People use the form of static route introduction to summarize routes , Want to follow and maintain unity .

therefore , I deleted asbr-summary This configuration ,SW2 It's natural to relearn all detailed routes .

SW1

ospf 1

undo asbr-summary 10.0.0.0 255.255.255.0

I'll put 10.0.0.0/24 The static routes of the network segment are sorted out , It turns into a black hole route , The instructions are as follows .

SW1

ip route-static 10.0.0.0 255.255.255.0 NULL0

Next, you need to remove the direct connection , Instead, static .

SW1

ospf 1

undo import-route direct

import-route static

 Insert picture description here

here , To SW2 Look up ,10.0.0.0/24 The small segment of the route is still normal . Burning goose , The two service direct routes in the purple box that do not summarize the requirements are SW2 Has disappeared from the routing table . because SW1 Direct route introduction has been canceled , therefore SW2 Of course, there will not be... In the routing table of .

The first 5 Step , Both direct and static are introduced
Still in SW1 On , We introduce the direct connection route to make up .

SW1

This static last step already has

ip route-static 10.0.0.0 255.255.255.0 NULL0

ospf 1

import-route direct

import-route static

We went to the SW2 Look at the routing table .

 Insert picture description here

here ,10 Duan's 4 Detailed routes we want to summarize , because OSPF The reason for introducing direct routing , Again in SW2 On the routing table . The situation seems to be back to the original point .

do ? Think about it .

The first 6 Step , Static routing with policies is introduced
If there is a static route summary network segment , We don't do it OSPF Direct connection introduction , without , Then continue to introduce it directly .
At this time , I think we can introduce direct routing , Call the routing policy , Filter out the static black hole that has been written to do the routing summary network segment .

IP The prefix list is a powerful tool for capturing routes , Let's write one first ip The prefix list , To grab routes .

SW1

ip ip-prefix STATICED index 10 permit 10.0.0.0 24 greater-equal 24 less-equal 32

be known as STATICED Of ip The prefix list , Indexes 10 There is one , It allows routing before 24 Bit strict matching 10.0.0, The routing mask can be used in 32 A to 24 Between bits . I named it STATICED It means that the static summary route has been written .

After that, we need to make a routing policy , It's also named STATICED.

SW1

Routing policy node 10, Reject those direct network segments that have written static black hole routes for summary .

route-policy STATICED deny node 10

if-match ip-prefix STATICED

Routing policy node 20, Release node 10 No other direct network segment in the match .

route-policy STATICED permit node 20

notes 1: node 20 Huawei equipment , The default action is release , Friendly equipment is not necessarily .

notes 2: Where to reject this strategy , Where to release , Implementation mode is not uniform , Try not to write .

Okay , And then finally in the OSPF When introducing a direct route , Call this STATICED Routing strategy .

SW1

ospf 1

import-route direct route-policy STATICED

import-route static

Let's sort it out again , The purpose of our operation is , stay OSPF When introducing direct route , If the static black hole routing has been written , Then it is introduced according to the static route , The purpose of route summary has been achieved ; If you don't write , Then you only need to import by direct route , It is still a detailed route .

Okay ! It can be regarded as meeting this demand . thereafter , The introduction of direct connection routes can be gradually changed into static route summary introduction . Steady progress !

Summary of the experiment
Routing protocols are introduced into each other 、 Summary 、 Filtration is very important for screen workers , It's a basic skill .

The continuous evolution and development of the network , Some frameworks look like version maniacs , Ferocious iteration can be released in a year n A version , But in fact, many things come and go back . If you are interested , Insist on returning to the foundation when it is not urgent , Consolidate foundation , Keep innovation .

Make a picture to summarize the experiment . Insert picture description here

原网站

版权声明
本文为[GLAB-Mary]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/180/202206290503467751.html