OSPF与GRE结合小实验
1、拿到实验首先思考、搭建拓扑,并进行IP地址的合理规划,由于实验中没有具体的要求所以我们的IP地址如图所示。R6扮演的是运营商,其余为私网.为每台路由器以及其接口配置ip,每台路由器都要写缺省路由吓一跳为r6的接口(以r1为例):
ip route-static 0.0.0.0 0.0.0.0 14.1.1.2
好的习惯是在配置完IP地址和简单路由后进行测试:
[r1]ping 25.1.1.1
PING 25.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 25.1.1.1: bytes=56 Sequence=1 ttl=254 time=10 ms
Reply from 25.1.1.1: bytes=56 Sequence=2 ttl=254 time=50 ms
Reply from 25.1.1.1: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 25.1.1.1: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 25.1.1.1: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 25.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/30/50 ms
2、对于R1、R4、R5:
R1创建tunnel口进行配置:
interface Tunnel0/0/0
ip address 10.1.1.1 255.255.255.0 //配置ip地址
tunnel-protocol gre p2mp //先修改接口模式为多点GRE
source 15.1.1.1 //再定义公有的源IP地址
ospf network-type broadcast //修改网络类型为广播
nhrp entry multicast dynamic //本地成为NHRP中心,同时可以进行伪广播
nhrp network-id 100 //默认为0号,该网段内所有节点tunnel接口必须为相同域
nhrp entry 10.1.1.2 45.1.1.1 register //到站点进行注册
nhrp entry 10.1.1.3 55.1.1.1 register //到站点进行注册
R4创建tunnel口进行配置:
ip address 10.1.1.2 255.255.255.0
tunnel-protocol gre p2mp
source 45.1.1.1
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 100
nhrp entry 10.1.1.1 15.1.1.1 register
nhrp entry 10.1.1.3 55.1.1.1 register
R5创建tunnel口进行配置:
ip address 10.1.1.3 255.255.255.0
tunnel-protocol gre p2mp
source 55.1.1.1
ospf network-type broadcast
nhrp entry multicast dynamic
nhrp network-id 100
nhrp entry 10.1.1.1 15.1.1.1 register
nhrp entry 10.1.1.2 45.1.1.1 register
注意:华为模拟器默认的接口网络类型默认接口工作方式为p2p,该工作方式仅允许建立一个邻居关系,导致在MGRE环境