OSPF实验

基础 IP 配置

复制代码
 R1
int g 0/0/0
ip add 172.16.33.1 255.255.255.248
int l 0
ip add 172.16.34.1 255.255.255.0
 R2
int g 0/0/0
ip add 172.16.33.2 255.255.255.248
int l 0
ip add 172.16.35.1 255.255.255.0
 R3
int g 0/0/0
ip add 172.16.33.3 255.255.255.248
int l 0
ip add 172.16.36.1 255.255.255.0
int s 4/0/0
ip add 34.0.0.1 255.255.255.252
 R4 (ISP)
int s 4/0/0
ip add 34.0.0.2 255.255.255.252
int s 4/0/1
ip add 54.0.0.2 255.255.255.0
int s 3/0/0
ip add 64.0.0.2 255.255.255.0
int g 0/0/0
ip add 74.0.0.2 255.255.255.0
int l 0
ip add 4.4.4.4 255.255.255.0
 R5
int s4/0/0
ip add 54.0.0.1 255.255.255.0
ip route-static 0.0.0.0 0 54.0.0.2
 R6
int s 4/0/0
ip add 64.0.0.1 255.255.255.0
int g 0/0/0
ip add 172.16.65.1 255.255.255.248
ip route-static 0.0.0.0 0 64.0.0.2
 R7
int g 0/0/0
ip add 74.0.0.1 255.255.255.0
int g 0/0/1
ip add 172.16.97.1 255.255.255.248
ip route-static 0.0.0.0 0 74.0.0.2
 R8
int g 0/0/0
ip add 172.16.97.2 255.255.255.248
int l 0
ip add 172.16.98.1 255.255.255.0
int g 0/0/1
ip add 172.16.97.3 255.255.255.248
 R9
int g 0/0/0
ip add 172.16.97.4 255.255.255.248
int g 0/0/1
ip add 172.16.129.1 255.255.255.248
int l0
ip add 172.16.130.1 255.255.255.0
 R10
int g 0/0/0
ip add 172.16.129.2 255.255.255.248
int l 0
ip add 172.16.131.1 255.255.255.0
 R11
int g 0/0/0
ip add 172.16.65.2 255.255.255.248
int l 0
ip add 172.16.66.1 255.255.255.0
int g 0/0/1
ip add 172.16.65.3 255.255.255.248
 R12
int g 0/0/0
ip add 172.16.65.4 255.255.255.248
int l 1
ip add 172.16.176.1 255.255.240.0
int l 0
ip add 172.16.160.1 255.255.240.0

MGRE 配置

复制代码
R3
int t 0/0/0
ip add 172.16.1.1 255.255.255.248
tunnel-protocol gre p2mp
source 34.0.0.1
nhrp network-id 100
nhrp entry multicast dynamic
R5
int t 0/0/0
ip add 172.16.1.2 255.255.255.248
tunnel-protocol gre p2mp
source s4/0/0
nhrp network-id 100
nhrp entry 172.16.1.1 34.0.0.1 register
int l 0
ip add 172.16.2.1 255.255.255.0
R6
int t 0/0/0
ip add 172.16.1.3 255.255.255.248
tunnel-protocol gre p2mp
source s 4/0/0
nhrp network-id 100
nhrp entry 172.16.1.1 34.0.0.1 register
int l 0
ip add 172.16.3.1 255.255.255.0
R7
int t 0/0/0
ip add 172.16.1.4 255.255.255.248
tunnel-protocol gre p2mp
source g 0/0/0
nhrp network-id 100
nhrp entry 172.16.1.1 34.0.0.1 register
int l 0
ip add 172.16.4.1 255.255.255.0

OSPF RIP 配置

