1各种VPN.docx

上传人:b****6 文档编号:9040668 上传时间:2023-02-02 格式:DOCX 页数:39 大小:2.07MB
下载 相关 举报
1各种VPN.docx_第1页
第1页 / 共39页
1各种VPN.docx_第2页
第2页 / 共39页
1各种VPN.docx_第3页
第3页 / 共39页
1各种VPN.docx_第4页
第4页 / 共39页
1各种VPN.docx_第5页
第5页 / 共39页
点击查看更多>>
下载资源
资源描述

1各种VPN.docx

《1各种VPN.docx》由会员分享,可在线阅读,更多相关《1各种VPN.docx(39页珍藏版)》请在冰豆网上搜索。

1各种VPN.docx

1各种VPN

ZGGCD学习笔记

各种VPN总结归纳

针对不同形式的IPSeVPN总结

Windows用户

2010/12/15

IPSecVPN的基本配置步骤:

IPSeVPN主要有六个步骤:

1、配置IKE即isakamp

此步骤有三个任务:

指定产生密钥的算法:

group1、group2、group5

指定对密钥加密的加密算法:

DES、AES、3DES

指定对隧道对端的peer进行认证的认证方式psk、rsa;以及hash算法

2、定义认证标识

此步骤设定对隧道对端的peer进行认证的认证密钥,隧道两端指定的密钥必须一致

3、配置IPSetransform-set,即转换集

此步骤设定对数据的加密方式,即转换集

4、定义感兴趣数据流

用ACL匹配感兴趣的数据流,切忌不能使用any来匹配所有数据流,否则会出错

5、创建cryptomap

创建cryptomap,在map中指定peer对等体,关联上之前的transform-set和感兴趣数据流

6、将cryptomap应用于接口

 

IPSecLANtoLANVPN

一、特点:

1、LAN-to-LANVPN也称作点到点VPN,是IPSecVPN中最简单的一种;

2、只能在两个站点之间建立VPN隧道,并完成通信流量的加密,实现两个私网穿越公网进行通信;

3、可以通过扩展,将这种VPN建设成星型连接;即一个hub,下连很多个spoke站点,每个spoke站点都与hub之间建立LANtoLANVPN;缺点是hub需要为每个spoke站点做配置,所以如果下联spoke站点很多的话,hub端的VPN配置量很大,不易维护。

在LANtoLANVPN中hub端需要在对spoke端做认证的时候明确的写出spoke端的IP地址,在cryptomap中叶要明确写出spoke端的IP地址。

所以在hub端针对每一个spoke端都要做相同的配置,并写上spoke端的IP地址,这样就会导致hub端的配置量很大,不易维护。

4、hub端采用的地址必须是spoke端事先知道的,并且是固定不变的;spoke端的IP地址也必须是hub

端事先知道的,并且是固定不变的。

二、在路由器上配置

配置:

r1#showrunning-config

Buildingconfiguration...

Currentconfiguration:

1072bytes

version12.4

servicetimestampsdebugdatetimemsec

servicetimestampslogdatetimemsec

noservicepassword-encryption

!

hostnamer1

!

!

boot-start-marker

boot-end-marker

!

noaaanew-model

memory-sizeiomem5

!

ipcef

!

cryptoisakmppolicy1步骤1

encr3des橘黄色为IPSecphaseone过程

authenticationpre-share即showcryptoisakmpsa

group2此过程建立不起来会显示为

cryptoisakmpkeyciscoaddress23.23.23.3步骤2

!

cryptoipsectransform-setMTesp-3desesp-sha-hmac步骤3

!

cryptomapMMAP1ipsec-isakmp步骤5

setpeer23.23.23.3

settransform-setMT

matchaddressVPN

!

interfaceEthernet0/0

ipaddress12.12.12.1255.255.255.0

half-duplex

cryptomapMMAP步骤6

!

interfaceEthernet0/1

ipaddress10.1.1.1255.255.255.0

half-duplex

!

!

interfaceEthernet0/2

noipaddress

shutdown

