1.搭建拓扑
2.配置IP
R14:
[r14]ip route-static 0.0.0.0 0 145.1.1.2
[r14]acl 2000
[r14-acl-basic-2000]rule permit source any
[r14]int GigabitEthernet 0/0/1
[r14-GigabitEthernet0/0/1]nat outbound 2000
[r14]int Tunnel 0/0/0
[r14-Tunnel0/0/0]ip address 10.1.1.1 24
[r14-Tunnel0/0/0]tunnel-protocol gre
[r14-Tunnel0/0/0]source 145.1.1.1
[r14-Tunnel0/0/0]destination 115.1.1.1
[r14]ospf 1 router-id 14.14.14.14
[r14-ospf-1]area 0
[r14-ospf-1-area-0.0.0.0]network 135.1.1.0 0.0.0.255
[r14-ospf-1-area-0.0.0.0]network 14.14.14.14 0.0.0.0
[r14-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r14-ospf-1]default-route-advertise always
R2:
[r2-ospf-100-area-0.0.0.0]display this
[V200R003C00]
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 11.1.1.0 0.0.0.255
network 12.1.1.2 0.0.0.0
return
[r2-Tunnel0/0/0]display this
[V200R003C00]
interface Tunnel0/0/0
ip address 11.1.1.1 255.255.255.0
tunnel-protocol gre p2mp
source 20.1.1.1
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 100
实验结果测试: