实验二:教主自创版DM××× + GET×××实验

第一部分:实验设计介绍

在第七章中我们学习过了DM×××,虽然DM×××是一种高可扩展性的IPSec ×××类型,但是在实际工程部署的时候,经常出现中心站点路由器负载过大的情况。通过分析发现,中心站点的负载压力主要出现在两个方面,第一就是中心站点IPSec安全关联过多,有多少个分支站点就有多少对IPSec安全关联,维护安全关联会消耗大量内存资源。第二就是动态路由协议的更新信息制造了过多加密包,加密数据包会消耗大量CPU资源。为了解决这两大问题,我设计了DM×××+GET×××这个实验,首先解决IPSec安全关联过多的问题,使用GET×××技术统一给DM×××中心站点和分支站点分发IPSec安全关联,密钥和感兴趣流(加密所有GRE流量),这样不管中心站点还是分支站点都只有一个IPSec安全关联,消除了中心站点安全关联过多的问题,降低了内存的消耗。其次在本实验中彻底取消了动态路由协议,我们使用第三阶段的DM×××加上静态路由来解决这个问题。因为采用了第三阶段的DM×××,分支机构可以配置汇总的静态路由到中心,中心可以通过NHRP的重定向技术来引导分支站点间直接建立GRE隧道,然后用GET×××分发的安全关联和密钥进行加密。

第二部分:实验目标

配置教主自创版DM××× + GET×××实验

第三部分:实际接线状况

图8-19: 教主自创版DM××× + GET×××实验实际接线图


第四部分:实验拓扑

图8-20: 教主自创版DM××× + GET×××实验物理拓扑


8-21: 教主自创版DM××× + GET×××实验逻辑拓扑


拓扑介绍: 本次实验主要目的是使用第三阶段的DM×××加上GET×××技术,降低传统DM×××中心站点负载过大的问题。本次实验拓扑中一共有四台路由器,GM1-Hub(202.100.1.100)为DM×××的中心站点,也是GET×××的组成员一,GM2-Spoke1(202.100.1.1)为DM×××的分支站点一,也是GET×××的组成员二,GM3-Spoke2(202.100.1.2)为DM×××的分支站点二,也是GET×××的组成员三,KS(202.100.1.101)为GET×××的密钥服务器。192.168.X.0/24分别模拟各站点内部网络,172.16.1.0/24为MGRE隧道网络。本次试验不运行任何动态路由协议,通过在中心站点和分支站点配置静态路由来解决路由问题,并且使用第三阶段DM×××的NHRP重定向技术引导分支站点间直接建立隧道。GET×××的主要任务为给所有组成员分发安全关联,密钥和感兴趣流(所有GRE流量)。使用GET×××替代传统DM×××中的IPSec ×××来加密流量。减少IPSec安全关联的数量,提供了流量的及时加密。

第五部分:基本网络配置

GM1-Hub基本网络配置

enable

configure terminal

!

hostname GM1-Hub

!

interface Loopback0

ip address 192.168.100.1 255.255.255.0

!

interface FastEthernet0/0

ip address 202.100.1.100 255.255.255.0

no shutdown

!

end

KS基本网络配置

enable

configure terminal

!

hostname KS

!

interface FastEthernet0/0

ip address 202.100.1.101 255.255.255.0

no shutdown

!

end

GM2-Spoke1基本网络配置

enable

configure terminal

!

hostname GM2-Spoke1

!

interface Loopback0

ip address 192.168.1.1 255.255.255.0

!

interface FastEthernet0/0

ip address 202.100.1.1 255.255.255.0

no shutdown

!

end

GM3-Spoke2基本网络配置

enable

configure terminal

!

hostname GM3-Spoke2

!

interface Loopback0

ip address 192.168.2.1 255.255.255.0

!

interface FastEthernet0/0

ip address 202.100.1.2 255.255.255.0

no shutdown

!

end

第六部分:mGRE隧道配置

GM1-Hub mGRE隧道配置

GM1-Hub(config)#interface tunnel 0

