1、R6为ISP只能配置ip地址,R1-5的环回为私有网段
2、R1/4/5为全连的MGRE结构,R1/2/3为星型的拓扑结构,R1为中心站点
3、所有私有网段可以互相通讯,私有网段使用OSPF协议完成
分析:
1、配置IP
2、在R1-R5上都配一条缺省路由让全网可通
[R1]ip route-static 0.0.0.0 0 16.1.1.1
[R1]ip route-static 0.0.0.0 0 16.2.1.1
[R2]ip route-static 0.0.0.0 0 26.1.1.1
[R3]ip route-static 0.0.0.0 0 36.1.1.1
[R4]ip route-static 0.0.0.0 0 46.1.1.1
[R5]ip route-static 0.0.0.0 0 56.1.1.1
测试连通性:
3.在R1/4/5配置全连MGRE结构,R1为中心站点。
主:
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 16.1.1.2
[R1-Tunnel0/0/0]nhrp network-id 100
[R1-Tunnel0/0/0]nhrp entry 10.1.1.2 46.1.1.2 register
[R1-Tunnel0/0/0]nhrp entry 10.1.1.3 56.1.1.2 register
分支1:
[R4]int Tunnel 0/0/0
[R4-Tunnel0/0/0]ip address 10.1.1.2 24
[R4-Tunnel0/0/0]tunnel-protocol gre p2mp
[R4-Tunnel0/0/0]source 46.1.1.2
[R4-Tunnel0/0/0]nhrp network-id 100
[R4-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.2 register
[R4-Tunnel0/0/0]nhrp entry 10.1.1.3 56.1.1.2 register
分支 2:
[R5]interface Tunnel 0/0/0
[R5-Tunnel0/0/0]ip address 10.1.1.3 24
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source 56.1.1.2
[R5-Tunnel0/0/0]nhrp network-id 100
[R5-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.2 register
[R5-Tunnel0/0/0]nhrp entry 10.1.1.2 46.1.1.2 register
因为要全连所以把协议类型都改成broadcast
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ospf network-type broadcast
[R4]int Tunnel 0/0/0
[R4-Tunnel0/0/0]ospf network-type broadcast
[R5]int Tunnel 0/0/0
[R5-Tunnel0/0/0]ospf network-type broadcast
4、R1/2/3为星型的拓扑结构,R1为中心站点。
主:
[R1]int Tunnel 0/0/1
[R1-Tunnel0/0/1]ip address 10.2.1.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp
[R1-Tunnel0/0/1]source 16.2.1.2
[R1-Tunnel0/0/1]nhrp entry multicast dynamic
[R1-Tunnel0/0/1]nhrp network-id 100
分支1:
[R2]int Tunnel 0/0/1
[R2-Tunnel0/0/1]ip address 10.2.1.2 24
[R2-Tunnel0/0/1]tunnel-protocol gre p2mp
[R2-Tunnel0/0/1]source g0/0/0
[R2-Tunnel0/0/1]nhrp network-id 100
[R2-Tunnel0/0/1]nhrp entry 10.2.1.1 16.2.1.2 register
分支2:
R3]int Tunnel 0/0/1
[R3-Tunnel0/0/1]ip address 10.2.1.3 24
[R3-Tunnel0/0/1]tunnel-protocol gre p2mp
[R3-Tunnel0/0/1]source g0/0/0
[R3-Tunnel0/0/1]nhrp network-id 100
[R3-Tunnel0/0/1]nhrp entry 10.2.1.1 16.2.1.2 register
因为是星型拓扑结构所以,要改类型同时要关闭DR选举
[R2]int Tunnel 0/0/1
[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]ospf network-type broadcast
[R3-Tunnel0/0/1]ospf dr-priority 0
5、配置OSPF进行全网互通
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[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 192.168.1.0 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 10.2.1.1 0.0.0.0
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.1.1.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 10.2.1.2 0.0.0.0
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 192.168.2.1 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 10.2.1.3 0.0.0.0
[R4]ospf 1 router-id 4.4.4.4
[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 5.5.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 10.1.1.3 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 192.168.5.1 0.0.0.0
测试: