拓扑搭建
一、配置路由器ip
R1:
g0/0/1:116.0.0.1 24
g0/0/0:16.0.0.1 24
缺省路由:
lookback0:192.168.1.1 24
R2:
g0/0/0: 26.0.0.1 24
缺省路由:
lookback0:192.168.2.1 24
R3:
g0/0/0:36.0.0.1 24
缺省路由:
lookback0:192.168.3.1 24
R4:
g0/0/0:46.0.0.1 24
缺省路由:
lookback0:192.168.4.1 24
R5:
g0/0/0: 56.0.0.1 24
缺省路由:
lookback0:192.168.5.1 24
ISP(R6):
g0/0/0: 16.0.0.2 24
g0/0/1: 116.0.0.2 24
g0/0/2: 56.0.0.2 24
g2/0/0: 26.0.0.2 24
g3/0/0: 36.0.0.2 24
g4/0/0: 46.0.0.2 24
配置好上述i端口ip后,在相关路由下敲一以命令
R1:
ip route-static 0.0.0.0 0 16.0.0.2
ip route-static 0.0.0.0 0 116.0.0.2
R2:
ip route-static 0.0.0.0 0 26.0.0.2
R3:
ip route-static 0.0.0.0 0 36.0.0.2
R4:
ip route-static 0.0.0.0 0 46.0.0.2
R5:
ip route-static 0.0.0.0 0 56.0.0.2
二、实现R1、R4、R5为全连的mgre结构,R1、R2、R3为星型的拓扑结构其中R1为中心站点。
1.实现R1、R4、R5为全连的mgre结构
R1:
int t0/0/1
ip address 192.168.7.1 24
tunnel-protocol gre p2mp
source 116.0.0.1
nhrp network-id 110
nhrp entry multicast dynamic
nhrp entry network 192.168.7.2 46.0.0.1 register
nhrp entry network 192.168.7.3 56.0.0.1 register
R4:
int t0/0/0
ip address 192.168.7.2 24
tunnel-protocol gre p2mp
source 46.0.0.1
nhrp network-id 110
nhrp entry multicast dynamic
nhrp entry network 192.168.7.1 116.0.0.1 register
nhrp entry network 192.168.7.3 56.0.0.1 register
R5:
int t0/0/0
ip address 192.168.7.3 24
tunnel-protocol gre p2mp
source 56.0.0.1
nhrp network-id 110
nhrp entry multicast dynamic
nhrp entry network 192.168.7.1 116.0.0.1 register
nhrp entry network 192.168.7.2 46.0.0.1 register
上述代码结果如下
2、R1、R2、R3为星型的拓扑结构其中R1为中心站点。
R1:
进入隧道端口:
int t0/0/0
配置ip:
ip address 192.168.6.1 24
定义封装类型:
tunnel-protocol gre p2mp
中心源端口地址
source 16.0.0.1
加入名为100的域
nhrp network-id 100
进行伪广播
nhrp entry multicast dynamic
R2:
int t0/0/0
ip address 192.168.6.2 24
tunnel-protocol gre p2mp
source g 0/0/0(由于分支地址不固定,因此直接标记端口号,R3同理)
nhrp network-id 100
R3:
int t0/0/0
ip address 192.168.6.3 24
tunnel-protocol gre p2mp
source g 0/0/0
nhrp network-id 100
上述代码结果如下
3.配置ospf的相关命令
R1:
ospf 1 router-id 1.1.1.1
area 0
network 192.168.1.0 0.0.0.255
network 192.168.6.0 0.0.0.255
network 192.168.7.0 0.0.0.255
R2:
ospf 1 router-id 2.2.2.2
area 0
network 192.168.2.0 0.0.0.255
network 192.168.6.0 0.0.0.255
R3:
ospf 1 router-id 3.3.3.3
area 0
network 192.168.3.0 0.0.0.255
network 192.168.6.0 0.0.0.255
R4:
ospf 1 router-id 4.4.4.4
area 0
network 192.168.4.0 0.0.0.255
network 192.168.7.0 0.0.0.255
R5:
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
由于本题中的星状结构与mgre结构要求不同,因此要改变相应端口的封装类型
进入相应隧道端口,修改封装类型:
R1:
int t 0/0/0
ospf network-type p2mp
R2、R3:
int t 0/0/0
ospf network-type p2mp
R1:
int t 0/0/1
ospf network-type broadcast
R4、R5:
int t 0/0/0
ospf network-type broadcast
上述代码在各个路由器上结果如下
R1
R2
R3
R4
R5
标签:24,network,0.1,0.0,192.168,实验,MGRE,OSPF,R1 From: https://www.cnblogs.com/miracle01/p/17027380.html