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区域网络

相关推荐
清水白石0086 小时前
ThreadPoolExecutor 线程越多越快?从 30ms HTTP 调用讲透并发数、连接池与背压
网络·网络协议·http
IT小白杨6 小时前
eBay多账号如何应对关联判定:主体、收款、IP、环境四层配置清单一次讲清
java·网络·网络协议·tcp/ip·自动化·指纹浏览器
あ-6 小时前
企业 DevOps + 协同办公 + 可观测性 + 网络基础设施平台
运维·网络·devops
数据知道6 小时前
哈希与密码存储——bcrypt、Argon2、盐值与彩虹表
网络·算法·安全·网络安全·密码学·哈希算法
sbjdhjd6 小时前
从 7 字符文件名拼接到二维数组取值:PHP 无参函数限制下的受控靶场复盘 | (7字符绕过)
网络·nginx·安全·网络安全·云计算·php·apache
新时代牛马7 小时前
Linux 网络配置:iproute2、DNS 与连通性排障
linux·服务器·网络
新时代牛马7 小时前
Linux systemd 服务管理:从unit 文件到systemctl 启停与排障
linux·服务器·网络
隐擎fox7 小时前
网络传输安全剖析:WebRTC 本地真实 IP 泄漏机制(STUN/TURN)与 Python 防护检测实战
网络·网络协议·tcp/ip·安全·webrtc
回忆2012初秋7 小时前
DBX:一个现代化的轻量级、跨平台的开源数据库管理工具
大数据·服务器·网络
对讲机数码科普7 小时前
# 室内弱覆盖场景专网通信优化方案:建筑结构、频段适配与组网布局的系统分析
网络