1.首先配ip
[r6]int g 0/0/1
[r6-GigabitEthernet0/0/1]ip add 192.168.1.2 24
[r6-GigabitEthernet0/0/1]int g 0/0/0
[r6-GigabitEthernet0/0/0]ip add 192.168.2.2 24
[r6-GigabitEthernet0/0/0]int g 0/0/2
[r6-GigabitEthernet0/0/2]ip add 192.168.3.2 24
[r6-GigabitEthernet0/0/2]int g 1/0/0
[r6-GigabitEthernet1/0/0]ip add 192.168.4.2 24
[r6-GigabitEthernet1/0/0]int g 2/0/0
[r6-GigabitEthernet2/0/0]ip add 192.168.5.2 24
[r6-GigabitEthernet2/0/0]int g 3/0/0
[r6-GigabitEthernet3/0/0]ip add 192.168.6.2 24
[r6-GigabitEthernet3/0/0]int l 0
[r6-LoopBack0]ip add 6.6.6.6 24
其他同理
2.配置缺省建立公网基础
[r2]ip route-static 0.0.0.0 0 192.168.3.2
其他同理
3.nhrp
[r1]int t 0/0/0
[r1-Tunnel0/0/0]ip add 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 192.168.2.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
[r2]int t 0/0/0
[r2-Tunnel0/0/0]ip add 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 192.168.2.1 register
R3同理
[r1]int t 0/0/1
[r1-Tunnel0/0/1]ip add 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 192.168.1.1
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
[r4]int t 0/0/0
[r4-Tunnel0/0/0]ip add 10.1.2.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r4-Tunnel0/0/0]nhrp entry 10.1.2.1 192.168.1.1 r
[r4-Tunnel0/0/0]nhrp entry 10.1.2.1 192.168.1.1 register
[r4-Tunnel0/0/0]nhrp entry 10.1.2.3 192.168.6.1 register
[r5]int t 0/0/0
[r5-Tunnel0/0/0]ip add 10.1.2.3 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 192.168.6.1
[r5-Tunnel0/0/0]nhrp entry 10.1.2.1 192.168.1.1 register
4.配置ospf
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 10.1.2.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
其他同理
5.改类型选DR
r1,r2,r3的T0/0/0 接口类型全改成broadcast
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ospf network-type broadcast
r2和r3放弃选DR
[r3-Tunnel0/0/0]ospf dr-priority 0
其他同理
[r1]int t 0/0/1
[r1-Tunnel0/0/1]ospf network-type broadcast
r1,r4,r5同理更改类型为broadcast
记得在R4,R5上开启伪广播
nhrp entry multicast dynamic
这时候就可以全网通了