一、拓扑
二、area 0进行ospf 1宣告
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 0.0.0.0 255.255.255.255
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]a 0
[r2-ospf-1-area-0.0.0.0]network 0.0.0.0 255.255.255.25
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]a 0
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 123.1.1.3 0.0.0.0
在OSPF 1区域的R3写缺省去ISP,并且让其它路由拿到缺省,下放缺省,允许所有流量通过(使用NAT技术)
[r3]ip route-static 0.0.0.0 0 34.1.1.2
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]default-route-advertise
[r3]acl 2000
[r3-acl-basic-2000]rule permit source any
[r3-GigabitEthernet0/0/1]nat outbound 2000
标题OSPF 100区域进行宣告
[r5]ospf 100 router-id 5.5.5.5
[r5-ospf-100]a 0
[r5-ospf-100-area-0.0.0.0]network 45.1.1.2 0.0.0.0
[r5-ospf-100-area-0.0.0.0]network 56.1.1.1 0.0.0.0
[r5-ospf-100-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[r6]ospf 100 router-id 6.6.6.6
[r6-ospf-100]a 0
[r6-ospf-100-area-0.0.0.0]network 56.1.1.2 0.0.0.0
[r6-ospf-100-area-0.0.0.0]network 6.6.6.6 0.0.0.0
[r8]ospf 100 router-id 8.8.8.8
[r8-ospf-100-area-0.0.0.0]a 3
[r8-ospf-100-area-0.0.0.3]network 8.8.8.8 0.0.0.0
[r8-ospf-100-area-0.0.0.3]network 89.1.1.1 0.0.0.0
[r9]ospf 100 router-id 9.9.9.9
[r9-ospf-100]a 3
[r9-ospf-100-area-0.0.0.3]network 0.0.0.0 255.255.255.255
[r10]ospf 100 router-id 10.10.10.10
[r10-ospf-100]a 0
[r10-ospf-100-area-0.0.0.0]network 0.0.0.0 255.255.255.255
[r11]ospf 100 router-id 11.11.11.11
[r11-ospf-100]a 0
[r11-ospf-100-area-0.0.0.0]network 11.11.11.11 0.0.0.0
[r11-ospf-100-area-0.0.0.0]network 111.1.1.1 0.0.0.0
[r12]ospf 100 router-id 12.12.12.12
[r12-ospf-100]a 1
[r12-ospf-100-area-0.0.0.1]network 12.12.12.12 0.0.0.0
[r12-ospf-100-area-0.0.0.1]network23.1.1.1 0.0.0.0
[r12-ospf-100-area-0.0.0.1]network 23.1.1.1 0.0.0.0
[r13]ospf 100 router-id 13.13.13.13
[r13-ospf-100]a 1
[r13-ospf-100-area-0.0.0.1]network 23.1.1.2 0.0.0.0
[r13-ospf-100-area-0.0.0.1]network 13.13.13.13 0.0.0.0
[r13-ospf-100-area-0.0.0.1]area 2
[r13-ospf-100-area-0.0.0.2]network 134.1.1.1 0.0.0.0
[r14]ospf 100 router-id 14.14.14.14
[r14-ospf-100]a 2
[r14-ospf-100-area-0.0.0.2]network 0.0.0.0 255.255.255.255
创建tun隧道,并且宣告隧道,引流
[r6]interface Tunnel 0/0/0
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source 67.1.1.1
[r6-Tunnel0/0/0]nhrp entry multicast dynamic
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]ip address 10.1.1.1 24
[r6]ospf 100
[r6-ospf-100]a 0
[r6-ospf-100-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r6-ospf-100-area-0.0.0.0]q
[r6-ospf-100]q
[r6]ip route-static 78.1.1.0 24 67.1.1.2
[r6]ip route-static 17.1.1.0 24 67.1.1.2
[r6]ip route-static 72.1.1.0 24 67.1.1.2
开启ospf
[r7-Tunnel0/0/0]ospf network-type broadcast