先划分ip地址
先配置ip地址
配置指向r6的缺省路由通公网并测试
[r1]ip route-static 0.0.0.0 0.0.0.0 15.1.1.2
[r1]ip route-static 0.0.0.0 0.0.0.0 65.1.1.2
[r2]ip route-static 0.0.0.0 0.0.0.0 25.1.1.2
[r3]ip route-static 0.0.0.0 0.0.0.0 35.1.1.2
[r4]ip route-static 0.0.0.0 0.0.0.0 45.1.1.2
[r5]ip route-static 0.0.0.0 0.0.0.0 55.1.1.2
R1/4/5为全连的MGRE结构,R1为中心
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 255.255.255.0
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 65.1.1.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 10.1.1.2 255.255.255.0
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source Serial 4/0/0
[r4-Tunnel0/0/0]nhrp network-id 100
[r4-Tunnel0/0/0]nhrp entry 10.1.1.1 65.1.1.1 register
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 10.1.1.3 255.255.255.0
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source Serial 4/0/0
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 10.1.1.1 65.1.1.1 register
R1/2/3为星型拓扑结构,R1为中心
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 11.1.1.1 255.255.255.0
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 15.1.1.1
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
[r1-Tunnel0/0/1]nhrp network-id 101
[r1-Tunnel0/0/1]ospf network-type broadcast
[r2]interface Tunnel 0/0/1
[r2-Tunnel0/0/1]ip address 11.1.1.2 255.255.255.0
[r2-Tunnel0/0/1]tunnel-protocol gre p2mp
[r2-Tunnel0/0/1]source Serial 4/0/0
[r2-Tunnel0/0/1]nhrp network-id 101
[r2-Tunnel0/0/1]nhrp entry 11.1.1.1 15.1.1.1 register
[r2-Tunnel0/0/1]ospf network-type broadcast
[r2-Tunnel0/0/1]ospf dr-priority 0
[r3]interface Tunnel 0/0/1
[r3-Tunnel0/0/1]ip address 11.1.1.3 255.255.255.0
[r3-Tunnel0/0/1]tunnel-protocol gre p2mp
[r3-Tunnel0/0/1]source Serial 4/0/0
[r3-Tunnel0/0/1]nhrp network-id 101
[r3-Tunnel0/0/1]nhrp entry 11.1.1.1 15.1.1.1 register
[r3-Tunnel0/0/1]ospf network-type broadcast
[r3-Tunnel0/0/1]ospf dr-priority 0
私网使用ospf协议实现互相通讯
[r1]ospf 1 router-id 192.168.1.1
[r1-ospf-1]default-route-advertise always
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]abr-summary 10.1.1.0 255.255.255.0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]abr-summary 11.1.1.0 255.255.255.0
[r1-ospf-1-area-0.0.0.1]network 11.1.1.1 0.0.0.0
[r2]ospf 1 router-id 192.168.2.1
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 192.168.2.1 0.0.0.0
[r2-ospf-1-area-0.0.0.1]network 11.1.1.2 0.0.0.0
[r3]ospf 1 router-id 192.168.3.1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 192.168.3.1 0.0.0.0
[r3-ospf-1-area-0.0.0.1]network 11.1.1.3 0.0.0.0
[r4]ospf 1 router-id 192.168.4.1
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 192.168.4.1 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 10.1.1.2 0.0.0.0
[r5]ospf 1 router-id 192.168.5.1
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 192.168.5.1 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 10.1.1.3 0.0.0.0
配置完成后R1/4/5中R5被孤立,将R4/5物理接口优先级改为0,并重启R1/4/5的ospf
[r5]interface Serial 4/0/0
[r5-Serial4/0/0]ospf dr-priority 0
[r4]int s4/0/0
[r4-Serial4/0/0]ospf dr-priority 0
reset ospf process
reset ospf process
reset ospf process
测试