一丶实验要求
1. R1-R3-R4构建全连的MGRE环境
2. R1-R5-R6建立hub-spoke的MGRE环境,其中R1为中心
3. R1-R3...R6均存在环回网段模拟用户私网,使用OSPF使全网可达
4. 其中R2为ISP路由器,仅配置IP地址
二丶IP规划
如下图
三丶底层IP配置
以r1 g0/0/0接口为例,配置各个路由接口
[r1]inter
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip rtou
[r1-GigabitEthernet0/0/0]ip add
[r1-GigabitEthernet0/0/0]ip address 12.0.0.1 24
ISP
interface GigabitEthernet0/0/0
ip address 12.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 21.0.0.2 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 23.0.0.2 255.255.255.0
#
interface GigabitEthernet4/0/0
ip address 24.0.0.2 255.255.255.0
#
interface GigabitEthernet4/0/1
ip address 25.0.0.2 255.255.255.0
#
interface GigabitEthernet4/0/2
ip address 26.0.0.2 255.255.255.0
四丶R1-R3-R4构建全连的MGRE环境
R1
interface Tunnel0/0/0
ip address 192.168.2.1 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/1
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 100
nhrp entry 192.168.2.3 23.0.0.1 register
R3
interface Tunnel0/0/0
ip address 192.168.2.3 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 100
nhrp entry 192.168.2.4 24.0.0.1 register
R4
interface Tunnel0/0/0
ip address 192.168.2.4 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 100
nhrp entry 192.168.2.1 21.0.0.1 register
五丶R1-R5-R6建立hub-spoke的MGRE环境,其中R1为中心
R1
interface Tunnel0/0/1
ip address 192.168.7.1 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type p2mp
nhrp entry multicast dynamic
nhrp network-id 100
R5
interface Tunnel0/0/0
ip address 192.168.7.2 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type p2mp
nhrp entry 192.168.7.1 12.0.0.1 register
R6
interface Tunnel0/0/0
ip address 192.168.7.3 255.255.255.0
tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
ospf network-type p2mp
nhrp entry 192.168.7.1 12.0.0.1 register
六丶R1-R3...R6均存在环回网段模拟用户私网,使用OSPF使全网可达
R1
ip route-static 0.0.0.0 0.0.0.0 12.0.0.2
ip route-static 0.0.0.0 0.0.0.0 21.0.0.2
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
network 192.168.7.0 0.0.0.255
R3
ip route-static 0.0.0.0 0.0.0.0 23.0.0.2
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 192.168.2.0 0.0.0.255
network 192.168.3.0 0.0.0.255
R4
ip route-static 0.0.0.0 0.0.0.0 24.0.0.2
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 192.168.2.0 0.0.0.255
network 192.168.4.0 0.0.0.255
R5
ip route-static 0.0.0.0 0.0.0.0 25.0.0.2
ospf 1 router-id 5.5.5.5
area 0
network 192.168.5.0 0.0.0.255
network 192.168.7.0 0.0.0.255
R6
ip route-static 0.0.0.0 0.0.0.0 26.0.0.2
ospf 1 router-id 6.6.6.6
area 0
network 192.168.6.0 0.0.0.255
network 192.168.7.0 0.0.0.255