half-duplex

!

interfaceEthernet0/3

noipaddress

shutdown

half-duplex

!

iphttpserver

noiphttpsecure-server

!

iproute0.0.0.00.0.0.012.12.12.2

!

ipaccess-listextendedVPN步骤4

permitip10.1.1.00.0.0.255192.168.1.00.0.0.255

!

control-plane

!

!

!

!

linecon0

lineaux0

linevty04

!

!

end

r1#

状态查看:

三、在防火墙上配置

PIX从7.0后和ASA的指令集基本一致,所以在这里只演示PIX上的VPN配置

配置

PIX8.0配置

pixfirewall#shorunning-config

:

Saved

:

PIXVersion8.0(3)

hostnamepixfirewall

enablepassword8Ry2YjIyt7RRXU24encrypted

names

!

interfaceEthernet0

nameifinside

security-level100

ipaddress192.168.1.3255.255.255.0

!

interfaceEthernet1

nameifoutside

security-level0

ipaddress23.23.23.3255.255.255.0

!

interfaceEthernet2

shutdown

nonameif

nosecurity-level

noipaddress

!

interfaceEthernet3

shutdown

nonameif

nosecurity-level

noipaddress

!

interfaceEthernet4

shutdown

nonameif

nosecurity-level

noipaddress

!

passwd2KFQnbNIdI.2KYOUencrypted

ftpmodepassive

access-listVPNextendedpermitip192.168.1.0255.255.255.010.1.1.0255.255.255.0步骤4

pagerlines24

mtuoutside1500

mtuinside1500

nofailover

icmpunreachablerate-limit1burst-size1

noasdmhistoryenable

arptimeout14400

routeoutside0.0.0.00.0.0.023.23.23.21

timeoutxlate3:

00:

00

timeoutconn1:

00:

00half-closed0:

10:

00udp0:

02:

00icmp0:

00:

02

timeoutsunrpc0:

10:

00h3230:

05:

00h2251:

00:

00mgcp0:

05:

00mgcp-pat0:

05:

00

timeoutsip0:

30:

00sip_media0:

02:

00sip-invite0:

03:

00sip-disconnect0:

02:

00

timeoutuauth0:

05:

00absolute

dynamic-access-policy-recordDfltAccessPolicy

nosnmp-serverlocation

nosnmp-servercontact

snmp-serverenabletrapssnmpauthenticationlinkuplinkdowncoldstart

cryptoipsectransform-setMTesp-3desesp-sha-hmac步骤3

cryptomapMMAP1matchaddressVPN步骤5

cryptomapMMAP1setpeer12.12.12.1

cryptomapMMAP1settransform-setMT

cryptomapMMAPinterfaceoutside步骤6

cryptoisakmpenableoutside

cryptoisakmppolicy1步骤1

authenticationpre-share

encryption3des橘黄色部分是IPSecphaseone过程

hashsha即showcryptoisakmpsa

group2此过程建立不起来会显示为

lifetime86400

telnettimeout5

sshtimeout5

consoletimeout0

threat-detectionbasic-threat

threat-detectionstatisticsaccess-list

tunnel-group12.12.12.1typeipsec-l2l步骤2

tunnel-group12.12.12.1ipsec-attributes注意:

在PIX上指定对端peer时的方式

pre-shared-key*pix上默认加密密码

!

!

prompthostnamecontext

Cryptochecksum:

e70e9b783b94bcf4aece083497e0cfb4

:

end

pixfirewall#

状态查看

IPSecDynamicLANtoLANVPN

一、特点

1、动态LANtoLANVPN相对于前面说的最简单的VPN的改进在于:

动态VPN的总部,即hub端通过使用通配符来匹配spoke端并对其进行认证和采用dynamicmap使用通配符匹配spoke端的方式简化了hub端的VPN配置量,这样不管hub端下联的spoke数量增加多少,hub端的配置量不会发生任何改变;

2、所以通过使用通配符来匹配spoke端的IP地址的话,就可以大大的减少hub端的配置量;但是也存在一个弊端:

