ospf综合实验

实验要求:

R1

R1\]undo info-center e \[R1\]interface GigabitEthernet0/0/0 \[R1-GigabitEthernet0/0/0\]ip address 172.16.32.129 29 \[R1-GigabitEthernet0/0/0\]interface LoopBack0 \[R1-LoopBack0\]ip address 172.16.33.1 25 ![](https://i-blog.csdnimg.cn/direct/959337fa2e534bf8a7549f8b6cb961af.png) R2 \[R2\]undo info-center e Info: Information center is disabled. \[R2\]interface GigabitEthernet0/0/0 \[R2-GigabitEthernet0/0/0\]ip address 172.16.32.130 29 \[R2-GigabitEthernet0/0/0\]interface LoopBack0 \[R2-LoopBack0\]ip address 172.16.33.129 25 R3 \[R3\]undo info-center e Info: Information center is disabled. \[R3\]interface GigabitEthernet0/0/0 \[R3-GigabitEthernet0/0/0\]ip address 172.16.32.131 29 \[R3-GigabitEthernet0/0/0\]interface GigabitEthernet0/0/1 \[R3-GigabitEthernet0/0/1\]ip address 34.1.1.1 24 \[R3-GigabitEthernet0/0/1\]interface LoopBack0 \[R3-LoopBack0\]ip address 172.16.34.1 25 \[R3-LoopBack0\]ip address 172.16.34.1 25 Error: The address already exists. \[R3-LoopBack0\]interface Tunnel0/0/0 \[R3-Tunnel0/0/0\]ip address 172.16.0.129 29 R4 \[R4\]undo info-center e Info: Information center is disabled. \[R4\]interface GigabitEthernet0/0/0 \[R4-GigabitEthernet0/0/0\]ip address 34.1.1.2 24 \[R4-GigabitEthernet0/0/0\]interface GigabitEthernet0/0/1 \[R4-GigabitEthernet0/0/1\]ip address 45.1.1.2 24 \[R4-GigabitEthernet0/0/1\]interface GigabitEthernet0/0/2 \[R4-GigabitEthernet0/0/2\]ip address 46.1.1.2 24 \[R4-GigabitEthernet0/0/2\]interface GigabitEthernet4/0/0 \[R4-GigabitEthernet4/0/0\]ip address 47.1.1.2 24 \[R4-GigabitEthernet4/0/0\]interface LoopBack0 \[R4-LoopBack0\]ip address 4.4.4.4 24 R5 \[R5\]interface GigabitEthernet0/0/0 \[R5-GigabitEthernet0/0/0\]ip address 45.1.1.1 24 \[R5-GigabitEthernet0/0/0

R5-GigabitEthernet0/0/0

R5-GigabitEthernet0/0/0\]interface LoopBack0 \[R5-LoopBack0\]ip address 172.16.1.1 25 \[R5-LoopBack0\]interface Tunnel0/0/0 \[R5-Tunnel0/0/0\]ip address 172.16.0.130 29 R6 \[R6\]interface GigabitEthernet0/0/0 \[R6-GigabitEthernet0/0/0\]ip address 46.1.1.1 24 \[R6-GigabitEthernet0/0/0\]interface GigabitEthernet0/0/1 \[R6-GigabitEthernet0/0/1\]ip address 172.16.96.1 30 \[R6-GigabitEthernet0/0/1\]interface LoopBack0 \[R6-LoopBack0\]ip address 172.16.1.129 25 \[R6-LoopBack0\]interface Tunnel0/0/0 \[R6-Tunnel0/0/0\]ip address 172.16.0.131 29 R7 \[R7\]interface GigabitEthernet0/0/0 \[R7-GigabitEthernet0/0/0\]ip address 47.1.1.1 24 \[R7-GigabitEthernet0/0/0\]interface GigabitEthernet0/0/1 \[R7-GigabitEthernet0/0/1\]ip address 172.16.64.1 30 \[R7-GigabitEthernet0/0/1\]interface LoopBack0 \[R7-LoopBack0\]ip address 172.16.2.1 25 \[R7-LoopBack0\]interface Tunnel0/0/0 \[R7-Tunnel0/0/0\]ip address 172.16.0.132 29 R8 \[R8\]interface GigabitEthernet0/0/0 \[R8-GigabitEthernet0/0/0\]ip address 172.16.64.2 30 \[R8-GigabitEthernet0/0/0\]interface GigabitEthernet0/0/1 \[R8-GigabitEthernet0/0/1\]ip address 172.16.64.5 30 \[R8-GigabitEthernet0/0/1\]interface LoopBack0 \[R8-LoopBack0\]ip address 172.16.65.1 25 R9 R9\]interface GigabitEthernet0/0/0 \[R9-GigabitEthernet0/0/0\]ip address 172.16.64.6 30 \[R9-GigabitEthernet0/0/0\]interface GigabitEthernet0/0/1 \[R9-GigabitEthernet0/0/1\]ip address 172.16.128.1 30 \[R9-GigabitEthernet0/0/1\]interface LoopBack0 \[R9-LoopBack0\]ip address 172.16.129.1 25 R10 \[R10\]interface GigabitEthernet0/0/0 \[R10-GigabitEthernet0/0/0

R10-GigabitEthernet0/0/0

R10-GigabitEthernet0/0/0\]ip address 172.16.128.2 30 \[R10-GigabitEthernet0/0/0\]interface LoopBack0 \[R10-LoopBack0\]ip address 172.16.129.129 25 R11 \[R11\]interface GigabitEthernet0/0/0 \[R11-GigabitEthernet0/0/0\]ip address 172.16.96.2 30 Error: Unrecognized command found at '\^' position. \[R11-GigabitEthernet0/0/0\]interface GigabitEthernet0/0/1 \[R11-GigabitEthernet0/0/1\]ip address 172.16.96.5 30 \[R11-GigabitEthernet0/0/1\]interface LoopBack0 \[R11-LoopBack0\]ip address 172.16.97.1 25 R12 \[R12\]interface GigabitEthernet0/0/0 \[R12-GigabitEthernet0/0/0\]ip address 172.16.96.6 30 \[R12-GigabitEthernet0/0/0\]interface LoopBack0 \[R12-LoopBack0\]ip address 172.16.160.1 20 \[R12-LoopBack0\]interface LoopBack1 \[R12-LoopBack1\]ip address 172.16.176.1 20 \[R12-LoopBack1\]ip route-static 172.16.160.0 19 NULL0 \[R12\]ip route-static 172.16.160.0 19 NULL0 一、建立缺省路由 \[R3\] ip route-static 0.0.0.0 0 34.1.1.2 \[R5\] ip route-static 0.0.0.0 0 45.1.1.2 \[R6\] ip route-static 0.0.0.0 0 46.1.1.2 \[R7\] ip route-static 0.0.0.0 0 47.1.1.2 二、建立虚拟端口 R3 int Tunnel 0/0/0 ip add 172.16.0.129 29 tunnel-protocol gre p2mp source 34.1.1.1 dis nhrp peer all R5 int Tunnel 0/0/0 ip add 172.16.0.130 29 tunnel-protocol gre p2mp source GigabitEthernet 0/0/0 nhrp entry 172.16.0.129 34.1.1.1 register ![](https://i-blog.csdnimg.cn/direct/f77fdb693d784036b621569f496f6dbc.png) R6 int Tunnel 0/0/0 ip add 172.16.0.131 29 tunnel-protocol gre p2mp source GigabitEthernet 0/0/0 nhrp entry 172.16.0.129 34.1.1.1 register ![](https://i-blog.csdnimg.cn/direct/acac0ac5614649419bfa117b769e0a33.png) R7 int Tunnel 0/0/0 ip add 172.16.0.132 29 tunnel-protocol gre p2mp source GigabitEthernet 0/0/0 nhrp entry 172.16.0.129 34.1.1.1 register ![](https://i-blog.csdnimg.cn/direct/0a52ff7114b945c4a204dcbb1df49602.png) **\[R3\]int Tunnel 0/0/0 \[R3-Tunnel0/0/0\]nhrp entry multicast dynamic** **\[R3\]dis nhrp peer all** ![](https://i-blog.csdnimg.cn/direct/40afc8b9e41e4c50bc46f0931aae810b.png) 三、配置ospf协议 \[R1

ospf 1 router-id 1.1.1.1

area 1

net 172.16.32.0 0.0.1.255

R2

ospf 1 router-id 2.2.2.2

area 1

net 172.16.32.0 0.0.1.255

R3

ospf 1 router-id 3.3.3.3

area 0

net 172.16.0.129 0.0.0.0

area 1

net 172.16.32.0 0.0.3.255

R5

ospf 1 router-id 5.5.5.5

area 0

net 172.16.0.0 0.0.1.255

R6

ospf 1 router-id 6.6.6.6

area 0

net 172.16.0.0 0.0.1.255

area 2

net 172.16.96.1 0.0.0.0

R7

ospf 1 router-id 7.7.7.7

area 0

net 172.16.0.0 0.0.3.255

area 3

net 172.16.64.1 0.0.0.0

R8

ospf 1 router-id 8.8.8.8

area 3

net 172.16.64.0 0.0.1.255

R9

ospf 1 router-id 9.9.9.9

area 3

net 172.16.64.6 0.0.0.0

area 4

net 172.16.128.0 0.0.1.255

R10

ospf 1 router-id 10.10.10.10

area 4

net 172.16.128.0 0.0.1.255

R11

ospf 1 router-id 11.11.11.11

area 2

net 172.16.96.0 0.0.1.255

R12

ospf 1 router-id 12.12.12.12

area 2

net 172.16.96.6 0.0.0.0

rip 1

vers 2

net 172.16.0.0

四、更改接口类型:dis ospf interface Tunnel 0/0/0

R3

int Tunnel 0/0/0

ospf network-type broadcast

R5\]int Tunnel 0/0/0 ospf network-type broadcast \[R6\]int Tunnel 0/0/0 \[R6-Tunnel0/0/0\]ospf network-type broadcast \[R7\]int Tunnel 0/0/0 \[R7-Tunnel0/0/0\]ospf network-type broadcast ![](https://i-blog.csdnimg.cn/direct/8d295cef2f5b4a0fa68452a906e189b1.png) 五、修改其他路由的优先级,让R3称为DR \[R5\]int Tunnel 0/0/0 \[R5-Tunnel0/0/0\]ospf dr-priority 0 \[R6\]int Tunnel 0/0/0 \[R6-Tunnel0/0/0\]ospf dr-priority 0 \[R7\]int Tunnel 0/0/0 \[R7-Tunnel0/0/0\]ospf dr-priority 0 ![](https://i-blog.csdnimg.cn/direct/6830617813d3494890e10ccb013a35c8.png) 六、进程重发布: R9 ospf 1 area 4 undo net 172.16.128.0 0.0.1.255 ospf 2 area 4 net 172.16.128.0 0.0.1.255 ospf 1 import-route ospf 2 ospf 2 import-route ospf 1 \[R12\]ospf 1 import-route rip ![](https://i-blog.csdnimg.cn/direct/f136f40dcaa84b2c9e8e3a23fc88c248.png) 七、LSA路由优化路由汇总: \[R3

ospf 1

area 1

abr-summary 172.16.32.0 255.255.224.0

R7

ospf 1

area 3

abr-summary 172.16.64.0 255.255.224.0

R6

ospf 1

area 2

abr-summary 172.16.96.0 255.255.224.0

R12

ospf 1

asbr-summary 172.16.160.0 255.255.224.0

R9

ospf 1

asbr-summary 172.16.128.0 255.255.224.0

八、配置末梢区域:

R1

ospf 1

area 1

stub

R2

ospf 1

area 1

stub

R3

ospf 1

area 1

stub no-summary

R6

ospf 1

area 2

nssa no-summary

R7

ospf 1

area 3

nssa no-su

nssa no-summary

R8

ospf 1

area 3

nssa

R9

ospf 1

area 3

nssa

R11

ospf 1

area 2

nssa

R12

ospf 1

area 2

nssa

R9\]ospf 2 \[R9-ospf-2\]undo import-route ospf 1 \[R9-ospf-2\]default-route-advertise ![](https://i-blog.csdnimg.cn/direct/6bc99b9036d446aba52cb9bdbf931457.png) 九、公网部分配置: \[R3\] ip route-static 172.16.32.0 19 NULL 0 \[R6\] ip route-static 172.16.96.0 19 NULL 0 \[R7\] ip route-static 172.16.64.0 19 NULL 0 \[R9\] ip route-static 172.16.128.0 19 NULL 0 \[R12\] ip route-static 172.16.160.0 19 NULL 0 \[R3

acl 2000

rule permit source 172.16.0.0 0.0.255.255

int g0/0/1

nat outbound 2000

R6

acl 2000

rule permit source 172.16.0.0 0.0.255.255

int g0/0/0

nat outbound 2000

R7

acl 2000

rule permit source 172.16.0.0 0.0.255.255

int g0/0/0

nat outbound 2000

测试:任意区域路由器去上网

相关推荐
YGGP24 分钟前
【每日八股】复习计算机网络 Day1:TCP 的头部结构 + TCP 确保可靠传输 + TCP 的三次握手
网络·tcp/ip·计算机网络
涛ing1 小时前
【Linux “less“ 命令详解】
linux·运维·c语言·c++·人工智能·vscode·bash
ybdesire1 小时前
Jinja2模板引擎SSTI漏洞
网络·人工智能·安全·web安全·大模型·漏洞·大模型安全
屎到临头想搅便2 小时前
OSPF综合实验(HCIP)
网络·智能路由器
黑金IT2 小时前
如何在 Electron 应用中安全地进行主进程与渲染器进程通信
服务器·安全·electron
林木木木木木木木木木3 小时前
【随身WiFi】随身WiFi Debian系统优化教程
linux·运维·debian·随身wifi
杨浦老苏3 小时前
Docker应用端口查看器docker-port-viewer
运维·docker·群晖
AI大模型顾潇3 小时前
[特殊字符] AI 大模型的 Prompt Engineering 原理:从基础到源码实践
运维·人工智能·spring·自然语言处理·自动化·大模型·prompt
柳如烟@4 小时前
基于GTID的主从复制
运维·mysql·gdit
谢斯4 小时前
【jenkins】首次配置jenkins
运维·jenkins