OSPF综合实验

拓扑图

要求:

分析:

1.规划全网各区域的网段,并配置各个设备的ip

1.区域零172.16.0.0/19

R3R4---34.0.0.0/24

R5R4---54.0.0.0/24

R6R4---64.0.0.0/24

R7R4---74.0.0.0/24

MGRE172.16.0.0/24

R4环回172.16.4.0/24

R5环回172.16.1.0/24

R6环回172.16.2.0/24

R7环回172.16.3.0/24

2.区域一172.16.32.0/19

R1R2R3互联172.16.35.0/29

R1环回172.16.32.0/24

R2环回172.16.33.0/24

R3环回172.16.34.0/24

3.区域二172.16.64.0/19

R6R11互联172.16.65.0/30

R11R12互联172.16.65.4/30

R11环回

4.区域三172.16.96.0/19

R7R8互联172.16.97.0/30

R8R9互联172.16.97.4/30

R8环回172.16.96.0/24

5.区域四172.16.128.0/19

R9R10互联172.16.130.0/30

R9环回172.16.128.0/24

R10环回172.16.129.0/24

6.RIP区域

192.168.1.0/24和192.168.2.0/24

2.完成全网的OSPF和RIP配置,以及重发布配置

1.A0各私网设备添加指向R4的缺省路由
2.A0A1A2A3为OSPF1,A4为OSPF2,各设备环回网络类型改为broadcast
3.R9向ospf1重发布ospf2,R12向ospf1重发布rip1

3.R3R5R6R7间配置MGRE,且R3为HUB

  1. A0各私网设备隧道接口网络类型改为p2mp,且HUB设备R3隧道接口开启伪组播功能,并让R5R6R7等设备放弃dr选举

4.公私网地址转换,确保ping通R4环回

5.优化

1.减少LSA更新量:路由汇总,特殊区域
2.加快收敛:更换收敛更快的网络类型,减少计时器时间
3.保障安全:各设备添加认证
4.防黑洞路由

搭建:

1.ip配置

复制代码
//R1
#
interface GigabitEthernet0/0/0
 ip address 172.16.35.1 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.32.1 255.255.255.0 
 ospf network-type broadcast

//R2
#
interface GigabitEthernet0/0/0
 ip address 172.16.35.2 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.33.1 255.255.255.0 
 ospf network-type broadcast

//R3
#
interface Serial4/0/0
 link-protocol ppp
 ip address 34.0.0.3 255.255.255.0 
#
interface GigabitEthernet0/0/0
 ip address 172.16.35.3 255.255.255.248 
#
interface LoopBack0
 ip address 172.16.34.1 255.255.255.0 
 ospf network-type broadcast

//R4
#
interface Serial3/0/0
 link-protocol ppp
 ip address 64.0.0.4 255.255.255.0 
#
interface Serial4/0/0
 link-protocol ppp
 ip address 34.0.0.4 255.255.255.0 
#
interface Serial4/0/1
 link-protocol ppp
 ip address 54.0.0.4 255.255.255.0 
#
interface GigabitEthernet0/0/0
 ip address 74.0.0.4 255.255.255.0 
#
interface LoopBack0
 ip address 172.16.4.1 255.255.255.0 

............

2.ospf和rip配置

复制代码
//R1
#
ospf 1 router-id 1.1.1.1 
 area 0.0.0.1 
  network 172.16.32.0 0.0.31.255 

//R2
#
ospf 1 router-id 2.2.2.2 
 area 0.0.0.1 
  network 172.16.32.0 0.0.31.255 

//R3
#
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 172.16.0.0 0.0.31.255 
 area 0.0.0.1 
  network 172.16.32.0 0.0.31.255 

//R5
#
ospf 1 router-id 5.5.5.5 
 area 0.0.0.0 
  network 172.16.0.0 0.0.31.255 

//R9
#
ospf 1 router-id 9.9.9.9 
 asbr-summary 172.16.128.0 255.255.224.0
 import-route ospf 2
 area 0.0.0.3 
  network 172.16.96.0 0.0.31.255 

//R12
#
ospf 1 router-id 12.12.12.12 
 asbr-summary 192.168.0.0 255.255.252.0
 import-route rip 1
 area 0.0.0.2 
  network 172.16.64.0 0.0.31.255 
............

3.mgre配置

复制代码
//R3
#
interface Tunnel0/0/0
 ip address 172.16.0.3 255.255.255.0 
 tunnel-protocol gre p2mp
 source 34.0.0.3
 ospf network-type p2mp
 nhrp entry multicast dynamic

//R5
#
interface Tunnel0/0/0
 ip address 172.16.0.5 255.255.255.0 
 tunnel-protocol gre p2mp
 source Serial4/0/0
 ospf network-type p2mp
 ospf dr-priority 0
 nhrp entry 172.16.0.3 34.0.0.3 register

