https://www.rfyy.net/archives/1516/
这篇博客中用EIGRP实现了经典DMVPN阶段二的配置,下面以ospf路由协议来实现。
HUB上配置,只贴出不同的地方
!
interface Tunnel0
ip ospf network broadcast
<网络类型为广播>
ip ospf priority 2
<优先级为2,成为DR>
!
router ospf 100
network 1.1.1.0 0.0.0.255 area 0
network 134.134.134.0 0.0.0.255 area 0
spoke3上的配置,只贴出不同的地方
!
interface Tunnel0
ip ospf network broadcast
<网络类型改为广播>
ip ospf priority 0
<优先级改为0,成为BDR>
!
router ospf 100
network 3.3.3.0 0.0.0.255 area 0
network 134.134.134.0 0.0.0.255 area 0
!
spoke4上的配置,只贴出不同的地方
!
interface Tunnel0
ip ospf network broadcast
<网络类型改为广播>
ip ospf priority 0
<优先级改为0,成为BDR>
!
router ospf 100
network 4.4.4.0 0.0.0.255 area 0
network 134.134.134.0 0.0.0.255 area 0
!
刚配置好,查看hub.spoke3.spoke4上的nhrp情况
HUB#show ip nhrp 134.134.134.3/32 via 134.134.134.3 Tunnel0 created 00:00:11, expire 00:09:49 Type: dynamic, Flags: registered used nhop NBMA address: 23.23.23.3 134.134.134.4/32 via 134.134.134.4 Tunnel0 created 00:00:07, expire 00:09:53 Type: dynamic, Flags: registered used nhop NBMA address: 24.24.24.4 两个spoke动态注册的信息
Spoke3#show ip nhrp
134.134.134.1/32 via 134.134.134.1
Tunnel0 created 00:02:09, never expire
Type: static, Flags: used
NBMA address: 12.12.12.1
spoke3手动到nhs上注册的,永久有效
Spoke4#show ip nhrp
134.134.134.1/32 via 134.134.134.1
Tunnel0 created 00:03:44, never expire
Type: static, Flags: used
NBMA address: 12.12.12.1
手动注册,永久有效
查看路由情况
HUB#show ip route ospf
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/1001] via 134.134.134.3, 00:04:15, Tunnel0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/1001] via 134.134.134.4, 00:04:15, Tunnel0
HUB上学习到两个spoke的路由,下一跳分别是spoke的tunnel的逻辑ip地址。
Spoke3#show ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/1001] via 134.134.134.1, 00:06:43, Tunnel0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/1001] via 134.134.134.4, 00:06:33, Tunnel0
Spoke3#
spoke3上学习到两条ospf的路由,下一跳分别是hub,spoke4的tunnel的逻辑ip地址。
Spoke4#show ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/1001] via 134.134.134.1, 00:08:53, Tunnel0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/1001] via 134.134.134.3, 00:08:53, Tunnel0
spoke4上学习到两条ospf的路由,下一跳分别是hub,spoke3的tunnel的逻辑ip地址。
现在用ping 来触发分支站点间的流量,再查看nhrp 和路由表的变化
spoke3上ping 4.4.4.4
Spoke3#ping 4.4.4.4 source 3.3.3.3 repeat 100
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 3/4/16 ms
Spoke3#
HUB上nhrp 和路由
HUB#show ip nhrp
134.134.134.3/32 via 134.134.134.3
Tunnel0 created 00:13:47, expire 00:09:33
Type: dynamic, Flags: registered nhop
NBMA address: 23.23.23.3
134.134.134.4/32 via 134.134.134.4
Tunnel0 created 00:13:43, expire 00:09:37
Type: dynamic, Flags: registered nhop
NBMA address: 24.24.24.4
HUB#show ip route ospf
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/1001] via 134.134.134.3, 00:13:07, Tunnel0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/1001] via 134.134.134.4, 00:13:07, Tunnel0
HUB#
明显看出和原来没有变化 。
spoke3上的 nhrp和路由信息
Spoke3#show ip nhrp
134.134.134.1/32 via 134.134.134.1
Tunnel0 created 00:15:26, never expire
Type: static, Flags: used
NBMA address: 12.12.12.1
134.134.134.3/32 via 134.134.134.3
Tunnel0 created 00:02:53, expire 00:07:06
Type: dynamic, Flags: router unique local
NBMA address: 23.23.23.3
(no-socket)
134.134.134.4/32 via 134.134.134.4
Tunnel0 created 00:02:53, expire 00:07:06
Type: dynamic, Flags: router used nhop
NBMA address: 24.24.24.4
Spoke3#sho ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/1001] via 134.134.134.1, 00:14:47, Tunnel0
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/1001] via 134.134.134.4, 00:14:37, Tunnel0
Spoke3#
路由没有变化,配置好路由协议就生成了,但是nhrp动态产生了到 spoke4 的信息
spoke4上的 nhrp和路由信息
Spoke4#show ip nhrp
134.134.134.1/32 via 134.134.134.1
Tunnel0 created 00:17:54, never expire
Type: static, Flags: used
NBMA address: 12.12.12.1
134.134.134.3/32 via 134.134.134.3
Tunnel0 created 00:05:25, expire 00:04:34
Type: dynamic, Flags: router used nhop
NBMA address: 23.23.23.3
134.134.134.4/32 via 134.134.134.4
Tunnel0 created 00:05:25, expire 00:04:34
Type: dynamic, Flags: router unique local
NBMA address: 24.24.24.4
(no-socket)
Spoke4#show ip route ospf
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/1001] via 134.134.134.1, 00:17:22, Tunnel0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/1001] via 134.134.134.3, 00:17:22, Tunnel0
路由没有变化,配置好路由协议就生成了,但是nhrp动态产生了到 spoke3 的信息
DMVPN也可以使用用rip v2协议,要取消水平分割和自动汇总
hub配置,不同的地方
interface Tunnel0
no ip split-horizon
<关闭水平分割>
!
router rip
version 2
<V2版本>
network 1.0.0.0
network 134.134.0.0
no auto-summary
<关闭自动汇总>
spoke3上配置
router rip
version 2
network 3.0.0.0
network 134.134.0.0
no auto-summary
<关闭自动汇总>
!
spoke3上配置
!
router rip
version 2
network 4.0.0.0
network 134.134.0.0
no auto-summary
分别查看nhrp和路由
HUB#show ip nhrp
134.134.134.3/32 via 134.134.134.3
Tunnel0 created 00:08:31, expire 00:08:10
Type: dynamic, Flags: registered nhop
NBMA address: 23.23.23.3
134.134.134.4/32 via 134.134.134.4
Tunnel0 created 00:08:27, expire 00:08:13
Type: dynamic, Flags: registered nhop
NBMA address: 24.24.24.4
HUB#show ip route rip
3.0.0.0/24 is subnetted, 1 subnets
R 3.3.3.0 [120/1] via 134.134.134.3, 00:00:19, Tunnel0
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [120/1] via 134.134.134.4, 00:00:11, Tunnel0
Spoke3#show ip nhrp
134.134.134.1/32 via 134.134.134.1
Tunnel0 created 00:09:41, never expire
Type: static, Flags:
NBMA address: 12.12.12.1
Spoke3#show ip route rip
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/1] via 134.134.134.1, 00:00:05, Tunnel0
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [120/2] via 134.134.134.4, 00:00:05, Tunnel0
Spoke4#show ip nhrp
134.134.134.1/32 via 134.134.134.1
Tunnel0 created 00:10:19, never expire
Type: static, Flags:
NBMA address: 12.12.12.1
Spoke4#sho ip route rip
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/1] via 134.134.134.1, 00:00:19, Tunnel0
3.0.0.0/24 is subnetted, 1 subnets
R 3.3.3.0 [120/2] via 134.134.134.3, 00:00:19, Tunnel0
Spoke4#
触发spoke3和spoke4 之间的流量
Spoke3#ping 4.4.4.4 source 3.3.3.3 repeat 100
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 1/4/14 ms
Spoke3#
查看spok3和spoke4上的nhrp 和路由
Spoke3#show ip nhrp
134.134.134.1/32 via 134.134.134.1
Tunnel0 created 00:15:53, never expire
Type: static, Flags: used
NBMA address: 12.12.12.1
134.134.134.3/32 via 134.134.134.3
Tunnel0 created 00:02:03, expire 00:07:56
Type: dynamic, Flags: router unique local
NBMA address: 23.23.23.3
(no-socket)
134.134.134.4/32 via 134.134.134.4
Tunnel0 created 00:02:03, expire 00:07:56
Type: dynamic, Flags: router used nhop
NBMA address: 24.24.24.4
Spoke3#show ip route rip
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/1] via 134.134.134.1, 00:00:23, Tunnel0
4.0.0.0/24 is subnetted, 1 subnets
R 4.4.4.0 [120/2] via 134.134.134.4, 00:00:23, Tunnel0
Spoke3#
Spoke4#show ip nhrp
134.134.134.1/32 via 134.134.134.1
Tunnel0 created 00:16:43, never expire
Type: static, Flags: used
NBMA address: 12.12.12.1
134.134.134.3/32 via 134.134.134.3
Tunnel0 created 00:02:57, expire 00:07:02
Type: dynamic, Flags: router used nhop
NBMA address: 23.23.23.3
134.134.134.4/32 via 134.134.134.4
Tunnel0 created 00:02:57, expire 00:07:02
Type: dynamic, Flags: router unique local
NBMA address: 24.24.24.4
(no-socket)
Spoke4#show ip route rip
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/1] via 134.134.134.1, 00:00:16, Tunnel0
3.0.0.0/24 is subnetted, 1 subnets
R 3.3.3.0 [120/2] via 134.134.134.3, 00:00:16, Tunnel0