OSPF stub area
1. OSPF Stub area function introduction:
. 1 , Stub region stub area of OSPF, you can filter out the Class 4, Class 5 LSA (so as not received outside the OSPF routing), the link state database can be reduced and the routing table.
2 , the region ABR default route will produce O * IA 0/0 of an inter-domain region stub, issued to the zone, to ensure that OSPF routing outside reachability
2. OSPF Stub area application scenarios:
In a stub area of the OSPF domain, for example, just a device, a single link is connected to the core backbone area, the performance of this device may be relatively low, memory and CPU are relatively tight, and there is no difference whether the routing entries are detailed or broad. Because this area needs to access other areas or network segments outside the OSPF domain, the next hop of its route is the IP of the next hop core device corresponding to this single link, so there is no need to learn this area For a large number of OSPF external routes, you can consider configuring the area as a stub area to reduce the pressure of routing entries in this area and the consumption of computing resources.
3. OSPF Stub area experimental configuration:
note:
1 ) The stub area is a stub area. The stub area filters Type 4 and Type 5 LSAs, and generates a default route of Type 3 LSA on the ABR router
3 ) The routers in the stub area are not allowed to import ospf extra-domain routes
1. Topological diagram
2. Experimental purpose:
1 ) The area 2 configured as a stub area type filter 4, 5 LSA
3. Configuration ideas:
1 ) Set up the topology map environment and mark the planned IP address
2 ) Modify the default name of the network device and configure the IP address
3 ) Configure basic OSPF to enable mutual access between network segments
4 ) Configure a stub area in a rea 2
4. Configuration process:
Step 1: Modify the default name of the network device and configure the IP address
1) Router R1 do basic interface configuration and modify the device name
Router>en // Enter privileged mode
Router#conf t // Enter global configuration mode
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1 //Rename the device
R1(config)#int fa0/1 // Enter interface configuration mode
R1(config-if)#ip address 192.168.12.1 255.255.255.0 // Configure the ip address and subnet mask of the interface
R1(config-if)#no shut // Activate the interface, the interface changes from red to green in the topology diagram
R1(config-if)# //The following two lines activate the interface prompt information
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R1(config)#int loopback 0
%LINK-5-CHANGED: Interface Loopback0, changed state to up
R1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no shut
2) Router R 2 do basic interface configuration and modify the device name
Router(config)#hostname R2
R2(config)#int fa0/1
R2(config-if)#ip add 192.168.12.2 255.255.255.0
R2(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R2(config-if)#int fa0/0
R2(config-if)#ip add 192.168.23.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#int loopback 0
%LINK-5-CHANGED: Interface Loopback0, changed state to up
R2(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R2(config-if)#ip add 192.168.2.1 255.255.255.0
R2(config-if)#no shut
3) 路由器R3做基础接口配置,并修改设备名称
R3(config)#int fa0/0
R3(config-if)#ip add 192.168.23.2 255.255.255.0
R3(config-if)#no shut
R3(config-if)#int fa0/1
R3(config-if)#ip add 192.168.34.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#exit
R3(config)#int loopback 0
R3(config-if)#ip add 192.168.3.1 255.255.255.0
R3(config-if)#no shut
4) 路由器R4做基础接口配置,并修改设备名称
R4(config)#int fa0/1
R4(config-if)#ip add 192.168.34.2 255.255.255.0
R4(config-if)#no shut
R4(config-if)#exit
R4(config)#int loopback 0
R4(config-if)#ip add 192.168.4.1 255.255.255.0
R4(config-if)#no shut
步骤二、配置基础OSPF
1) R1:
R1(config)#router ospf 1 //使能OSPF,并配置进程号为1
R1(config-router)#router-id 1.1.1.1 //配置router-id
R1(config-router)#network 192.168.1.1 0.0.0.0 area 1 //发布网段,并将网段分配进area 1 区域
R1(config-router)#network 192.168.12.0 0.0.0.255 area 1
2) R2:
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 192.168.12.0 0.0.0.255 area 1
R2(config-router)#network 192.168.23.0 0.0.0.255 area 0
R2(config-router)#network 192.168.2.1 0.0.0.0 area 0
00:59:28: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on FastEthernet0/1 from LOADING to FULL, Loading Done //该信息表明邻居已经建立成功
R2(config-router)#end
3) R3:
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 192.168.23.0 0.0.0.255 area 0
R3(config-router)#
00:40:03: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
R3(config-router)#network 192.168.34.0 0.0.0.255 area 2
R3(config-router)#network 192.168.3.1 0.0.0.0 area 0
4) R4:
R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.4
R4(config-router)#network 192.168.4.1 0.0.0.0 area 2
R4(config-router)#network 192.168.34.0 0.0.0.255 area 2
R4(config-router)#
01:12:18: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet0/1 from LOADING to FULL, Loading Done
步骤三:将area 2 配置为OSPF Stub区域:
注意:
1)配置stub区域,该区域内的所有路由器/交换机都必须配置为stub区域
2)骨干区域(area 0)不能配置为stub区域
R3(config)#router ospf 1
R3(config-router)#area 2 stub ----->area 2 配置为stub区域
01:01:35: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on FastEthernet0/1 from FULL to DOWN, Neighbor Down: Adjacency forced to reset
01:01:35: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on FastEthernet0/1 from FULL to Down: Interface down or detached
R4(config)#router ospf 1
R4(config-router)#area 2 stub
R4(config-router)#
01:34:09: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on FastEthernet0/1 from LOADING to FULL, Loading Done
R4(config-router)#end
四、配置验证
1)查看路由表:查看stub区域路由器的路由,若域外路由被过滤了,区域间路由还在,且产生了一条OIA的默认路由,则stub区域配置正确。 如下图:
2 ) Test the connectivity between the local loopback interface l oopback of the router , as shown in the figure below:
The "!!!" appears in the above figure, it means that communication can be realized between each IP
So far, the OSPF Stub area division experiment is completed.
5. Summary and expansion: If you need more basic experimental configuration examples, you can join the network worker exchange group: 696283186
OSPF special areas include two areas, Stub and Nssa. The differences between the two areas are as follows:
Stub area : filter out 4 and 5 types of lsa, replace with default route, streamline routing table
nssa area: filter out types 4 and 5, but it can also be republished, and the imported external routes are represented by type 7
This article shows the configuration of the stub area, and the configuration of the Nssa area can also refer to the configuration of this article.