目录
配置基础的邻居建立
配置Area4的虚链路
配置OSPF特殊区域
配置路由重分发
配置OSPF汇总
下发缺省路由
配置OSPF邻居认证
配置OSPF的网络类型
配置基础的邻居建立
以R1和R2建立邻居为例子(其余设备邻居建立配置相同)
R1配置
int g0/0
no switchport
ip add 10.0.12.1 24
int loop 0
ip add 1.1.1.1 32
route ospf 1
router-id 1.1.1.1 配置Router-ID
area 1 创建OSPF区域
network 10.0.12.0 0.0.0.255 area 1 在区域1宣告路由
R2配置
int g0/0
no switchport
ip add 10.0.12.2 24
int loop 0
ip add 2.2.2.2 32
route ospf 1
router-id 2.2.2.2
area 1
network 10.0.12.0 0.0.0.255 area 1
配置Area4的虚链路
OSPF——基本概念2(多区域与Vlink)_静下心来敲木鱼的博客-CSDN博客https://blog.csdn.net/m0_49864110/article/details/125902158?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166904170016800213070911%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166904170016800213070911&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-2-125902158-null-null.nonecase&utm_term=ospf%E8%99%9A%E6%8B%9F&spm=1018.2226.3001.4450
配置虚链路穿越Area 3
R3上配置(跟的是对端的Router-id)
Area 3 virtual-link 5.5.5.5
R5上配置(跟的是对端的Router-id)
Area 3 virtual-link 3.3.3.3
配置OSPF特殊区域
OSPF——基本概念4(特殊区域)_静下心来敲木鱼的博客-CSDN博客https://blog.csdn.net/m0_49864110/article/details/125962724?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166904167716782412542234%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166904167716782412542234&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-125962724-null-null.nonecase&utm_term=ospf%E7%89%B9%E6%AE%8A&spm=1018.2226.3001.4450
配置Area 1为完全Nssa区域
R1配置NSSA区域
Router ospf 1
Area 1 nssa
R2(ABR配置为完全NSSA区域)
Router ospf 1
Area 1 nssa no-summary
配置Area 2为完全Stub区域
R4配置Stub区域
Router ospf 1
Area 2 stub
R3(ABR配置为完全Stub区域)
Router ospf 1
Area 2 stub no-summary
配置路由重分发
OSPF——基本概念3(外部路由与选路原则)_静下心来敲木鱼的博客-CSDN博客https://blog.csdn.net/m0_49864110/article/details/125902193?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166904172216800184137149%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166904172216800184137149&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-125902193-null-null.nonecase&utm_term=%E5%A4%96%E9%83%A8&spm=1018.2226.3001.4450
在R5上将直连路由重发布到OSPF中
Router ospf 1
Redistribute connected subnets
OSPF重发布路由时Subnets命令
默认OSPF在进行重发布路由时,只可以重发布有类路由(A、B、C类)
当要重发布无类路由时,要在命令后跟上Subnets
配置OSPF汇总
OSPF——基本概念5(汇总、更新、认证)_静下心来敲木鱼的博客-CSDN博客https://blog.csdn.net/m0_49864110/article/details/125962761?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166904162316782412599708%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166904162316782412599708&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-125962761-null-null.nonecase&utm_term=ospf%E8%AE%A4%E8%AF%81&spm=1018.2226.3001.4450
在R3上配置区域内路由汇总(做汇总的区域必须是路由的起源区域)
Router ospf 1
先将R3的环回口路由宣告进OSPF区域中
network 172.16.1.1 0.0.0.255 area 0
network 172.16.2.1 0.0.0.255 area 0
network 172.16.3.1 0.0.0.255 area 0
在区域0配置域内路由汇总
Area 0 range 172.16.0.0 255.255.252.0
在R5上配置外部路由汇总(只可以在ASBR上做)
汇总的前提是外部路由已经重发布进OSPF
Summary-address 192.168.0.0 255.255.252.0
下发缺省路由
OSPF高级特性——控制OSPF路由信息_静下心来敲木鱼的博客-CSDN博客https://blog.csdn.net/m0_49864110/article/details/127451894?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522166904174516782425641744%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=166904174516782425641744&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-2-127451894-null-null.nonecase&utm_term=%E9%AB%98%E7%BA%A7%E7%89%B9%E6%80%A7&spm=1018.2226.3001.4450
一般在网络出接口下发缺省路由(此处在R6上下发缺省路由)
Router ospf 1
Default-information originate always metric-type 2
Always 无论设备本地是否存在生效的默认路由,设备都会向OSPF区域下发默认路由
metric-type 2 配置外部路由的开销计算类型为Type2(只计算外部开销)
配置OSPF邻居认证
Area0之间配置明文认证(R2和R3配置相同)
配置区域间认证为明文认证
Router ospf 1
Area 0 authentication
接口上配置明文认证密码
Int g0/1
Ip ospf authentication-key admin
Area3之间配置密文认证(R3和R5配置相同)
配置区域间认证为加密认证
Router ospf 1
Area 3 authentication message-digest
接口上配置密文认证密码
Int g0/0
Ip ospf message-digest-key 1 md5 admin@123
配置OSPF的网络类型
链路两端的OSPF网络类型必须一致
Int g0/0
配置网络类型为P2P
Ip ospf network point-to-point