即DynamicLANtoLANVPN的hub端不能先向spoke发起会话建立SA,因为hub端不知道要向哪个IP地址发起会话;所以只能由spoke端先向hub端发送会话才能初始化SA并建立SA。

3、hub端的IP地址必须是spoke端事先知道的IP,并且是固定不变的;spoke端的IP地址可以是任意地址,dhcp、ADSL获取都可以,因为在hub端是使用通配符匹配的。

4、spoke端的配置都是一样的,唯一不同的就是spoke端匹配的数据流不同,因为各个spoke站点采用的私有IP地址肯定是不同的。

二、在路由器上配置

配置

R1上的配置:

r1#showrun

Buildingconfiguration...

Currentconfiguration:

1032bytes

!

version12.4

servicetimestampsdebugdatetimemsec

servicetimestampslogdatetimemsec

noservicepassword-encryption

!

hostnamer1

!

boot-start-marker

boot-end-marker

!

noaaanew-model

memory-sizeiomem5

!

!

ipcef

!

!

cryptokeyringabc步骤2-1

pre-shared-keyaddress0.0.0.00.0.0.0keycisco设置密码

!

cryptoisakmppolicy1步骤1

encr3des

authenticationpre-share

group2

cryptoisakmpprofileppp步骤2-2:

定义IPSecProfile

keyringabc将设置的密码与之关联

matchidentityaddress0.0.0.0设置任意对端spoke都要使用该密码认证

!

cryptoipsectransform-setMTesp-3desesp-sha-hmac步骤3

!

cryptodynamic-mapMDMAP5步骤4:

设置Dynamicmap

settransform-setMT由于hub端要出去的数据是去往未知和动态IP的spoke

setisakmp-profileppp端,所以Dynamicmap中不需要匹配感兴趣数据流

!

cryptomapMMAP10ipsec-isakmpdynamicMDMAP步骤5:

将Dynamicmap关

!

联在cryptomap中

!

!

interfaceFastEthernet0/0

ipaddress12.12.12.1255.255.255.0

duplexauto

speedauto

cryptomapMMAP步骤6:

在接口下应用

!

interfaceFastEthernet1/0

ipaddress10.1.1.1255.255.255.0

duplexauto

speedauto

!

iphttpserver

noiphttpsecure-server

!

iproute0.0.0.00.0.0.012.12.12.2

!

!

control-plane

!

!

!

linecon0

lineaux0

linevty04

!

!

end

r1#

从实验拓扑中可以看出:

R1和R3之间实际上和LANtoLANVPN是一样的,所以R3上的配置就是最基本的LANtoLANVPN配置;

由于R4的接口地址是通过DHCP获取的,是可以发生变化并且R1事先不知道的IP地址。

但是对于R4来说,R1的IP地址是不会发生变化的,在R4看来,就相当于普通的LANtoLANVPN,所以R4的配置也是普通的配置,不用做任何改变。

所以DynamicLANtoLANVPN的好处就是无论spoke端的IP地址是如何过得的、是否会发生变化并且不论spoke站点有多少个,hub都可以通过Dynamicmap使用通配符来匹配spoke端,这样hub的配置量就会大大减少。

注意,hub端使用Dynamicmap后直接从hub端向外pingspoke端是ping不通的,因为hub端不知道要和哪个IP地址建立SA会话,所以必须由spoke端先向hub发起会话,由spoke端先pinghub端才能ping通并建立SA会话,之后再从hub端往外ping就能通了。

状态查看

在hub端可以看到两个IPSecVPN进程,并且都处于ACTIVE状态。

三、在防火墙上配置

配置

DynamicLANtoLANVPN在模拟器上配置后IPSecphaseone总是处于ACTIVE(deleted)状态,这里只给出配置指令:

Cryptoisakmppolicy1步骤1

Encryption3des

Hashsha

Authenticationpre-share

Group2

Isakmpkeyciscoaddress0.0.0.0netmask0.0.0.0步骤2

注意:

DynamicLANtoLANVPN指定peer的方式