GM1-Hub(config-if)#ip mtu 1400

GM1-Hub(config-if)#ip address 172.16.1.100 255.255.255.0

GM1-Hub(config-if)#tunnel source fastEthernet 0/0

GM1-Hub(config-if)#tunnel mode gre multipoint

GM1-Hub(config-if)#tunnel key 12345

GM1-Hub(config-if)#ip nhrp network-id 10

GM1-Hub(config-if)#ip nhrp map multicast dynamic

GM1-Hub(config-if)#ip nhrp redirect

GM2-Spoke1 mGRE隧道配置

GM2-Spoke1(config)#interface tunnel 0

GM2-Spoke1(config-if)#ip mtu 1400

GM2-Spoke1(config-if)#ip address 172.16.1.1 255.255.255.0

GM2-Spoke1(config-if)#tunnel source fastEthernet 0/0

GM2-Spoke1(config-if)#tunnel mode gre multipoint

GM2-Spoke1(config-if)#tunnel key 12345

GM2-Spoke1(config-if)#ip nhrp network-id 10

GM2-Spoke1(config-if)#ip nhrp map 172.16.1.100 202.100.1.100

GM2-Spoke1(config-if)#ip nhrp map multicast 202.100.1.100

GM2-Spoke1(config-if)#ip nhrp nhs 172.16.1.100

GM2-Spoke1(config-if)#ip nhrp shortcut

GM3-Spoke2 mGRE隧道配置

GM3-Spoke2(config)#interface tunnel 0

GM3-Spoke2(config-if)#ip mtu 1400

GM3-Spoke2(config-if)#ip address 172.16.1.2 255.255.255.0

GM3-Spoke2(config-if)#tunnel source fastEthernet 0/0

GM3-Spoke2(config-if)#tunnel mode gre multipoint

GM3-Spoke2(config-if)#tunnel key 12345

GM3-Spoke2(config-if)#ip nhrp network-id 10

GM3-Spoke2(config-if)#ip nhrp map 172.16.1.100 202.100.1.100

GM3-Spoke2(config-if)#ip nhrp map multicast 202.100.1.100

GM3-Spoke2(config-if)#ip nhrp nhs 172.16.1.100

GM3-Spoke2(config-if)#ip nhrp shortcut

第七部分:静态路由配置

GM1-Hub 静态路由配置

