实验要求:
1、R4为ISP,其上只配置IP地址;R4与其他所直连设备间均使用公有IP;
2、R3-R5、R6、R7为MGRE环境,R3为中心站点;
3、整个OSPF环境IP基于172.16.0.0/16划分;除了R12有两个环回,其他路由器均有一个环回IP
4、所有设备均可访问R4的环回;
5、减少LSA的更新量,加快收敛,保障更新安全;
6、全网可达;
实验步骤
1,配置IP地址
R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip address 172.16.33.1 24
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip address 172.16.34.1 24
R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip address 172.16.33.2 24
[R2-GigabitEthernet0/0/0]int l0
[R2-LoopBack0]ip address 172.16.35.2 24
R3
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip address 172.16.33.3 24
[R3-GigabitEthernet0/0/0]int l0
[R3-LoopBack0]ip address 172.16.36.3 24
[R3-LoopBack0]int s 4/0/0
[R3-Serial4/0/0]ip address 34.0.0.3 24
R4
[R4]int s 4/0/0
[R4-Serial4/0/0]ip address 34.0.0.4 24
[R4-Serial4/0/0]int s 4/0/1
[R4-Serial4/0/1]ip address 45.0.0.4 24
[R4-Serial4/0/1]int s 3/0/0
[R4-Serial3/0/0]ip address 46.0.0.4 24
[R4-Serial3/0/0]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip address 47.0.0.4 24
[R4-GigabitEthernet0/0/0]int l0
[R4-LoopBack0]ip address 172.16.2.4 24
R5
[R5]int s 4/0/0
[R5-Serial4/0/0]ip address 45.0.0.5 24
[R5-Serial4/0/0]int l0
[R5-LoopBack0]ip address 172.16.3.5 24
R6
[R6]int s 4/0/0
[R6-Serial4/0/0]ip address 46.0.0.6 24
[R6-Serial4/0/0]int l0
[R6-LoopBack0]ip address 172.16.4.6 24
[R6-LoopBack0]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip address 172.16.65.1 30
R7
[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]ip address 47.0.0.7 24
[R7-GigabitEthernet0/0/0]int g 0/0/1
[R7-GigabitEthernet0/0/1]ip address 172.16.97.1 30
[R7-GigabitEthernet0/0/1]int l0
[R7-LoopBack0]ip address 172.16.5.7 24
R8
[R8]int g 0/0/0
[R8-GigabitEthernet0/0/0]ip address 172.16.97.2 30
[R8-GigabitEthernet0/0/0]int g 0/0/1
[R8-GigabitEthernet0/0/1]ip address 172.16.97.5 30
[R8-GigabitEthernet0/0/1]int l0
[R8-LoopBack0]ip address 172.16.98.8 24
R9
[R9]int g 0/0/0
[R9-GigabitEthernet0/0/0]ip address 172.16.97.6 30
[R9-GigabitEthernet0/0/0]int g 0/0/1
[R9-GigabitEthernet0/0/1]ip address 172.16.129.1 30
[R9-GigabitEthernet0/0/1]int l0
[R9-LoopBack0]ip address 172.16.130.9 24
R10
[R10]int g 0/0/0
[R10-GigabitEthernet0/0/0]ip address 172.16.129.2 30
[R10-GigabitEthernet0/0/0]int l0
[R10-LoopBack0]ip address 172.16.131.10 24
R11
[R11]int g 0/0/0
[R11-GigabitEthernet0/0/0]ip address 172.16.65.2 30
[R11-GigabitEthernet0/0/0]int g 0/0/1
[R11-GigabitEthernet0/0/1]ip address 172.16.65.5 30
[R11-GigabitEthernet0/0/1]int l0
[R11-LoopBack0]ip address 172.16.66.11 24
R12
[R12]int g 0/0/0
[R12-GigabitEthernet0/0/0]ip address 172.16.65.6 30
[R12-GigabitEthernet0/0/0]int l0
[R12-LoopBack0]ip address 172.16.160.12 24
[R12-LoopBack0]int l1
[R12-LoopBack1]ip address 172.16.161.12 24
2,公网通
[R3]ip route-static 0.0.0.0 0 34.0.0.4
[R5]ip route-static 0.0.0.0 0 45.0.0.4
[R6]ip route-static 0.0.0.0 0 46.0.0.4
[R7]ip route-static 0.0.0.0 0 47.0.0.4
3,私网通(基于OSPF)
area 1
R1
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1-area-0.0.0.1]network 172.16.33.0 0.0.0.255
[R1-ospf-1-area-0.0.0.1]network 172.16.34.0 0.0.0.255
R2
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1-area-0.0.0.1]network 172.16.33.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]network 172.16.35.0 0.0.0.255
R3
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1-area-0.0.0.1]network 172.16.33.0 0.0.0.255
[R3-ospf-1-area-0.0.0.1]network 172.16.36.0 0.0.0.255
area 2
R6
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1-area-0.0.0.2]network 172.16.65.1 0.0.0.0
R11
[R11]ospf 1 router-id 11.11.11.11
[R11-ospf-1-area-0.0.0.2]network 172.16.65.2 0.0.0.0
[R11-ospf-1-area-0.0.0.2]network 172.16.65.5 0.0.0.0
[R11-ospf-1-area-0.0.0.2]network 172.16.66.0 0.0.0.255
R12
RIP
[R12]rip 1
[R12-rip-1]v 2
[R12-rip-1]undo summary
[R12-rip-1]network 172.16.0.0
OSPF
[R12]ospf 1 router-id 12.12.12.12
[R12-ospf-1-area-0.0.0.2]network 172.16.65.6 0.0.0.0
[R12-ospf-1]import-route rip //RIP引入
area 3
R7
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]network 172.16.97.1 0.0.0.0
R8
[R8]ospf 1 router-id 8.8.8.8
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]network 172.16.97.2 0.0.0.0
[R8-ospf-1-area-0.0.0.3]network 172.16.97.5 0.0.0.0
[R8-ospf-1-area-0.0.0.3]network 172.16.98.8 0.0.0.255
R9
[R9]ospf 1 router-id 9.9.9.9
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]net
[R9-ospf-1-area-0.0.0.3]network 172.16.97.6 0.0.0.0
area 4
R9
[R9]ospf 2 router-id 9.9.9.9
[R9-ospf-2]a 4
[R9-ospf-2-area-0.0.0.4]network 172.16.129.1 0.0.0.0
[R9-ospf-1]import-route ospf 2
[R9-ospf-2]import-route ospf 1
R10
[R10]ospf 2 router-id 10.10.10.10
[R10-ospf-2-area-0.0.0.4]network 172.16.129.2 0.0.0.0
[R10-ospf-2-area-0.0.0.4]network 172.16.131.0 0.0.0.0 0.0.0.255
4,配置隧道(R3为中心站点 实现公私网通)
·配置隧道
R3
[R3]int t 0/0/0
[R3-Tunnel0/0/0]ip address 172.16.6.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source s 4/0/0
R5
[R5]int t 0/0/0
[R5-Tunnel0/0/0]ip address 172.16.6.5 24
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source s 4/0/0
R6
[R6]int t 0/0/0
[R6-Tunnel0/0/0]ip address 172.16.6.6 24
[R6-Tunnel0/0/0]tunnel-protocol gre p2mp
[R6-Tunnel0/0/0]source s 4/0/0
R7
[R7]int t 0/0/0
[R7-Tunnel0/0/0]ip address 172.16.6.7 24
[R7-Tunnel0/0/0]tunnel-protocol gre p2mp
[R7-Tunnel0/0/0]source g 0/0/0
·NHRP的配置
[R3]int t 0/0/0
[R3-Tunnel0/0/0]nhrp net
[R3-Tunnel0/0/0]nhrp network-id 100 //中心站点
[R5]int t 0/0/0
[R5-Tunnel0/0/0]nhrp network-id 100
[R5-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
[R6]int t 0/0/0
[R6-Tunnel0/0/0]nhrp network-id 100
[R6-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
[R7]int t 0/0/0
[R7-Tunnel0/0/0]nhrp network-id 100
[R7-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
·配置OSPF路由协议来传递两端私网路由
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 172.16.6.0 0.0.0.255
[R5-Tunnel0/0/0]ospf 1
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]network 172.16.6.0 0.0.0.255
[R6-Tunnel0/0/0]ospf 1
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]network 172.16.6.0 0.0.0.255
[R7-Tunnel0/0/0]ospf 1
[R7-ospf-1]a 0
[R7-ospf-1-area-0.0.0.0]network 172.16.6.0 0.0.0.255
·解决OSPF建邻混乱问题——更改接口类型
[R3-Tunnel0/0/0]ospf network-type broadcast
[R5-Tunnel0/0/0]ospf network-type broadcast
[R6-Tunnel0/0/0]ospf network-type broadcast
[R7-Tunnel0/0/0]ospf network-type broadcast
·解决OSPF选举混乱问题——取消分支站点的选举权
[R5-Tunnel0/0/0]ospf dr-priority 0
[R6-Tunnel0/0/0]ospf dr-priority 0
[R7-Tunnel0/0/0]ospf dr-priority 0
`开启中心站点R3的伪广播
[R3-Tunnel0/0/0]nhrp entry multicast dynamic
测试全网通:
5,都可访问R4环回——easy ip
1,私网现在不能访问自己公网口,需要下发默认缺省
[R3]ospf 1
[R3-ospf-1]default-route-advertise always
[R5]ospf 1
[R5-ospf-1]default-route-advertise always
[R6]ospf 1
[R6-ospf-1]default-route-advertise always
[R7]ospf 1
[R7-ospf-1]default-route-advertise always
2,easy IP —— 私网地址访问公网
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3]int s 4/0/0
[R3-Serial4/0/0]nat outbound 2000
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R5]int s 4/0/0
[R5-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]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
测试结果
6,减少LSA更新量
1,路由聚合——主要减轻了骨干区域的LSA
ABR设备
[R3]ospf 1
[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
ASBR设备
[R9]ospf 1
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
[R12]ospf 1
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
2,划分特殊区域
area 1 —— 划分为totally stub区域
[R1]ospf 1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]stub no-summary
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]stub no-summary
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]stub no-summary
area 2,3——划分为totally nssa区域
area 2
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]nssa no-summary
[R11]ospf 1
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]nssa no-summary
[R12]ospf 1
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]nssa no-summary
area 3
[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]nssa no-summary
[R8]ospf 1
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]nssa no-summary
[R9]ospf 1
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]nssa no-summary
R9给R10下发缺省手工配置
[R9]ospf 2
[R9-ospf-2]default-route-advertise
7,加快收敛——更改hello时间
1,
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ospf timer hello 5
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ospf timer hello 5
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ospf timer hello 5
0:
[R3]int t 0/0/0
[R3-Tunnel0/0/0]ospf timer hello 5
[R5]int t 0/0/0
[R5-Tunnel0/0/0]ospf timer hello 5
[R6]int t 0/0/0
[R6-Tunnel0/0/0]ospf timer hello 5
[R7]int t 0/0/0
[R7-Tunnel0/0/0]ospf timer hello 5
2,
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]ospf timer hello 5
[R11]int g 0/0/0
[R11-GigabitEthernet0/0/0]ospf timer hello 5
[R12]int g 0/0/0
[R12-GigabitEthernet0/0/0]ospf timer hello 5
3,
[R7]int g 0/0/1
[R7-GigabitEthernet0/0/1]ospf timer hello 5
[R8]int g 0/0/0
[R8-GigabitEthernet0/0/0]ospf timer hello 5
[R8]int g 0/0/1
[R8-GigabitEthernet0/0/1]ospf timer hello 5
[R9]int g 0/0/0
[R9-GigabitEthernet0/0/0]ospf timer hello 5
4,
[R9]int g 0/0/1
[R9-GigabitEthernet0/0/1]ospf timer hello 5
[R10]int g 0/0/0
[R10-GigabitEthernet0/0/0]ospf timer hello 5
8,更新安全——认证(区域认证)
area 0
[R3]ospf 1
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 12345
[R5]ospf 1
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 12345
[R6]ospf 1
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 12345
[R7]ospf 1
[R7-ospf-1]a 0
[R7-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 12345
area 1
[R1]ospf 1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 12345
[R2]ospf 1
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 12345
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 12345
area 2
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 12345
[R11]ospf 1
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 12345
[R12]ospf 1
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 12345
area 3
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 12345
[R8]ospf 1
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 12345
[R9]ospf 1
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 12345
area 4
[R9]ospf 2
[R9-ospf-2]a 4
[R9-ospf-2-area-0.0.0.4]authentication-mode md5 1 cipher 12345
[R10]ospf 2
[R10-ospf-2]a 4
[R10-ospf-2-area-0.0.0.4]authentication-mode md5 1 cipher 12345
文章来源:https://www.toymoban.com/news/detail-854831.html
文章来源地址https://www.toymoban.com/news/detail-854831.html
到了这里,关于OSPF综合实验的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!