//R6
#
interface Tunnel0/0/0
 ip address 172.16.0.6 255.255.255.0 
 tunnel-protocol gre p2mp
 source Serial4/0/0
 ospf network-type p2mp
 ospf dr-priority 0
 nhrp entry 172.16.0.3 34.0.0.3 register

//R7
#
interface Tunnel0/0/0
 ip address 172.16.0.7 255.255.255.0 
 tunnel-protocol gre p2mp
 source GigabitEthernet0/0/0
 ospf network-type p2mp
 ospf dr-priority 0
 nhrp entry 172.16.0.3 34.0.0.3 register

4.nat配置

复制代码
//R3
#
acl number 2000  
 rule 5 permit source 172.16.0.0 0.0.255.255 
#
interface Serial4/0/0
 nat outbound 2000

//R5
#
acl number 2000  
 rule 5 permit source 172.16.0.0 0.0.255.255 
#
interface Serial4/0/0
 nat outbound 2000

//R6
#
acl number 2000  
 rule 5 permit source 172.16.0.0 0.0.255.255 
#
interface Serial4/0/0
 nat outbound 2000

//R7
#
acl number 2000  
 rule 5 permit source 172.16.0.0 0.0.255.255 
#
interface GigabitEthernet0/0/0
 nat outbound 2000

5.优化

复制代码
//R1
#
ospf 1 router-id 1.1.1.1 
 area 0.0.0.1 
  network 172.16.32.0 0.0.31.255 
  stub 

//R2
#
ospf 1 router-id 2.2.2.2 
 area 0.0.0.1 
  network 172.16.32.0 0.0.31.255 
  stub 

//R3
#
ospf 1 router-id 3.3.3.3 
 area 0.0.0.0 
  network 172.16.0.0 0.0.31.255 
 area 0.0.0.1 
  abr-summary 172.16.32.0 255.255.224.0
  network 172.16.32.0 0.0.31.255 
  stub no-summary

//R6
#
ospf 1 router-id 6.6.6.6 
 area 0.0.0.0 
  network 172.16.0.0 0.0.31.255 
 area 0.0.0.2 
  abr-summary 172.16.64.0 255.255.224.0
  network 172.16.64.0 0.0.31.255 
  nssa no-summary

//R7
#
ospf 1 router-id 7.7.7.7 
 area 0.0.0.0 
  network 172.16.0.0 0.0.31.255 
 area 0.0.0.3 
  abr-summary 172.16.96.0 255.255.224.0
  network 172.16.96.0 0.0.31.255 
  nssa no-import-route

//R8
#
ospf 1 router-id 8.8.8.8 
 area 0.0.0.3 
  network 172.16.96.0 0.0.31.255 
  nssa

//R9
#
ospf 1 router-id 9.9.9.9 
 asbr-summary 172.16.128.0 255.255.224.0
 import-route ospf 2
 area 0.0.0.3 
  network 172.16.96.0 0.0.31.255 
  nssa

//R11
#
ospf 1 router-id 11.11.11.11 
 area 0.0.0.2 
  network 172.16.64.0 0.0.31.255 
  nssa

//R12
#
ospf 1 router-id 12.12.12.12 
 asbr-summary 192.168.0.0 255.255.252.0
 import-route rip 1
 area 0.0.0.2 
  network 172.16.64.0 0.0.31.255 
  nssa

结果

1.R1ping通R4环回

2.R1ping通R10

3.R1ping通RIP区域网络

相关推荐
LabVIEW开发1 天前
ALMEMO 采集器 + LabVIEW 多路温度怎么采?
网络·labview
郝学胜-神的一滴1 天前
Effective STL 条款 14:用扩容函数避免重新分配
linux·开发语言·网络·数据结构·c++·单片机
王亚博_Abel1 天前
域名是怎么变成 IP 的?手拆 DNS 解析四个实验实测
网络·网络协议·tcp/ip
always20222 天前
AI运行时 · 11 - Serverless API 网关:冷启动、流量路由、Autoscaler、函数生命周期
网络·人工智能·serverless
神一样的老师2 天前
用 FCU1501 双网口打通两个不同网段:IP 转发 + NAT 实战
网络·网络协议·tcp/ip
jipinxiaofeihua2 天前
(文章6) 03章-C++文件操作(下)
linux·运维·网络
keepquietl2 天前
UDS on CAN 入门(6):诊断响应要等多久?读懂 P2、P2* 和 S3
网络·网络协议
XW9632582 天前
除湿机行业组织能力与人才地图报告
大数据·服务器·网络·数据结构·数据库·人工智能
ManThink Technology2 天前
ThinkLink 告警如何落地:从触发条件到恢复通知的完整检查
网络·物联网
fly-3352 天前
快速重传与快速恢复:TCP丢包的高效应对
服务器·网络·tcp/ip