当前位置:网站首页>交换机和路由器技术-24-OSPF单区域配置
交换机和路由器技术-24-OSPF单区域配置
2022-08-11 04:44:00 【w辣条小王子】
0SPF路由单区域配置
配置过程
1)创建一个 OSPF 进程,进程号的范围为1~65535。
Router ( config )# router ospf [ process - id ]
2)配置当前路由的 ID ,相当于每台路由器在 OSPF 中的名称,同一区域内不能相同,格式和 P 地址相同,都是点分十进制,取值范围为0.0.0.0~255.255.255.255。如果不指定,默认选物理地址最大的那个
Router ( config - router )# router - id [ id - number ]
3)将直连网络发布到 OSPF 中,这里和 RIP 协议不同的地方在于,发布时需要添加所对应网段的反掩码和区域编号。
Router ( config一router )# network network - address Wildcard - mask area -n umber
反掩码就是四个255减去掩码
配置实例

路由器R1
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface g 0/0
Router(config-if)#ip address 192.168.10.254 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface g0/1
Router(config-if)#ip address 10.10.10.1 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#router ospf 10
Router(config-router)#router-id 1.1.1.1
Router(config-router)#network 192.168.10.0 0.0.0.255 area 0
Router(config-router)#network 10.10.10.0 0.0.0.3 area 0
路由器R2
Router>enable
Router#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface g0/0
Router(config-if)#ip address 10.10.10.2 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface g0/1
Router(config-if)#ip address 20.20.20.1 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#router ospf 10
Router(config-router)#router-id 2.2.2.2
Router(config-router)#network 10.10.10.0 0.0.0.3 area 0
Router(config-router)#network 20.20.20.0 0.0.0.3 area 0路由器R3
Router>enable
Router#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface g0/0
Router(config-if)#ip address 20.20.20.2 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface g0/1
Router(config-if)#ip address 192.168.20.254 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#router ospf 10
Router(config-router)#router-id 3.3.3.3
Router(config-router)#network 20.20.20.0 0.0.0.3 area 0
Router(config-router)#network 192.168.20.0 0.0.0.255 area 0PC0

Pc1

PC0 ping PC1

查看命令
查看ospf配置信息
show ip ospf
查看邻居
show ip ospf neighbor
边栏推荐
猜你喜欢

"125 Palindrome Verification" of the 10th day string series of LeetCode brushing questions

Embedded Sharing Collection 33

The sword refers to offer_abstract modeling capabilities

"3 Longest Substring Without Repeating Characters" on the 17th day of LeetCode brushing

【人话版】WEB3将至之“权益的游戏”

Harvesting of radio frequency energy

Layered Architecture & SOA Architecture

ALSA音频架构

CAD2020 打开错误报告 e06d7363h Exception at 13644F69h

Dry goods: The principle and practice of server network card group technology
随机推荐
CAD2020 打开错误报告 e06d7363h Exception at 13644F69h
使用百度EasyDL实现施工人员安全装备检测
The principle, architecture, implementation, practice of "transfer" and "search", no need to be afraid of interviews
【FPGA教程案例50】控制案例2——基于FPGA的PD控制器verilog实现
leetcode 9. 回文数
梅克尔工作室--OpenEuler培训笔记(1)
Redis deletes keys in batches according to regular rules
【Web3 系列开发教程——创建你的第一个 NFT(9)】如何在手机钱包里查看你的 NFT
「转」“搜索”的原理,架构,实现,实践,面试不用再怕了
Mysql: set the primary key to automatically increase the starting value
MQ框架应用比较
洛谷P1763 埃及分数
c语言fprintf、fscanf、sscanf以及sprintf函数知识要点总结
澳大利亚网络空间安全体系建设论析
使用百度EasyDL实现森林火灾预警识别
如何缓解压力、拒绝内耗【1】
无线电射频能量的收集
洛谷P6586 蒟蒻火锅的盛宴
Resize() usage row pit in vector
Events and scheduled tasks in Mysql