OSPF配置知识总结3(多区域配置)
OSPF配置知识总结3(多区域配置)
1.相关解释:
要解决网络规模大了以后的问题:网络的扩展性,降低路由器负载,实现路由的更快收敛
OSPF多区域的区域类型分为Area 0(骨干区域),
以及非Area 0 (非骨干区域):
分区后,可以实现流量的分类并进行区隔:域内流量,域间流量,外部通讯流量
因为有不同区域,就有内部路由和毗连的区域边界路由器(ABR)
配置命令:network 只能宣告直连路由进入OSPF体系
import-route 能够宣告任何类型的路由进入OSPF体系,作为network配置的补充。
2.思路
.ENSP模型
.规划RouterID
.基本配置
.多区域OSPF配置
3.eNSP模型
4. 规划RouterID
RouterID规划(我个人想的方法)
X . X . X . X
区域码 . 工厂码 . 第几台 . 备用码
R1-ID: 20.1.1.0
R2-ID: 20.1.2.0
R3-ID: 20.1.3.0
R4-ID: 0.2.4.0
R5-ID: 0.2.5.0
R6-ID: 30.3.6.0
R7-ID: 30.3.7.0
5.基本配置
各端口IP地址配置,PCIP地址配置
6.多区域OSPF配置
R1
#
interface GigabitEthernet0/0/0
ip address 192.168.20.254 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.12.1 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 192.168.13.1 255.255.255.0
#
ospf 1 router-id 20.1.1.0
area 0.0.0.20
network 192.168.12.0 0.0.0.255
network 192.168.13.0 0.0.0.255
network 192.168.20.0 0.0.0.255
R2
interface GigabitEthernet0/0/0
ip address 192.168.12.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.23.2 255.255.255.0
#
ospf 1 router-id 20.1.2.0
area 0.0.0.20
network 192.168.12.0 0.0.0.255
network 192.168.23.0 0.0.0.255
R3
#
interface GigabitEthernet0/0/0
ip address 192.168.23.3 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.13.3 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 192.168.34.3 255.255.255.0
ospf 1 router-id 20.1.3.0 //这是ABR路由器,横跨两个区域,这是与单区域OSPF的不同
area 0.0.0.0
network 192.168.34.0 0.0.0.255
area 0.0.0.20
network 192.168.13.0 0.0.0.255
network 192.168.23.0 0.0.0.255
R4
#
interface GigabitEthernet0/0/0
ip address 192.168.45.4 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.34.4 255.255.255.0
ospf 1 router-id 0.2.4.0
area 0.0.0.0
network 192.168.34.0 0.0.0.255
network 192.168.45.0 0.0.0.255
R5
#
interface GigabitEthernet0/0/0
ip address 192.168.56.5 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.45.5 255.255.255.0
ospf 1 router-id 0.2.5.0
area 0.0.0.0
network 192.168.45.0 0.0.0.255
network 192.168.56.0 0.0.0.255
R6
#
interface GigabitEthernet0/0/0
ip address 192.168.67.6 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.56.6 255.255.255.0
ospf 1 router-id 30.3.6.0 //这是ABR路由器,横跨两个区域,这是与单区域OSPF的不同。其他一样
area 0.0.0.0
network 192.168.56.0 0.0.0.255
area 0.0.0.30
network 192.168.67.0 0.0.0.255
stub //设置30区为stub区,其他相关交换机所在区域都要设置;将在本区域无LSA5,如果要禁LSA3用Stub no-summary
R7
#
interface GigabitEthernet0/0/0
ip address 192.168.30.254 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.67.7 255.255.255.0
ospf 1 router-id 30.3.7.0
area 0.0.0.30
network 192.168.30.0 0.0.0.255
network 192.168.67.0 0.0.0.255
stub //设置30区为stub区,其他相关交换机所在区域都要设置; 建立Stub区,是防止其他区域的不稳定波及本区域
7.引入静态路由的方法
AR8:用五类LSA
AR7和AR8通过静态路由连接,通往PC4:
[R7] ip route-static 192.168.40.0 24 192.168.78.8
OSPF只能与直连路由关联
#
ospf 1 router-id 30.3.7.0
area 0.0.0.30
network 192.168.30.0 0.0.0.255
network 192.168.67.0 0.0.0.255
而要把40.0网段的路由器关联进OSPF的路由器体系,要采用
ospf 1 router-id 30.3.7.0
import-route static
[R7]dis ospf lsdb
OSPF Process 1 with Router ID 30.3.7.0
Link State Database
Area: 0.0.0.30
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 30.3.7.0 30.3.7.0 269 48 80000009 1
Router 30.3.6.0 30.3.6.0 582 36 80000009 1
Network 192.168.67.6 30.3.6.0 582 32 80000002 0
Sum-Net 192.168.45.0 30.3.6.0 941 28 80000005 2
Sum-Net 192.168.23.0 30.3.6.0 941 28 80000005 4
Sum-Net 192.168.56.0 30.3.6.0 979 28 80000005 1
Sum-Net 192.168.20.0 30.3.6.0 941 28 80000005 5
Sum-Net 192.168.34.0 30.3.6.0 941 28 80000005 3
Sum-Net 192.168.13.0 30.3.6.0 941 28 80000005 4
Sum-Net 192.168.12.0 30.3.6.0 941 28 80000005 5
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 192.168.40.0 30.3.7.0 16 36 80000001 1