如有错误,敬请谅解!
此文章仅为本人学习笔记,仅供参考,如有冒犯,请联系作者删除!!!
实验拓扑图:
1.根据题意可知,需要基于172.16.0.0/16划分六个网段
172.16.0.0/19---a0
172.16.0.0/24--p2p骨干
172.16.0.0/30
172.16.0.4/30
172.16.0.8/30
......
172.16.1.0/24--MA骨干
172.16.1.0/29
172.16.8.0/29
172.16.16.0/29
......
172.16.2.0/24
172.16.3.0/24
.......172.16.32.0/19---a1
......
172.16.64.0/19---a2
.....
172.16.96.0/19---a3
......
172.16.128.0/19---a4
......
172.16.160.0/19---rip
172.16.160.0/20
172.16.176.0/20
......
2.R1上配置
# 配置接口IP
interface GigabitEthernet0/0/0
ip address 172.16.1.65 255.255.255.192
#
interface LoopBack0
ip address 172.16.1.1 255.255.255.192
# 启动OSPF宣告所有接口
ospf 1 router-id 1.1.1.1
area 0.0.0.1
network 172.16.1.0 0.0.0.255
3.R2上配置
# 配置接口IP
interface GigabitEthernet0/0/0
ip address 172.16.1.66 255.255.255.192
#
interface LoopBack0
ip address 172.16.128.1 255.255.252.0
# 启动OSPF进程宣告所有接口
ospf 1 router-id 2.2.2.2
area 0.0.0.1
network 172.16.1.0 0.0.0.255
4.R3上配置
# 配置接口IP
interface Serial4/0/0
link-protocol ppp
ip address 34.1.1.1 255.255.255.0
nat outbound 2000
#
interface GigabitEthernet0/0/0
ip address 172.16.1.67 255.255.255.192
#
interface LoopBack0
ip address 172.16.1.193 255.255.255.192
# 创建tunnel口,搭建MGRE环境
interface Tunnel0/0/0
ip address 172.16.0.1 255.255.255.192
tunnel-protocol gre p2mp
source 34.1.1.1
ospf network-type p2mp
nhrp entry multicast dynamic
nhrp network-id 100
# 启动OSPF进程
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 172.16.0.0 0.0.0.255
area 0.0.0.1
abr-summary 172.16.1.0 255.255.255.0
network 172.16.1.0 0.0.0.255
stub no-summary
# 缺省路由指向ISP
ip route-static 0.0.0.0 0.0.0.0 34.1.1.2
ip route-static 172.16.1.0 255.255.255.0 null0
5.R4上配置
# R4上只配置接口IP
interface Serial2/0/0
link-protocol ppp
ip address 34.1.1.2 255.255.255.0
#
interface Serial2/0/1
link-protocol ppp
ip address 54.1.1.2 255.255.255.0
#
interface Serial3/0/0
link-protocol ppp
ip address 64.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/0
ip address 74.1.1.2 255.255.255.0
#
interface LoopBack0
ip address 8.8.8.8 255.255.255.0
6.R5上配置
# 配置接口IP
interface Serial4/0/0
link-protocol ppp
ip address 54.1.1.1 255.255.255.0
#
interface LoopBack0
ip address 172.16.0.65 255.255.255.192
# 创建tunne口,搭建MGRE环境
interface Tunnel0/0/0
ip address 172.16.0.2 255.255.255.192
tunnel-protocol gre p2mp
source Serial4/0/0
ospf network-type p2mp
nhrp network-id 100
nhrp entry 172.16.0.1 34.1.1.1 register
# 启动ospf进程
ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 172.16.0.0 0.0.0.255
# 缺省路由和空接口路由
ip route-static 0.0.0.0 0.0.0.0 54.1.1.2
7.R6上配置
# 使用acl抓取私网流量
acl number 2000
rule 5 permit source 172.16.0.0 0.0.255.255
# 配置接口IP
interface Serial4/0/0
link-protocol ppp
ip address 64.1.1.1 255.255.255.0
nat outbound 2000
#
interface GigabitEthernet0/0/0
ip address 172.16.2.1 255.255.255.192
#
interface LoopBack0
ip address 172.16.0.129 255.255.255.192
# 创建tunne口,搭建MGRE环境
interface Tunnel0/0/0
ip address 172.16.0.3 255.255.255.192
tunnel-protocol gre p2mp
source Serial4/0/0
ospf network-type p2mp
nhrp network-id 100
nhrp entry 172.16.0.1 34.1.1.1 register
# 启动OSPF进程
ospf 1 router-id 6.6.6.6
area 0.0.0.0
network 172.16.0.0 0.0.0.255
area 0.0.0.2
abr-summary 172.16.2.0 255.255.255.0
network 172.16.2.0 0.0.0.255
nssa no-summary
# 缺省路由和空接口路由
ip route-static 0.0.0.0 0.0.0.0 64.1.1.2
ip route-static 172.16.2.0 255.255.255.0 null0
8.R7上配置
# 使用acl抓取私网流量
acl number 2000
rule 5 permit source 172.16.0.0 0.0.255.255
# 配置接口IP
interface GigabitEthernet0/0/0
ip address 74.1.1.1 255.255.255.0
nat outbound 2000
#
interface GigabitEthernet0/0/1
ip address 172.16.3.1 255.255.255.192
#
interface LoopBack0
ip address 172.16.0.193 255.255.255.192
#配置接口IP
interface Tunnel0/0/0
ip address 172.16.0.4 255.255.255.192
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type p2mp
nhrp network-id 100
nhrp entry 172.16.0.1 34.1.1.1 register
# 启动OSPF进程
ospf 1 router-id 7.7.7.7
area 0.0.0.0
network 172.16.0.0 0.0.0.255
area 0.0.0.3
abr-summary 172.16.3.0 255.255.255.0
network 172.16.3.0 0.0.0.255
nssa no-summary
# 缺省路由和空接口路由
ip route-static 0.0.0.0 0.0.0.0 74.1.1.2
ip route-static 172.16.3.0 255.255.255.0 null0
9.R8上配置
# 配置接口IP
interface GigabitEthernet0/0/0
ip address 172.16.3.2 255.255.255.192
#
interface GigabitEthernet0/0/1
ip address 172.16.3.129 255.255.255.192
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 172.16.3.65 255.255.255.192
# 启动OSPF进程
ospf 1 router-id 8.8.8.8
area 0.0.0.3
network 172.16.3.0 0.0.0.255
10.R9上配置
# 配置接口IP
interface GigabitEthernet0/0/0
ip address 172.16.3.130 255.255.255.192
#
interface GigabitEthernet0/0/1
ip address 172.16.4.65 255.255.255.192
#
interface LoopBack0
ip address 172.16.4.1 255.255.255.192
# 启动OSPF进程1
ospf 1 router-id 9.9.9.9
asbr-summary 172.16.4.0 255.255.255.0
import-route ospf 2
area 0.0.0.3
network 172.16.3.0 0.0.0.255
nssa --- 配置该区域为NSSA
# 启动OSPF进程2
ospf 2 router-id 9.9.9.9
asbr-summary 0.0.0.0 0.0.0.0
import-route ospf 1
area 0.0.0.4
network 172.16.4.0 0.0.0.255
11.R10上配置
# 配置接口IP
interface GigabitEthernet0/0/0
ip address 172.16.4.66 255.255.255.192
#
interface LoopBack0
ip address 172.16.4.129 255.255.255.192
# 启动OSPF进程
ospf 1 router-id 10.10.10.10
area 0.0.0.4
network 172.16.4.0 0.0.0.255
12.R11上配置
# 配置接口IP
interface GigabitEthernet0/0/0
ip address 172.16.2.2 255.255.255.192
#
interface GigabitEthernet0/0/1
ip address 172.16.2.129 255.255.255.192
#
interface LoopBack0
ip address 172.16.2.65 255.255.255.192
# 启动OSPF进程
ospf 1 router-id 11.11.11.11
area 0.0.0.2
network 172.16.2.0 0.0.0.255
13.R12上配置
# 配置接口IP
interface GigabitEthernet0/0/0
ip address 172.16.2.130 255.255.255.192
#
interface LoopBack1
ip address 172.16.128.1 255.255.255.0
#
interface LoopBack2
ip address 172.16.129.1 255.255.255.0
# 启动OSPF进程
ospf 1 router-id 12.12.12.12
asbr-summary 172.16.128.0 255.255.192.0
import-route rip 1
area 0.0.0.2
network 172.16.2.0 0.0.0.255
nssa
# 启动RIP
rip 1
undo summary
version 2
network 172.16.0.0
import-route ospf 1
14.测试
R10pingR1
以上过程即为所求,欢迎同行朋友予以斧正!万分感谢!