要求:
1、R6为ISP,只配置IP地址,R1-R5的环回为私有网段
2、R1/R4/R5为全连的MGRE结构,R1/R2/R3为星型的拓扑结构,R1为中心站点
3、所有私有网段可以互相通讯,私有网段使用OSPF完成
思路
1、给所有设备配置IP
R1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 16.0.0.1/24 up up
GigabitEthernet0/0/1 61.0.0.1/24 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 1.1.1.1/32 up up(s)
NULL0 unassigned up up(s)
R2
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 26.0.0.2/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 2.2.2.2/32 up up(s)
NULL0 unassigned up up(s)
R3
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 36.0.0.3/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 3.3.3.3/32 up up(s)
NULL0 unassigned up up(s)
R4
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 46.0.0.4/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 4.4.4.4/32 up up(s)
NULL0 unassigned up up(s)
R5
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 56.0.0.5/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 5.5.5.5/32 up up(s)
NULL0 unassigned up up(s)
R6
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 16.0.0.6/24 up up
GigabitEthernet0/0/1 61.0.0.6/24 up up
GigabitEthernet0/0/2 56.0.0.6/24 up up
GigabitEthernet2/0/0 26.0.0.6/24 up up
GigabitEthernet3/0/0 36.0.0.6/24 up up
GigabitEthernet4/0/0 46.0.0.6/24 up up
NULL0 unassigned up up(s)
2、给R1/R4/R5配置全连MGRE
分别在每个设备创建隧道
[r1]interface Tunnel 0/0/0
[r4]interface Tunnel 0/0/0
[r5]interface Tunnel 0/0/0
隧道内配置全连
R1配置
ip address 192.168.1.1 255.255.255.0
tunnel-protocol gre p2mp
source 16.0.0.1
nhrp entry multicast dynamic
R4配置
ip address 192.168.1.4 255.255.255.0
tunnel-protocol gre p2mp
source 46.0.0.4
nhrp entry multicast dynamic
nhrp entry 192.168.1.1 16.0.0.1 register
nhrp entry 192.168.1.5 56.0.0.5 register
R5配置
ip address 192.168.1.5 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
nhrp entry multicast dynamic
nhrp entry 192.168.1.1 16.0.0.1 register
nhrp entry 192.168.1.4 46.0.0.4 register
3、R1/R2/R3配置星型拓扑
分别在每个设备创建隧道
[r1]interface Tunnel 0/0/1
[r2]interface Tunnel 0/0/1
[r3]interface Tunnel 0/0/1
隧道内配置hub-spoken架构
R1
ip address 192.168.2.1 255.255.255.0
tunnel-protocol gre p2mp
source 61.0.0.1
nhrp entry multicast dynamic
R2
ip address 192.168.2.2 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
nhrp entry 192.168.2.1 61.0.0.1 register
R3
ip address 192.168.2.3 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
nhrp entry 192.168.2.1 61.0.0.1 register
4、配置全连接的OSPF
R1
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 16.0.0.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
[r1-Tunnel0/0/0]ospf network-type broadcast
R4
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 46.0.0.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 192.168.1.4 0.0.0.0
[r4-Tunnel0/0/0]ospf network-type broadcast
[r4-Tunnel0/0/0]ospf dr-priority 0
R5
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 56.0.0.5 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 192.168.1.5 0.0.0.0
[r5-Tunnel0/0/0]ospf network-type broadcast
5、配置星型拓扑的OSPF
R1
[r1]ospf 1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]network 61.0.0.1 0.0.0.0
[r1-ospf-1-area-0.0.0.1]network 192.168.2.1 0.0.0.0
[r1-Tunnel0/0/1]ospf network-type broadcast
R2
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 26.0.0.2 0.0.0.0
[r2-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[r2-ospf-1-area-0.0.0.1]network 192.168.2.2 0.0.0.0
[r2-Tunnel0/0/1]ospf network-type broadcast
R3
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 36.0.0.3 0.0.0.0
[r3-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.1]network 192.168.2.3 0.0.0.0
[r3-Tunnel0/0/1]ospf network-type broadcast