一、拓扑
二、划分地址
172.16.0.0/16
172.16.0.0/19 a 0
172.16.32.0/19 a 1
172.16.64.0/19 a 2
172.16.96.0/19 a 3
172.16.128.0/19 a 4
172.16.160.0.19 a 5
宣告并配置缺省路由下放 使用NAT技术
[r3]ip route-static 0.0.0.0 0 34.1.1.2
[r3]ospf 100
[r3-ospf-100]default-route-advertise
[r3-ospf-100]qu
[r3]acl 2000
[r3-acl-basic-2000]rule permit source any
[r3-acl-basic-2000]q
[r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]nat outbound 2000
R5(中心站点)配置隧道和静态IP
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 172.16.0.1
[r5-Tunnel0/0/0]nhrp entry multicast dynamic
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]ip add 10.1.1.1 24
[r5-Tunnel0/0/0]q
[r5]ip route-static 172.16.8.0 21 172.16.0.2
[r5]ip route-static 172.16.16.0 21 172.16.0.2
[r5]ip route-static 172.16.24.0 21 172.16.0.2
R6(分支站点)的配置和静态IP
[r6]interface Tunnel 0/0/0
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source 172.16.8.1
[r6-Tunnel0/0/0]nhrp entry 10.1.1.1 172.16.0.1 register
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]ip add 10.1.1.2 24
[r6-Tunnel0/0/0]q
[r6]ip route-static 172.16.0.0 21 172.16.8.2
[r6]ip route-static 172.16.16.0 21 172.16.8.2
[r6]ip route-static 172.16.24.0 21 172.16.8.2
ospf宣告
[r5]ospf 110 router-id 5.5.5.5
[r5-ospf-110]area 0
[r5-ospf-110-area-0.0.0.0]net
[r5-ospf-110-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r5-ospf-110-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[r5-ospf-110-area-0.0.0.0]q
[r5-ospf-110]q
[r5]int Tunnel 0/0/0
[r5-Tunnel0/0/0]ospf network-type broadcast
重发布
[r14-ospf-110]import-route ospf 120
[r14-ospf-110]q
[r14]ospf 120
[r14-ospf-120]import-route ospf 110
VLINK
[r9]ospf 110
[r9-ospf-110]area 2
[r9-ospf-110-area-0.0.0.2]v
[r9-ospf-110-area-0.0.0.2]vlink-peer 7.7.7.7
R5使用NAT技术
[r5]ip route-static 0.0.0.0 0 45.1.1.1
[r5]ospf 110
[r5-ospf-110]default-route-advertise
[r5-ospf-110]q
[r5]acl 2000
[r5-acl-basic-2000]rule permit source any
[r5-acl-basic-2000]q
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]nat outbound 2000
[r5-GigabitEthernet0/0/0]q
[r5]interface Tunnel 0/0/1
[r5-Tunnel0/0/1]tunnel-protocol gre
[r5-Tunnel0/0/1]source 45.1.1.2
[r5-Tunnel0/0/1]description 34.1.1.1
[r5-Tunnel0/0/1]q
[r5]ip route-static 34.1.1.0 24 45.1.1.1