当前位置: 首页 > news >正文

OSPF实验

 

需求:

1、R6为ISP只能配置IP地址,R1-R5的环回为私有网段。

2、R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点。

3、所有私有的网段可以互相通讯,私有网段使用OSPF协议完成。

第一步、搭建拓扑并按如图配置IP地址。

第二步、写缺省路由和nat策略

[AR1]ip route-static 0.0.0.0 0 61.1.1.2
[AR1]ip route-static 0.0.0.0 0 16.1.1.2
[AR1]acl 2000
[AR1-acl-basic-2000]rule permit source 1.1.1.1 0.0.0.0
[AR1-acl-basic-2000]q
[AR1]interface g0/0/0
[AR1-GigabitEthernet0/0/0]nat outbound 2000
[AR1-GigabitEthernet0/0/0]q
[AR1]interface g0/0/1
[AR1-GigabitEthernet0/0/1]nat outbound 2000
[AR1-GigabitEthernet0/0/1]q[AR2]ip route-static 0.0.0.0 0 26.1.1.2
[AR2]acl 2000
[AR2-acl-basic-2000]rule permit source 2.2.2.0 0.0.0.255
[AR2-acl-basic-2000]q
[AR2]interface g0/0/0
[AR2-GigabitEthernet0/0/0]nat outbound 2000
[AR2-GigabitEthernet0/0/0]q[AR3]ip route-static 0.0.0.0 0 36.1.1.2 
[AR3]acl 2000
[AR3-acl-basic-2000]rule permit source 3.3.3.3 0.0.0.0
[AR3-acl-basic-2000]q
[AR3]interface g0/0/0
[AR3-GigabitEthernet0/0/0]nat outbound 2000
[AR3-GigabitEthernet0/0/0]q[AR4]ip route-static 0.0.0.0 0 46.1.1.2
[AR4]acl 2000
[AR4-acl-basic-2000]rule permit source 4.4.4.4 0.0.0.0
[AR4-acl-basic-2000]q
[AR4]interface g0/0/0
[AR4-GigabitEthernet0/0/0]nat outbound 2000
[AR4-GigabitEthernet0/0/0]q[AR5]ip route-static 0.0.0.0 0 56.1.1.2
[AR5]acl 2000
[AR5-acl-basic-2000]rule permit source 5.5.5.5 0.0.0.0
[AR5-acl-basic-2000]q
[AR5]interface g0/0/0
[AR5-GigabitEthernet0/0/0]nat outbound 2000
[AR5-GigabitEthernet0/0/0]q

第三步、启用MGRE并按照下图配置IP地址。

