1、对R1-R5配置IP地址,同时R1-R5每个路由器各有一个环回
2.1、对R1、R3、R4路由器开启虚拟接口1,分别配置隧道IP、接口封装协议,接口类型、定义封装源、开启伪广播功能,之后对分别对隧道接口、环回进行宣告。
2.2、对R1、R5、R6路由器开启虚拟接口2,以R1为hub路由器,R5、R6为spoke路由器,接着对R1配置隧道IP、接口封装协议、封装源以及开启伪广播功能,对R5、R6配置隧道IP,接口封装协议、封装源、分支向节点注册,最后对隧道IP以及环回进行宣告。
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip address 11.0.0.1 24
[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/1]ip address 10.0.0.1 24
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 1.1.1.1 24
[r1]ip route-static 0.0.0.0 0 10.0.0.2
[r1]ip route-static 0.0.0.0 0 11.0.0.2
[r1]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 11.0.0.1/24 up up
GigabitEthernet0/0/1 10.0.0.1/24 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 1.1.1.1/24 up up(s)
NULL0 unassigned up up(s)
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 11.0.0.2 24
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]ip address 10.0.0.2 24
[r2]interface GigabitEthernet 0/0/2
[r2-GigabitEthernet0/0/2]ip address 12.0.0.2 24
[r2]interface GigabitEthernet 2/0/0
[r2-GigabitEthernet2/0/0]ip address 13.0.0.2 24
[r2]interface GigabitEthernet 3/0/0
[r2-GigabitEthernet3/0/0]ip address 15.0.0.2 24
[r2]interface GigabitEthernet 4/0/0
[r2-GigabitEthernet4/0/0]ip address 14.0.0.2 24
[r2]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 11.0.0.2/24 up up
GigabitEthernet0/0/1 10.0.0.2/24 up up
GigabitEthernet0/0/2 12.0.0.2/24 up up
GigabitEthernet2/0/0 13.0.0.2/24 up up
GigabitEthernet3/0/0 15.0.0.2/24 up up
GigabitEthernet4/0/0 14.0.0.2/24 up up
NULL0 unassigned up up(s)
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 15.0.0.1 24
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 5.5.5.5 24
[r3]ip route-static 0.0.0.0 0 15.0.0.2
[r3]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 15.0.0.1/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 5.5.5.5/24 up up(s)
NULL0 unassigned up up(s)
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip address 14.0.0.1 24
[r4]interface LoopBack 0
[r4-LoopBack0]ip address 4.4.4.4 24
[r4]ip route-static 0.0.0.0 0 14.0.0.2
[r4]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 14.0.0.1/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 4.4.4.4/24 up up(s)
NULL0 unassigned up up(s)
[r5]interface GigabitEthernet 0/0/0
[r5-GigabitEthernet0/0/0]ip address 13.0.0.1 24
[r5]interface LoopBack 0
[r5-LoopBack0]ip address 3.3.3.3 24
[r5]ip route-static 0.0.0.0 0 13.0.0.2
[r5]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 13.0.0.1/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 3.3.3.3/24 up up(s)
NULL0 unassigned up up(s)
[r6]interface GigabitEthernet 0/0/0
[r6-GigabitEthernet0/0/0]ip address 12.0.0.1 24
[r6]interface LoopBack 0
[r6-LoopBack0]ip address 2.2.2.2 24
[r6]ip route-static 0.0.0.0 0 12.0.0.2
[r6]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.0.0.1/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 2.2.2.2/24 up up(s)
NULL0 unassigned up up(s)
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 192.168.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp ---修改接口封装协议为多点GRE
[r1-Tunnel0/0/0]source 10.0.0.1 ---定义封装源
[r1-Tunnel0/0/0]nhrp network-id 1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic ——开启伪广播功能
[r1-Tunnel0/0/0]ospf network-type broadcast ——修改接口类型为broadcast
[r1-Tunnel0/0/0]nhrp entry 192.168.1.2 14.0.0.1 register ——向节点注册
[r1-Tunnel0/0/0]nhrp entry 192.168.1.3 15.0.0.1 register——向节点注册
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 192.168.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp ---修改接口封装协议为多点GRE
[r3-Tunnel0/0/0]source 15.0.0.1 ---定义封装源
[r3-Tunnel0/0/0]nhrp network-id 1
[r3-Tunnel0/0/0]nhrp entry multicast dynamic ——开启伪广播功能
[r3-Tunnel0/0/0]ospf network-type broadcast ——修改接口类型为broadcast
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 192.168.1.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp ---修改接口封装协议为多点GRE
[r4-Tunnel0/0/0]source 14.0.0.1 ---定义封装源
[r4-Tunnel0/0/0]nhrp network-id 1
[r4-Tunnel0/0/0]nhrp entry multicast dynamic ——开启伪广播功能
[r4-Tunnel0/0/0]ospf network-type broadcast ——修改接口类型为broadcast
[r4-Tunnel0/0/0]nhrp entry 192.168.1.3 15.0.0.1 register——向节点注册
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 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 1.1.1.1 0.0.0.0
[r3]ospf 1 router-id 5.5.5.5
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 192.168.1.3 0.0.0.0[r3-ospf-1-area-0.0.0.0]network 5.5.5.5 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.1.2 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 192.168.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp ---修改接口封装协议为多点GRE
[r1-Tunnel0/0/1]source 11.0.0.1 ---定义封装源
[r1-Tunnel0/0/1]nhrp network-id 2
[r1-Tunnel0/0/1]nhrp entry multicast dynamic ——开启伪广播功能
[r1-Tunnel0/0/1]ospf network-type p2mp——修改接口类型为p2mp
[r5]interface Tunnel 0/0/1
[r5-Tunnel0/0/1]ip address 192.168.2.3 24
[r5-Tunnel0/0/1]tunnel-protocol gre p2mp ---修改接口封装协议为多点GRE
[r5-Tunnel0/0/1]source GigabitEthernet 0/0/0 ---定义封装源
[r5-Tunnel0/0/1]nhrp network-id 2
[r5-Tunnel0/0/1]nhrp entry 192.168.2.1 11.0.0.1 register ---分支向中心节点注册
[r5-Tunnel0/0/1]ospf network-type p2mp——修改接口类型为p2mp
[r6]interface Tunnel 0/0/1
[r6-Tunnel0/0/1]ip address 192.168.2.2 24
[r6-Tunnel0/0/1]tunnel-protocol gre p2mp ---修改接口封装协议为多点GRE
[r6-Tunnel0/0/1]source GigabitEthernet 0/0/0 ---定义封装源
[r6-Tunnel0/0/1]nhrp network-id 2
[r6-Tunnel0/0/1]nhrp entry 192.168.2.1 11.0.0.1 register ---分支向中心节点注册
[r6-Tunnel0/0/1]ospf network-type p2mp——修改接口类型为p2mp
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.2.1 0.0.0.0
[r5]ospf 1 router-id 3.3.3.3
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 192.168.2.3 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r6]ospf 1 router-id 2.2.2.2
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 192.168.2.2 0.0.0.0
[r6-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0