GM1-Hub(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.1

GM1-Hub(config)#ip route 192.168.2.0 255.255.255.0 172.16.1.2

使用此种解决方案唯一的复杂之处就在于中心站点需要配置很多的静态路由。

GM2-Spoke1 静态路由配置

GM2-Spoke1(config)#ip route 192.168.0.0 255.255.0.0 172.16.1.100

GM3-Spoke2 静态路由配置

GM3-Spoke2(config)#ip route 192.168.0.0 255.255.0.0 172.16.1.100

第八部分:配置密钥服务器KS

第一步:产生密钥

KS(config)#ip domain name yeslab.net

KS(config)#crypto key generate rsa modulus 1024 label get***key

第二步:配置ISAKMP第一阶段策略

KS(config)#crypto isakmp policy 10

KS(config-isakmp)#authentication pre-share

KS(config)#crypto isakmp key 0 cisco address 202.100.1.1

KS(config)#crypto isakmp key 0 cisco address 202.100.1.2

KS(config)#crypto isakmp key 0 cisco address 202.100.1.100

第三步:配置感兴趣流

KS(config)#ip access-list ex ALL-DM×××-Traffic

KS(config-ext-nacl)#permit gre any any

第四步:配置IPSec Profile

KS(config)#crypto ipsec transform-set cisco esp-des esp-md5-hmac

KS(config)#crypto ipsec profile ipsecprof

KS(ipsec-profile)#set transform-set cisco

第五步:配置KS为密钥服务器

KS(config)#crypto gdoi group mygroup

KS(config-gdoi-group)#identity number 88888

KS(config-gdoi-group)#server local

KS(gdoi-local-server)#address ipv4 202.100.1.101

第六步:配置密钥更新

KS(gdoi-local-server)#rekey authentication mypubkey rsa get***key

KS(gdoi-local-server)#rekey transport unicast

第七步:配置IPSec安全关联

KS(gdoi-local-server)#sa ipsec 1

KS(gdoi-sa-ipsec)#match address ipv4 ALL-DM×××-Traffic

KS(gdoi-sa-ipsec)#profile ipsecprof

第九部分:配置组成员(GM1-Hub

GM1-Hub(config)#crypto isakmp policy 10

GM1-Hub(config-isakmp)#authentication pre-share

GM1-Hub(config)#crypto isakmp key 0 cisco address 202.100.1.101

GM1-Hub(config)#crypto gdoi group mygroup

GM1-Hub(config-gdoi-group)#identity number 88888

GM1-Hub(config-gdoi-group)#server address ipv4 202.100.1.101

GM1-Hub(config)#crypto map cisco 10 gdoi

GM1-Hub(config-crypto-map)#set group mygroup

GM1-Hub(config)# interface fastEthernet 0/0

GM1-Hub(config-if)#crypto map cisco

第十部分:配置组成员(GM2-Spoke1

GM2-Spoke1(config)#crypto isakmp policy 10

GM2-Spoke1(config-isakmp)#authentication pre-share

GM2-Spoke1(config)#crypto isakmp key 0 cisco address 202.100.1.101

GM2-Spoke1(config)#crypto gdoi group mygroup

GM2-Spoke1(config-gdoi-group)#identity number 88888

GM2-Spoke1(config-gdoi-group)#server address ipv4 202.100.1.101

GM2-Spoke1(config)#crypto map cisco 10 gdoi

GM2-Spoke1(config-crypto-map)#set group mygroup

GM2-Spoke1(config)#interface fastEthernet 0/0

GM2-Spoke1(config-if)#crypto map cisco

第十一部分:配置组成员(GM3-Spoke2

GM3-Spoke2(config)#crypto isakmp policy 10

GM3-Spoke2(config-isakmp)#authentication pre-share

GM3-Spoke2(config)#crypto isakmp key 0 cisco address 202.100.1.101

GM3-Spoke2(config)#crypto gdoi group mygroup

GM3-Spoke2(config-gdoi-group)#identity number 88888

GM3-Spoke2(config-gdoi-group)#server address ipv4 202.100.1.101

GM3-Spoke2(config)#crypto map cisco 10 gdoi

GM3-Spoke2(config-crypto-map)#set group mygroup

GM3-Spoke2(config)#interface fastEthernet 0/0

GM3-Spoke2(config-if)#crypto map cisco

第十二部分:测试

GM2-Spoke1#ping 192.168.2.1 so 192.168.1.1 repeat 100

Type escape sequence to abort.

Sending 100, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:

Packet sent with a source address of 192.168.1.1

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Success rate is 100 percent (100/100), round-trip min/avg/max = 176/253/540 ms

GM2-Spoke1#ping 192.168.100.1 so 192.168.1.1 repeat 100

Type escape sequence to abort.

Sending 100, 100-byte ICMP Echos to 192.168.100.1, timeout is 2 seconds:

Packet sent with a source address of 192.168.1.1

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Success rate is 100 percent (100/100), round-trip min/avg/max = 144/283/568 ms

GM2-Spoke1#show crypto engine connections active

Crypto Engine Connections

ID Interface Type Algorithm Encrypt Decrypt IP-Address

1 Fa0/0 IPsec DES+MD5 0 200 0.0.0.0

2 Fa0/0 IPsec DES+MD5 200 0 0.0.0.0

5 Fa0/0 IPsec DES+MD5 0 0 0.0.0.0

6 Fa0/0 IPsec DES+MD5 0 0 0.0.0.0

1001 Fa0/0 IKE SHA+DES 0 0 202.100.1.1

1002 <none> IKE SHA+3DES 0 0

1003 <none> IKE SHA+3DES 0 0