复制代码
R1
ospf 1 router-id 1.1.1.1
area 1
network 172.16.33.0 0.0.0.255
network 172.16.34.0 0.0.0.255
R2
ospf 1 router-id 2.2.2.2
area 1
network 172.16.33.0 0.0.0.255
network 172.16.35.0 0.0.0.255
R3
ospf 1 router-id 3.3.3.3
area 1
network 172.16.33.3 0.0.0.0
network 172.16.36.1 0.0.0.0
area 0
network 172.16.1.0 0.0.0.255
int t 0/0/0
ospf network-type p2mp
R5
ospf 1 router-id 5.5.5.5
area 0
network 172.16.1.0 0.0.0.255
network 172.16.2.0 0.0.0.255
int t 0/0/0
ospf network-type p2mp
R6
ospf 1 router-id 6.6.6.6
area 0
network 172.16.1.0 0.0.0.255
network 172.16.3.0 0.0.0.255
area 2
network 172.16.65.0 0.0.0.255
int t 0/0/0
ospf network-type p2mp
R7
ospf 1 router-id 7.7.7.7
area 0
network 172.16.1.0 0.0.0.255
network 172.16.4.0 0.0.0.255
area 3
network 172.16.97.0 0.0.0.255
int t 0/0/0
ospf network-type p2mp
R8
ospf 1 router-id 8.8.8.8
area 3
network 172.16.97.0 0.0.0.255
network 172.16.98.0 0.0.0.255
R9
ospf 1 router-id 9.9.9.9
area 3
network 172.16.97.0 0.0.0.255
area 4
network 172.16.129.0 0.0.0.255
network 172.16.130.0 0.0.0.255
ospf 2 router-id 19.19.19.19
area 4
network 172.16.129.0 0.0.0.255
network 172.16.130.0 0.0.0.255
ospf 1
import-route ospf 2
R10
ospf 1 router-id 10.10.10.10
area 4
network 172.16.129.0 0.0.0.255
network 172.16.131.0 0.0.0.255
R11
ospf 1 router-id 11.11.11.11
area 2
network 172.16.65.0 0.0.0.255
network 172.16.66.0 0.0.0.255
R12
ospf 1 router-id 12.12.12.12
area 2
network 172.16.65.0 0.0.0.255
import-route rip 1

rip 1
version 2
network 172.16.0.0

减少LSA更新量

复制代码
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
[r3]ip route-static 172.16.32.0 19 NULL 0
[r6]ospf 1 
[r6-ospf-1]area 2 
[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[r6]ip route-static 172.16.64.0 19 NULL 0
[r7]ospf 1 
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
[r7]ip route-static 172.16.96.0 19 NULL 0
[r9]ospf 1 
[r9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
[r9]ip route-static 172.16.128.0 19 NULL 0
[r12]ospf 1 
[r12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
[r9]ip route-static 172.16.160.0  19 NULL 0
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]stub
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]stub
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]stub  no-summary
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]nssa no-summary 
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.2]nssa 
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]nssa
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]nssa no-summary 
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]nssa 
[r9-ospf-1]area 3
[r9-ospf-1-area-0.0.0.3]nssa
[r9]ospf 2
[r9-ospf-2]default-route-advertise

加快收敛

复制代码
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ospf timer hello 10
[r5]int t 0/0/0
[r5-Tunnel0/0/0]ospf timer hello 10
[r5-Tunnel0/0/0]
[r6]int t 0/0/0
[r6-Tunnel0/0/0]ospf timer hello 10
[r7]int t 0/0/0
[r7-Tunnel0/0/0]ospf timer hello 10

配置NAT环境,完成所有设备访问R4环回

复制代码
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255----R4环回的地址
[r3]int s 4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r6]acl 2000
[r6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r6-acl-basic-2000]int s 4/0/0
[r6-Serial4/0/0]nat outbound 2000
[r7]acl 2000
[r7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r7]int g 0/0/0
[r7-GigabitEthernet0/0/0]nat outbound 2000

全网可达

复制代码
[r1]ospf 1
[r1-ospf-1]a 1
[r1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r2]ospf 1
[r2-ospf-1]a 1
[r2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r3]ospf 1
[r3-ospf-1]a 1
[r3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
相关推荐
网络研究院4 天前
2026年网络安全
网络·安全·法律·法规·趋势·发展
酣大智4 天前
ARP代理--工作原理
运维·网络·arp·arp代理
treesforest4 天前
AI安全系统如何识别异常访问?IP风险识别正在成为关键能力
网络·人工智能·tcp/ip·安全·web安全
shushangyun_4 天前
2026年快消品B2B系统推荐:支持终端门店订货、促销政策自动化的工具?
java·运维·网络·数据库·人工智能·spring·自动化
2601_961845154 天前
粉笔行测题库|系统班|刷题
网络·百度·微信·微信公众平台·facebook·新浪微博
程序猿阿伟4 天前
《Chrome离线扩展安装的底层逻辑与场景落地指南》
服务器·网络·chrome
InHand云飞小白5 天前
无人值守站点网络困境?工业级路由器IR315破解连接难题
网络·物联网·4g·工业路由器·4g路由器·iiot·蜂窝路由器
森G5 天前
75、服务器源码解析---------云视频服务项目
linux·服务器·网络·c++·qt
江华森5 天前
TCP/IP 协议栈实战 — 7 个实验详解
网络·tcp/ip·智能路由器
酉鬼女又兒5 天前
零基础入门计算机网络运输层:端到端通信核心作用、端口号分类规则、复用分用工作机制及UDP与TCP协议全方位对比详解
网络·网络协议·tcp/ip·计算机网络·考研·udp·php