第二阶段DM×××使用动态协议实现分支站点之间内网直接通信 这里使用EIGRP协议,主要配置如下: R1#sho run int tun 0 Building configuration... Current configuration : 293 bytes interface Tunnel0 ip address 10.1.1.1 255.255.255.0 no ip redirects no ip next-hop-self eigrp 100 //距离矢量型协议会进行矢量叠加,这里要禁止修改下一跳 no ip split-horizon eigrp 100 // 关闭水平分割 ip nhrp authentication 123 ip nhrp map multicast dynamic ip nhrp network-id 100 tunnel source Ethernet0/0 tunnel mode gre multipoint tunnel key 100 End R1#sho ip nhrp 10.1.1.2/32 via 10.1.1.2 Tunnel0 created 00:22:57, expire 01:37:49 Type: dynamic, Flags: unique registered NBMA address: 100.2.28.2 10.1.1.3/32 via 10.1.1.3 Tunnel0 created 00:22:58, expire 01:38:07 Type: dynamic, Flags: unique registered NBMA address: 100.3.38.3 R1#sho ip route Gateway of last resort is 100.1.18.8 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 100.1.18.8 1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 1.1.1.0/24 is directly connected, Loopback0 L 1.1.1.1/32 is directly connected, Loopback0 2.0.0.0/24 is subnetted, 1 subnets D 2.2.2.0 [90/27008000] via 10.1.1.2, 00:36:10, Tunnel0 3.0.0.0/24 is subnetted, 1 subnets D 3.3.3.0 [90/27008000] via 10.1.1.3, 00:36:12, Tunnel0 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 10.1.1.0/24 is directly connected, Tunnel0 L 10.1.1.1/32 is directly connected, Tunnel0 100.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 100.1.18.0/24 is directly connected, Ethernet0/0 L 100.1.18.1/32 is directly connected, Ethernet0/0
R2#sho run int tun 0 Building configuration... Current configuration : 289 bytes interface Tunnel0 ip address 10.1.1.2 255.255.255.0 no ip redirects ip nhrp authentication 123 ip nhrp map 10.1.1.1 100.1.18.1 ip nhrp map multicast 100.1.18.1 ip nhrp network-id 100 ip nhrp nhs 10.1.1.1 tunnel source Ethernet0/0 tunnel mode gre multipoint tunnel key 100 End
R2#sho ip nhrp
10.1.1.1/32 via 10.1.1.1
Tunnel0 created 00:22:21, never expire
Type: static, Flags: used
NBMA address: 100.1.18.1
10.1.1.2/32 via 10.1.1.2
Tunnel0 created 00:19:02, expire 01:40:57
Type: dynamic, Flags: router unique local
NBMA address: 100.2.28.2
(no-socket)
10.1.1.3/32 via 10.1.1.3
Tunnel0 created 00:19:02, expire 01:40:57
Type: dynamic, Flags: router
NBMA address: 100.3.38.3
R2#sho ip route Gateway of last resort is 100.2.28.8 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 100.2.28.8 1.0.0.0/24 is subnetted, 1 subnets D 1.1.1.0 [90/27008000] via 10.1.1.1, 00:37:57, Tunnel0 2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 2.2.2.0/24 is directly connected, Loopback0 L 2.2.2.2/32 is directly connected, Loopback0 3.0.0.0/24 is subnetted, 1 subnets D 3.3.3.0 [90/28288000] via 10.1.1.3, 00:37:57, Tunnel0 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 10.1.1.0/24 is directly connected, Tunnel0 L 10.1.1.2/32 is directly connected, Tunnel0 100.0.0.0/8 is variably subnetted, 4 subnets, 2 masks C 100.2.28.0/24 is directly connected, Ethernet0/0 L 100.2.28.2/32 is directly connected, Ethernet0/0
R3#sho run int tun 0 Building configuration... Current configuration : 289 bytes interface Tunnel0 ip address 10.1.1.3 255.255.255.0 no ip redirects ip nhrp authentication 123 ip nhrp map 10.1.1.1 100.1.18.1 ip nhrp map multicast 100.1.18.1 ip nhrp network-id 100 ip nhrp nhs 10.1.1.1 tunnel source Ethernet0/0 tunnel mode gre multipoint tunnel key 100 End
R3#sho ip nhrp 10.1.1.1/32 via 10.1.1.1 Tunnel0 created 00:25:06, never expire Type: static, Flags: used NBMA address: 100.1.18.1 10.1.1.2/32 via 10.1.1.2 Tunnel0 created 00:22:05, expire 01:37:54 Type: dynamic, Flags: router NBMA address: 100.2.28.2 10.1.1.3/32 via 10.1.1.3 Tunnel0 created 00:22:05, expire 01:37:54 Type: dynamic, Flags: router unique local NBMA address: 100.3 R3#sho ip route Gateway of last resort is 100.3.38.8 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 100.3.38.8 1.0.0.0/24 is subnetted, 1 subnets D 1.1.1.0 [90/27008000] via 10.1.1.1, 00:38:11, Tunnel0 2.0.0.0/24 is subnetted, 1 subnets D 2.2.2.0 [90/28288000] via 10.1.1.2, 00:38:09, Tunnel0 3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 3.3.3.0/24 is directly connected, Loopback0 L 3.3.3.3/32 is directly connected, Loopback0 10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks C 10.1.1.0/24 is directly connected, Tunnel0 L 10.1.1.3/32 is directly connected, Tunnel0 100.0.0.0/8 is variably subnetted, 4 subnets, 2 masks C 100.3.38.0/24 is directly connected, Ethernet0/0 L 100.3.38.3/32 is directly connected, Ethernet0/0
R8#sho ip route 100.0.0.0/8 is variably subnetted, 6 subnets, 2 masks C 100.1.18.0/24 is directly connected, Ethernet0/0 L 100.1.18.8/32 is directly connected, Ethernet0/0 C 100.2.28.0/24 is directly connected, Ethernet0/1 L 100.2.28.8/32 is directly connected, Ethernet0/1 C 100.3.38.0/24 is directly connected, Ethernet0/2 L 100.3.38.8/32 is directly connected, Ethernet0/2
R2#traceroute 3.3.3.3 source 2.2.2.2 numeric Type escape sequence to abort. Tracing the route to 3.3.3.3 VRF info: (vrf in name/id, vrf out name/id) 1 10.1.1.3 1 msec * 1 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.2 VRF info: (vrf in name/id, vrf out name/id) 1 10.1.1.2 1 msec * 1 msec
注意: 1、 no ip next-hop-self eigrp 100 //EIGRP是距离矢量型协议,路由在路由器传递过程中 会进行矢量叠加(修改),从而让spoke在收到其他spoke传递的路由时下一跳指向hub, 所有想要spoke之间直接通信必须关闭hub接口上的方向修改功能。 2、no ip split-horizon eigrp 100 //spoke路由会在tunnel接口进出,违背水平分割原理, 导致spoke之间没法学习对方路由。关闭则消除。