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
相关推荐
koo3641 小时前
周报5.31
网络
それども1 小时前
怎么理解TCP的状态
java·网络·网络协议·tcp/ip·dubbo
其实防守也摸鱼1 小时前
告别单个变量,用列表和字典批量管理你的 Python 数据
开发语言·网络·软件测试·python·web安全·数据结构,编程教程
欧神附体1231 小时前
计算机网络之专业名词中英文解释(第一弹)
网络
ylscode1 小时前
Pentest Swarm AI:开源群体智能架构如何重构自主渗透测试的边界
网络·安全·安全威胁分析
weixin_429630262 小时前
3.51 Centra-Net:一种跨场景的集中式视觉定位网络
网络
江华森2 小时前
Linux 内核调优 + TCP/IP 协议栈深度解析 + 低延迟网络优化
linux·网络·tcp/ip
范范@2 小时前
Python进阶 网络编程笔记-多进程
网络·笔记·python
很懒的程序员雄3 小时前
华为eNSP静态路由实验教学
网络