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
相关推荐
今天背单词了吗9805 小时前
AI 网关:大模型时代的统一接入与安全防线
网络·人工智能·安全·ai·1024程序员节
CodeGL5 小时前
13、Python基础之网络编程
网络·1024程序员节
星恒随风6 小时前
Linux网络编程基础(二):彻底理解局域网通信、MAC与IP地址、数据封装、端口号、网络字节序及Socket接口
linux·网络·笔记·学习·tcp/ip·1024程序员节
CHHH_HHH7 小时前
【Linux网络篇】初识网络与Socket编程基础
linux·服务器·c语言·开发语言·网络·后端·1024程序员节
weixin_417396837 小时前
老酒店有线电视改造怎么做?三种路径对比与施工节奏
网络·技术·酒店·1024程序员节·综合布线·弱电
pt10437 小时前
Cisco设备网络安全系列-12:Web服务器防护与WAF应用
网络·安全
jimmyleeee7 小时前
Agent安全之一:Agent Goal Hijack(ASI01)----当智能体“正确地”执行了错误的目标
运维·网络·安全
Sirens.9 小时前
网络通信基础:IP、端口、协议分层与数据封装
java·网络·网络协议·tcp/ip·java-ee·1024程序员节
码完就睡9 小时前
Linux——IP协议与路由选择
linux·网络·tcp/ip·1024程序员节
箓维9 小时前
UDP Socket的实现
网络·1024程序员节