实验拓扑
实验要求
- 按照图示配置IP地址
- 配置静态路由协议,搞通公网
- 配置MGRE VPN
- NHRP的配置
- 配置RIP路由协议来传递两端私网路由
- 测试全网通
实验配置
1、配置IP地址
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 15.0.0.1 24
[R1]int LoopBack 0
[R1-LoopBack0]ip address 192.168.1.1 24
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add
[R2-GigabitEthernet0/0/0]ip address 25.0.0.2 24
[R2]int LoopBack 0
[R2-LoopBack0]ip address 192.168.2.2 24
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 35.0.0.3 24
[R3-GigabitEthernet0/0/0]int l0
[R3-LoopBack0]ip address 192.168.3.3 24
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.0.0.4 24
[R4-GigabitEthernet0/0/0]int l0
[R4-LoopBack0]ip add 192.168.4.4 24
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip add 15.0.0.5 24
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip add 25.0.0.5 24
[R5-GigabitEthernet0/0/1]int g0/0/2
[R5-GigabitEthernet0/0/2]ip add 45.0.0.5 24
[R5-GigabitEthernet0/0/2]int g4/0/0
[R5-GigabitEthernet4/0/0]ip add 35.0.0.5 24
2、配置静态路由,搞通公网
[R1]ip route-static 0.0.0.0 0 15.0.0.5
[R2]ip route-static 0.0.0.0 0 25.0.0.5
[R3]ip route-static 0.0.0.0 0 35.0.0.5
[R4]ip route-static 0.0.0.0 0 45.0.0.5
3、配置总部与分部之间的隧道-MGRE VPN
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip add 192.168.5.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 15.0.0.1
[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]ip add 192.168.5.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]source 25.0.0.2
[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip add 192.168.5.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 35.0.0.3
[R4]int Tunnel 0/0/0
[R4-Tunnel0/0/0]ip address 192.168.5.4 24
[R4-Tunnel0/0/0]tunnel-protocol gre p2mp
[R4-Tunnel0/0/0]source 45.0.0.4
4、NHRP的配置
中心站点配置:
创建NHRP域
[R1-Tunnel0/0/0]nhrp network-id 100
分支站点配置:
[R2]int Tunnel 0/0/0
//分支加入中心站点域100
[R2-Tunnel0/0/0]nhrp network-id 100
// 分支找中心注册自己的信息
[R2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
[R4]int Tunnel 0/0/0
[R4-Tunnel0/0/0]nhrp network-id 100
[R4-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
测试:查看中心站点NHRP表
5、配置RIP路由协议来传递两端私网路由
[R1]rip 1
[R1-rip-1]undo summary
[R1-rip-1]version 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 192.168.5.0
[R2]rip 1
[R2-rip-1]undo summary
[R2-rip-1]version 2
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 192.168.5.0
[R3]rip 1
[R3-rip-1]undo summary
[R3-rip-1]version 2
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 192.168.5.0
[R4]rip 1
[R4-rip-1]undo summary
[R4-rip-1]version 2
[R4-rip-1]network 192.168.4.0
[R4-rip-1]network 192.168.5.0
查看各个设备的RIP路由表学习情况,会发现只有中心站点学习到了分支站点的网段,而分支站点没有学习到任何其他站点的网点。
解决方法:
在中心上开启伪广播,目的:告诉分支站点,中心站点及其他分支站点的私网网段信息,
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
此时新的问题出现,分支站点并没有像预想的那样获得完整网段信息,这跟RIP的水平分割机制有关。
解决方法:关闭RIP的水平分割机制
[R1-Tunnel0/0/0]undo rip split-horizon
[R2-Tunnel0/0/0]undo rip split-horizon
[R3-Tunnel0/0/0]undo rip split-horizon
[R4-Tunnel0/0/0]undo rip split-horizon
测试:查看分支站点的RIP路由表学习情况