[AR1]interface Tunnel 0/0/0
[AR1-Tunnel0/0/0]ip address 192.168.1.1 24
[AR1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[AR1-Tunnel0/0/0]source 61.1.1.1
May  4 2024 17:08:59-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP on the interface Tunnel0/0/0 has entered the UP state. 
[AR1-Tunnel0/0/0]nhrp entry multicast dynamic 
[AR1-Tunnel0/0/0]nhrp network-id 100[AR2]interface Tunnel 0/0/0
[AR2-Tunnel0/0/0]ip address 192.168.1.2 24
[AR2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[AR2-Tunnel0/0/0]source GigabitEthernet 0/0/0
May  4 2024 17:12:19-08:00 AR2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/0 has entered the UP state.                     
[AR2-Tunnel0/0/0]nhrp entry 192.168.1.1 61.1.1.1 re
[AR2-Tunnel0/0/0]nhrp entry 192.168.1.1 61.1.1.1 register 
[AR2-Tunnel0/0/0]nhrp network-id 100[AR3]interface Tunnel 0/0/0
[AR3-Tunnel0/0/0]ip address 192.168.1.3 24
[AR3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[AR3-Tunnel0/0/0]source GigabitEthernet 0/0/0
May  4 2024 17:14:43-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/0 has entered the UP state. 
[AR3-Tunnel0/0/0]nhrp entry 192.168.1.1 61.1.1.1 register 
[AR3-Tunnel0/0/0]nhrp network-id 100[AR1]interface Tunnel 0/0/1
[AR1-Tunnel0/0/1]ip address 192.168.2.1 24
[AR1-Tunnel0/0/1]tunnel-protocol gre p2mp 
[AR1-Tunnel0/0/1]source 16.1.1.1
May  4 2024 17:40:17-08:00 AR1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/1 has entered the UP state. 
[AR1-Tunnel0/0/1]nhrp entry multicast dynamic 
[AR1-Tunnel0/0/1]nhrp network-id 200
[AR1-Tunnel0/0/1]q[AR4]interface Tunnel 0/0/0
[AR4-Tunnel0/0/0]ip address 192.168.2.2 24
[AR4-Tunnel0/0/0]tunnel-protocol gre p2mp 
[AR4-Tunnel0/0/0]source 46.1.1.1
May  4 2024 17:42:33-08:00 AR4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/0 has entered the UP state. 
[AR4-Tunnel0/0/0]nhrp entry 192.168.2.1 16.1.1.1 register  
[AR4-Tunnel0/0/0]nhrp network-id 200
[AR4-Tunnel0/0/0]q[AR5]interface Tunnel 0/0/0      
[AR5-Tunnel0/0/0]ip address 192.168.2.3 24
[AR5-Tunnel0/0/0]tunnel-protocol gre p2mp 
[AR5-Tunnel0/0/0]source 56.1.1.1
May  4 2024 17:44:29-08:00 AR5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface Tunnel0/0/0 has entered the UP state. 
[AR5-Tunnel0/0/0]nhrp entry 192.168.2.1 16.1.1.1 register 
[AR5-Tunnel0/0/0]nhrp network-id 200 
[AR5-Tunnel0/0/0]q

第四步、启用OSPF协议。

[AR1]ospf 1 router-id 1.1.1.1
[AR1-ospf-1]area 0  
[AR1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0   
[AR1-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255   
[AR1-ospf-1-area-0.0.0.0]q
[AR1-ospf-1]q[AR2]ospf 1 router-id 2.2.2.2
[AR2-ospf-1]area 0  
[AR2-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0[AR3]ospf 1 router-id 3.3.3.3
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0    
[AR3-ospf-1-area-0.0.0.0]q
[AR3-ospf-1]q[AR4]ospf 1 router-id 4.4.4.4
[AR4-ospf-1]area 0
[AR4-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[AR4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0[AR5]ospf 1 router-id 5.5.5.5
[AR5-ospf-1]area 0
[AR5-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[AR5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0

第五步、修改接口类型并修改优先级

[AR1]interface Tunnel 0/0/0
[AR1-Tunnel0/0/0]ospf network-type broadcast
[AR1]interface Tunnel 0/0/1
[AR1-Tunnel0/0/1]ospf network-type broadcast[AR2]interface Tunnel 0/0/0
[AR2-Tunnel0/0/0]ospf network-type broadcast 
[AR2-Tunnel0/0/0]ospf dr-priority 0[AR3]interface Tunnel 0/0/0
[AR3-Tunnel0/0/0]ospf network-type broadcast 
[AR3-Tunnel0/0/0]ospf dr-priority 0[AR4]interface Tunnel 0/0/0
[AR4-Tunnel0/0/0]ospf network-type broadcast
[AR4-Tunnel0/0/0]ospf dr-priority 0[AR5]interface Tunnel 0/0/0
[AR5-Tunnel0/0/0]ospf network-type broadcast 
[AR5-Tunnel0/0/0]ospf dr-priority 0

实验完成

http://www.lryc.cn/news/349849.html

相关文章:

  • 喜茶·茶坊黑金首店入驻北京三里屯,率先引入珍稀娟姗奶制茶
  • C++(week3):数据结构与算法
  • ✅HTTPS和HTTP的区别是什么?
  • AIGC、LLM 加持下的地图特征笔记内容生产系统架构设计
  • 快速入门go语言学习笔记
  • MS41908M替代AN41908
  • Lc33---- 414. 第三大的数(java版)---排序(去重/复制到新数组)
  • OpenAI新模型GPT-4o“炸裂登场” 响应速度堪比真人 关键还免费!
  • C语言收尾 预处理相关知识
  • Python代码:二、多行输出
  • 前端内嵌iframe网页单点登录的三种方式
  • Git篇——Git提交指定文件编码
  • 在云服务器上运行StyleGAN3生成伪样本
  • 学习Nginx(三):命令与信号
  • 软信天成:业务流程管理驱动企业数字化转型
  • 「Python绘图」绘制同心圆
  • Unity基础
  • OpenHarmony 实战开发——ArkUI canvas组件
  • js积累一(ipv4正则校验+弹窗方式)
  • 【Android】重写onClick方法时,显示Method does not override method from its supperclass
  • LeetCode 第397场周赛个人题解
  • Mysql数据库二进制日志导致磁盘满了处理过程
  • 前端面试题日常练-day07 【面试题】
  • Uniapp H5开发常见问题解析
  • QT状态机4-使用并行状态来避免组合爆炸
  • MemoryModule - 应用编程细节
  • Java程序CPU持续高,如何排查?
  • (Java)心得:LeetCode——15.三数之和
  • Rust中忽略JSON反序列化时的不必要字段
  • UDP多对多组播通信