本文主要是介绍OSPF的完全stub区域,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、OSPF的 完全stub区域
a、 完全存根区域没有外部路由和域间路由,只能通过默认路由
b、 区域内命令配置area 区域-id stub no-summary
R1配置
en
conf t
hostname R1int loopback 0
ip address 1.1.1.1 255.255.255.0
no shutdown
exitint f0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
exitrouter ospf 1
network 1.1.1.0 0.0.0.255 area 1
network 192.168.1.0 0.0.0.255 area 1
area 1 stub no-summary
exit
end
R2配置
en
conf t
hostname R2int loopback 0
ip address 2.2.2.2 255.255.255.0
no shutdown
exitint f0/0
ip address 192.168.1.2 255.255.255.0
no shutdown
exitint f0/1
ip address 192.168.2.1 255.255.255.0
no shutdown
exitrouter ospf 1
network 2.2.2.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 1
network 192.168.2.0 0.0.0.255 area 0
area 1 stub no-summary
exit
end
R3配置
en
conf t
hostname R3int loopback 0
ip address 3.3.3.3 255.255.255.0
no shutdown
exitint f0/1
ip address 192.168.2.2 255.255.255.0
no shutdown
exitint f0/0
ip address 202.168.1.1 255.255.255.0
no shutdown
exitrouter ospf 1
network 192.168.2.0 0.0.0.255 area 0
network 3.3.3.0 0.0.0.255 area 0
redistribute static metric-type 1 subnets
exitip route 4.4.4.0 255.255.255.0 f0/0
end
R4配置
en
conf t
hostname R4int f0/0
ip address 202.168.1.2 255.255.255.0
no shutdown
exitint loopback 0
ip address 4.4.4.4 255.255.255.0
no shutdown
exitip route 0.0.0.0 0.0.0.0 f0/0
end
R1#show ip route
Codes: C - connected, S - static, I - IGRP,R - RIP, M - mobile, B - BGP
D - EIGRP, EX -EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 -OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPFexternal type 2, E - EGP
i - IS-IS, L1 -IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is 192.168.1.2 tonetwork 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
O*IA0.0.0.0/0 [110/2] via 192.168.1.2, 00:00:02, FastEthernet0/0
R1#
R1#show ip ospf database
OSPF Router with ID (1.1.1.1) (ProcessID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 33 0x80000003 0x00500e 2
2.2.2.2 2.2.2.2 33 0x80000002 0x005515 1
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.1.2 2.2.2.2 33 0x80000001 0x00741f
Summary Net Link States (Area1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 11 0x80000001 0x0057fe
解释:完全存根区域不能学习外部路由和其他区域的路由信息,只能通过默认路由0.0.0.0。
R2#show ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 49 0x80000004 0x0055f8 2
3.3.3.3 3.3.3.3 49 0x80000004 0x00a29d 2
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
192.168.2.2 3.3.3.3 49 0x80000001 0x007f07
Summary Net Link States (Area0)
Link ID ADV Router Age Seq# Checksum
192.168.1.0 2.2.2.2 44 0x80000001 0x009a51
1.1.1.1 2.2.2.2 44 0x80000002 0x00311f
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 67 0x80000002 0x005515 1
1.1.1.1 1.1.1.1 67 0x80000003 0x00500e 2
Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
192.168.1.2 2.2.2.2 67 0x80000001 0x00741f
Summary Net Link States (Area1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 44 0x80000001 0x0057fe
R2#show ip route
Codes: C - connected, S - static, I - IGRP,R - RIP, M - mobile, B - BGP
D - EIGRP, EX -EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 -OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPFexternal type 2, E - EGP
i - IS-IS, L1 -IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/2] via 192.168.1.1, 00:01:05, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/2] via 192.168.2.2, 00:00:48, FastEthernet0/1
4.0.0.0/24 is subnetted, 1 subnets
O E1 4.4.4.0 [110/21] via 192.168.2.2, 00:00:48, FastEthernet0/1
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, FastEthernet0/1
解释:非存根区域能学习外部路由和其他区域的路由信息。
这篇关于OSPF的完全stub区域的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!