当前位置:网站首页>交换机和路由器技术-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
边栏推荐
- 洛谷P1763 埃及分数
- 直播平台开发,Flutter,Drawer侧滑
- 交换机和路由器技术-36-端口镜像
- 【实战场景】商城-折扣活动设计方案
- "98 BST and Its Verification" of the 13th day of leetcode brushing series of binary tree series
- The basics of binary heap~
- 1815. Get the maximum number of groups of fresh donuts state compression
- 干货:服务器网卡组技术原理与实践
- Word2021 中的图片保存后就变模糊了
- 监听U盘插入 拔出 消息,获得U盘盘符
猜你喜欢

ALSA音频架构 -- snd_pcm_open函数分析

剑指offer_抽象建模能力

"98 BST and Its Verification" of the 13th day of leetcode brushing series of binary tree series

【组成原理 九 CPU】

ALSA音频架构 -- aplay播放流程分析

如何将360全景图导出高清短视频分享到视频平台上?

2022新员工公司级安全教育基础培训(118页)

破解事务性工作瓶颈,君子签电子合同释放HR“源动力”!

"239 Sliding Window Maximum Value" on the 16th day of LeetCode brushing

洛谷P2150 寿司晚宴
随机推荐
解决多线程调用sql存储过程问题
Callable实现多线程
To break the bottleneck of transactional work, the gentleman signs the electronic contract to release the "source power" of HR!
如何缓解压力、拒绝内耗【1】
.NET service registration
【FPGA教程案例49】控制案例1——基于FPGA的PID控制器verilog实现
Provincial level of Echart maps, as well as all prefecture-level download and use
力扣——青蛙跳台阶问题
洛谷P2580 于是他错误的点名开始了
Redis:解决分布式高并发修改同一个Key的问题
Clang Code Model: Error: The clangbackend executable “X:/clangbackend.exe“ could not be started
FPGA工程师面试试题集锦111~120
The shortest path out of the maze
es-head plugin insert query and conditional query (5)
这些云自动化测试工具值得拥有
Switch---Spanning Tree---Three-layer Architecture Summary
1815. Get the maximum number of groups of fresh donuts state compression
Common layout effect realization scheme
源代码加密技术浅析
自研能力再获认可,腾讯云数据库入选 Forrester Translytical 报告