Cryptoipsectransform-setMTesp-3desesp-sha-hmac步骤3

Cryptodynamic-mapMDMAP1settransform-setMT步骤4

Cryptodynamic-mapMDMAP1setreverse-route创建Dynamicmap并将转换集

关联在其中

CryptomapMMAP10ipsec-isakmpdynamicMDMAP步骤5

在cryptomap中只要将

Dynamicmap关联进来就行了

CryptomapMMAPinterfaceoutside步骤6

IsakmpenableoutsidePIX&ASA上都需要这个指令

状态查看

(略)

PointtopointGREoverIPSec

一、特点

IPSecVPN有两个能够自己实现的独立功能:

建立逻辑隧道、对数据进行加密;IPSecVPN有两种工作模式:

tunnel模式和transport模式,实际上真正建立隧道的只有tunnel模式,因为在当工作在transport模式的时候IPSecVPN是需要依赖其他协议来建立底层隧道的,比如说利用GRE来建立隧道。

但是IPSecVPN自己建立的隧道存在一定的局限性:

tunnel隧道的数据包会额外增加20字节,不支持非IP协议的流量,不支持IP组播,隧道两端的IP是位于不同网段的公网IP。

由于这些原因,导致如果想要在IPSecVPN的隧道两端想要运行动态路由协议成为奢望。

GRE建立的隧道两端的隧道地址是在同一个网段的,并且可以提供IP组播的支持;这样在为IPSecVPNtransport模式建立隧道同时GRE也能支持IP组播,这样就能够在隧道两端运行动态路由协议。

缺点:

由于GRE的局限性,P2PGREoverIPSecVPN只能在两个端点之间运行。

二、StaticP2PGREoverIPSec

特点

隧道两端的IP固定

配置

r1#showrunning-config

Buildingconfiguration...

Currentconfiguration:

1131bytes

!

version12.4以12.2(13)T为界限,之前的版本要在物理接口和

GRE接口下同时应用cryptomap,之后的只要在物

理接口下应用

servicetimestampsdebugdatetimemsec

servicetimestampslogdatetimemsec

noservicepassword-encryption

!

hostnamer1

!

boot-start-marker

boot-end-marker

!

!

noaaanew-model

memory-sizeiomem5

!

!

ipcef

!

!

cryptoisakmppolicy1步骤2

encr3des开始配置IPSecVPN

authenticationpre-share

group2

cryptoisakmpkey0ciscoaddress23.23.23.3步骤3

配置对端认证密钥

!

!

cryptoipsectransform-setMTesp-3desesp-sha-hmac步骤4

配置转换集

!

cryptomapMMAP1ipsec-isakmp步骤6

setpeer23.23.23.3配置cryptomap

settransform-setMT

matchaddressVPN

!

!

interfaceTunnel1步骤1

ipaddress1.1.1.1255.255.255.0先在两端建立GRE隧道

tunnelsource12.12.12.1

tunneldestination23.23.23.3

!

interfaceFastEthernet0/0步骤7

ipaddress12.12.12.1255.255.255.0在物理接口下应用

duplexauto

speedauto

cryptomapMMAP

!

interfaceFastEthernet1/0

ipaddress10.1.1.1255.255.255.0

duplexauto

speedauto

!

routerrip步骤8

network1.0.0.0配置路由协议

network10.0.0.0注意通告的接口是私网和GRE的接

!

口地址

iphttpserver

noiphttpsecure-server

!

iproute0.0.0.00.0.0.012.12.12.2

!

!

!

ipaccess-listextendedVPN步骤5

permitgrehost12.12.12.1host23.23.23.3配置感兴趣数据流,注意这里匹配的

地址!

!

这里只匹配GRE隧道的两端物理地

!

这样才能将GRE隧道和IPSecVPN关

control-plane联在一起,用户的数据则使用路由协

!

议进行传输

!

linecon0

lineaux0

linevty04

!

!

end

三、DynamicP2PGREoverIPSec

特点

隧道

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 教育学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1