一、配置IP地址
R1
[r1-GigabitEthernet0/0/0]ip address 12.0.0.1 24
[r1-GigabitEthernet0/0/1]ip address 22.0.0.1 24回环地址:[r1-LoopBack0]ip address 192.168.1.1 24
缺省:[r1]ip route-static 0.0.0.0 0 12.0.0.2
[r1]ip route-static 0.0.0.0 0 22.0.0.2
R3[r3-GigabitEthernet0/0/0]ip address 32.0.0.1 24
回环地址:[r3-LoopBack0]ip address 192.168.2.1 24
缺省:[r3]ip route-static 0.0.0.0 0 32.0.0.2、
R4
[r4-GigabitEthernet0/0/0]ip address 42.0.0.1 24
回环地址:[r4-LoopBack0]ip address 192.168.3.1 24缺省:[r4]ip route-static 0.0.0.0 0 42.0.0.2
R5
[r5-GigabitEthernet0/0/0]ip address 52.0.0.1 24
回环地址:[r5-LoopBack0]ip address 192.168.4.1 24
缺省:[r5]ip route-static 0.0.0.0 0 52.0.0.2
R6
[r6-GigabitEthernet0/0/0]ip address 65.0.0.1 25
回环地址:[r6-LoopBack0]ip address 192.168.5.1 24
缺省:[r6]ip route-static 0.0.0.0 0 62.0.0.2ISP
[isp-GigabitEthernet0/0/0]ip address 12.0.0.2 24
[isp-GigabitEthernet0/0/1]ip address 22.0.0.2 24
[isp-GigabitEthernet0/0/2]ip address 32.0.0.2 24
[isp-GigabitEthernet4/0/0]ip address 42.0.0.2 24[isp-GigabitEthernet4/0/1]ip address 52.0.0.2 24
[isp-GigabitEthernet4/0/2]ip address 62.0.0.2 24
回环地址:[isp-LoopBack0]ip address 100.0.0.1 24
二、R1-R5-R6建立hub-spoke的MGRE环境,其中R1为中心
R1
[r1-Tunnel0/0/0]ip address 192.168.6.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 12.0.0.1
[r1-Tunnel0/0/0]nhrp network-id 100R5
[r5-Tunnel0/0/0]ip address 192.168.6.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 192.168.6.1 12.0.0.1 registerR6
[r6-Tunnel0/0/0]ip address 192.168.6.3 24
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]nhrp entry 192.168.6.1 12.0.0.1 register
三、建立全连的MGRE环境
R1
[r1-Tunnel0/0/1]ip address 192.168.7.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 22.0.0.1
[r1-Tunnel0/0/1]nhrp network-id 200[r1-Tunnel0/0/1]nhrp entry 192.168.7.2 32.0.0.1 register
[r1-Tunnel0/0/1]nhrp entry 192.168.7.3 42.0.0.1 registerR3
[r3-Tunnel0/0/1]ip address 192.168.7.2 24
[r3-Tunnel0/0/1]tunnel-protocol gre p2mp
[r3-Tunnel0/0/1]source g0/0/0
[r3-Tunnel0/0/1]nhrp network-id 200
[r3-Tunnel0/0/1]nhrp entry 192.168.7.3 42.0.0.1 register
[r3-Tunnel0/0/1]nhrp entry 192.168.7.1 22.0.0.1 register
R4[r4-Tunnel0/0/1]ip address 192.168.7.3 24
[r4-Tunnel0/0/1]tunnel-protocol gre p2mp
[r4-Tunnel0/0/1]source g0/0/0
[r4-Tunnel0/0/1]nhrp network-id 200
[r4-Tunnel0/0/1]nhrp entry 192.168.7.1 22.0.0.1 register
[r4-Tunnel0/0/1]nhrp entry 192.168.7.2 32.0.0.1 register
四、验证
![]()