本文共 5424 字,大约阅读时间需要 18 分钟。
第二阶段DM×××可以使用动态协议实现分支站点之间内网的直接通信
这里使用OSPF ,主要配置如下:R1#sho run int tun 0Building configuration...Current configuration : 258 bytesinterface Tunnel0ip address 10.1.1.1 255.255.255.0no ip redirectsip nhrp authentication 123ip nhrp map multicast dynamicip nhrp network-id 100ip ospf network broadcasttunnel source Ethernet0/0tunnel mode gre multipointtunnel key 100EndR1#sho ip nhrp
10.1.1.2/32 via 10.1.1.2Tunnel0 created 00:10:58, expire 01:49:01Type: dynamic, Flags: unique registered NBMA address: 100.2.28.2 10.1.1.3/32 via 10.1.1.3Tunnel0 created 00:10:58, expire 01:49:01Type: dynamic, Flags: unique registered used NBMA address: 100.3.38.3R1#sho ip route
CGateway of last resort is 100.1.18.8 to network 0.0.0.0S* 0.0.0.0/0 [1/0] via 100.1.18.81.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 1.1.1.0/24 is directly connected, Loopback0L 1.1.1.1/32 is directly connected, Loopback02.0.0.0/32 is subnetted, 1 subnetsO 2.2.2.2 [110/1001] via 10.1.1.2, 00:10:54, Tunnel03.0.0.0/32 is subnetted, 1 subnetsO 3.3.3.3 [110/1001] via 10.1.1.3, 00:01:03, Tunnel010.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 10.1.1.0/24 is directly connected, Tunnel0L 10.1.1.1/32 is directly connected, Tunnel0100.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 100.1.18.0/24 is directly connected, Ethernet0/0L 100.1.18.1/32 is directly connected, Ethernet0/0R2#sho run int tun 0
Building configuration...Current configuration : 336 bytesinterface Tunnel0ip address 10.1.1.2 255.255.255.0no ip redirectsip nhrp authentication 123ip nhrp map 10.1.1.1 100.1.18.1ip nhrp map multicast 100.1.18.1ip nhrp network-id 100ip nhrp nhs 10.1.1.1ip ospf network broadcastip ospf priority 0 //将spoke的优先级改为0,使其不参与选举 tunnel source Ethernet0/0tunnel mode gre multipointtunnel key 100EndR2#sho ip nhrp
10.1.1.1/32 via 10.1.1.1Tunnel0 created 00:12:56, never expire Type: static, Flags: used NBMA address: 100.1.18.1 10.1.1.2/32 via 10.1.1.2Tunnel0 created 00:00:02, expire 01:59:57Type: dynamic, Flags: router unique local NBMA address: 100.2.28.2 (no-socket) 10.1.1.3/32 via 10.1.1.3Tunnel0 created 00:00:02, expire 01:59:57Type: dynamic, Flags: router used NBMA address: 100.3.38.3 R2#sho ip route Gateway of last resort is 100.2.28.8 to network 0.0.0.0S* 0.0.0.0/0 [1/0] via 100.2.28.81.0.0.0/32 is subnetted, 1 subnetsO 1.1.1.1 [110/1001] via 10.1.1.1, 00:12:47, Tunnel02.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 2.2.2.0/24 is directly connected, Loopback0L 2.2.2.2/32 is directly connected, Loopback03.0.0.0/32 is subnetted, 1 subnetsO 3.3.3.3 [110/1001] via 10.1.1.3, 00:00:19, Tunnel010.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 10.1.1.0/24 is directly connected, Tunnel0L 10.1.1.2/32 is directly connected, Tunnel0100.0.0.0/8 is variably subnetted, 4 subnets, 2 masksC 100.2.28.0/24 is directly connected, Ethernet0/0L 100.2.28.2/32 is directly connected, Ethernet0/0R3#sho run int tun 0
Building configuration...Current configuration : 302 bytesinterface Tunnel0ip address 10.1.1.3 255.255.255.0no ip redirectsip nhrp authentication 123ip nhrp map 10.1.1.1 100.1.18.1ip nhrp map multicast 100.1.18.1ip nhrp network-id 100ip nhrp nhs 10.1.1.1ip ospf network broadcastip ospf priority 0 //将spoke的优先级改为0,使其不参与选举 tunnel source Ethernet0/0tunnel mode gre multipointtunnel key 100End10.1.1.1/32 via 10.1.1.1
Tunnel0 created 00:14:25, never expire Type: static, Flags: used NBMA address: 100.1.18.1 10.1.1.2/32 via 10.1.1.2Tunnel0 created 00:01:31, expire 01:58:28Type: dynamic, Flags: router NBMA address: 100.2.28.2 10.1.1.3/32 via 10.1.1.3Tunnel0 created 00:01:31, expire 01:58:28Type: dynamic, Flags: router unique local NBMA address: 100.3.38.3 (no-socket)R3#sho ip route
Gateway of last resort is 100.3.38.8 to network 0.0.0.0S* 0.0.0.0/0 [1/0] via 100.3.38.81.0.0.0/32 is subnetted, 1 subnetsO 1.1.1.1 [110/1001] via 10.1.1.1, 00:00:07, Tunnel02.0.0.0/32 is subnetted, 1 subnetsO 2.2.2.2 [110/1001] via 10.1.1.2, 00:00:07, Tunnel03.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 3.3.3.0/24 is directly connected, Loopback0L 3.3.3.3/32 is directly connected, Loopback010.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 10.1.1.0/24 is directly connected, Tunnel0L 10.1.1.3/32 is directly connected, Tunnel0100.0.0.0/8 is variably subnetted, 4 subnets, 2 masksC 100.3.38.0/24 is directly connected, Ethernet0/0L 100.3.38.3/32 is directly connected, Ethernet0/0R8#sho ip route
100.0.0.0/8 is variably subnetted, 6 subnets, 2 masksC 100.1.18.0/24 is directly connected, Ethernet0/0L 100.1.18.8/32 is directly connected, Ethernet0/0C 100.2.28.0/24 is directly connected, Ethernet0/1L 100.2.28.8/32 is directly connected, Ethernet0/1C 100.3.38.0/24 is directly connected, Ethernet0/2L 100.3.38.8/32 is directly connected, Ethernet0/2R2#traceroute 3.3.3.3 source 2.2.2.2 numeric
Type escape sequence to abort.Tracing the route to 3.3.3.3VRF info: (vrf in name/id, vrf out name/id)1 10.1.1.3 5 msec * 0 msec //spoke(或分支)之间一跳可达R3#traceroute 2.2.2.2 source 3.3.3.3 numeric
Type escape sequence to abort.Tracing the route to 2.2.2.2VRF info: (vrf in name/id, vrf out name/id)1 10.1.1.2 1 msec * 1 msec注意:1、OSPF要达成第二阶段必须把tunnel的网络类型改为BMA/NBMA 并且hub必须为DR,一般把spoke选举优先级改为0。2、OSPF是链路状态型协议,路由下一跳取决与拓扑图的结构而在多路环境下spoke在拓扑结构中是直连的,所以spoke的路由表中下一跳直接指向目标spoke的tunnel地址。转载于:https://blog.51cto.com/13596342/2093569