实验规划
实验拓扑图如下:
- 拓扑设计与要求:
(1)R2为ISP,只能配置IP地址
(2)R1,R3,R4之间建立MGRE环境
(3)R1,R3,R4的tunnel之间建立EIGRP环境(公网所在R2与其他路由器的直连接口不能在EIGRP环境内) - 配置ip地址
- IP地址配置完后,配置ISP环境:
R1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2
R3(config)#ip route 0.0.0.0 0.0.0.0 23.1.1.2
R4(config)#ip route 0.0.0.0 0.0.0.0 24.1.1.2 - 配置MGRE
R1为中心站点,R3、R4为分支站点
配置完成后在R1,R3和R4上分别看邻居,发现R3,R4上有R1的邻居,而R1没有R3和R4的邻居
原因:R1(config-if)#ip nhrp map multicast dynamic 在中心站点定义本地成为NHRP的sever时;Multicast 让本设备在目标地址为组播或广播,将流量基于表中所有的目标单独发送一次;故R3和R4有R1的邻居,R1没有R3和R4的邻居。
分支节点可以以组播或广播为目标IP地址时,那么需要定义流量的具体目标
解决办法
R3(config-if)#ip nhrp map multicast 12.1.1.1
R4(config-if)#ip nhrp map multicast 12.1.1.1 - 建立EIGRP环境
此时R1拥有R3,R4上的路由,在R3和R4上查看却没有彼此环回接口的路由信息。
原因:在R1上存在水平分割
解决方法:进入tunnel接口,关闭水平分割
no ip split-horizon eigrp 100 - 测试
具体配置如下
- R1
interface Loopback0
ip address 1.1.1.1 255.255.255.255
MGRE环境 R1为中心站点
interface Tunnel0
ip address 192.168.1.1 255.255.255.0
no ip redirects
no ip split-horizon eigrp 100
ip nhrp map multicast dynamic
ip nhrp network-id 100
tunnel source 12.1.1.1
tunnel mode gre multipoint
interface Serial1/1
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
router eigrp 100
network 1.0.0.0
network 192.168.1.0
ip route 0.0.0.0 0.0.0.0 Serial1/1
ip route 0.0.0.0 0.0.0.0 12.1.1.2
- R2
interface Loopback0
ip address 2.2.2.2 255.255.255.255
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
serial restart-delay 0
interface Serial1/1
ip address 23.1.1.2 255.255.255.0
serial restart-delay 0
interface Serial1/2
ip address 24.1.1.2 255.255.255.0
serial restart-delay 0
- R3
interface Loopback0
ip address 3.3.3.3 255.255.255.255
配置MGRE,R3为分支站点
interface Tunnel0
ip address 192.168.1.3 255.255.255.0
no ip redirects
ip nhrp map 192.168.1.1 12.1.1.1
ip nhrp map multicast 12.1.1.1
ip nhrp network-id 100
ip nhrp nhs 192.168.1.1
tunnel source Serial1/0
tunnel mode gre multipoint
interface Serial1/0
ip address 23.1.1.3 255.255.255.0
serial restart-delay 0
router eigrp 100
network 3.0.0.0
network 192.168.1.0
ip route 0.0.0.0 0.0.0.0 23.1.1.2
- R4
interface Loopback0
ip address 4.4.4.4 255.255.255.255
配置MGRE,R4为分支站点
interface Tunnel0
ip address 192.168.1.4 255.255.255.0
no ip redirects
ip nhrp map 192.168.1.1 12.1.1.1
ip nhrp map multicast 12.1.1.1
ip nhrp network-id 100
ip nhrp nhs 192.168.1.1
tunnel source Serial1/2
tunnel mode gre multipoint
interface Serial1/2
ip address 24.1.1.4 255.255.255.0
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
router eigrp 100
network 4.0.0.0
network 192.168.1.0
ip route 0.0.0.0 0.0.0.0 24.1.1.2
测试
- 查看R1路由表
- 查看R3路由表
- 查看R4路由表
验证全网可达性: - R1
- R3
- R4