采用積極模式并PSK的IPsec VPN配置
作者:紅頭發(fā)
對于IPsec VPN的概念我們已經有所了解了,那么對其配置我們還是需要掌握一下。所以現(xiàn)在我們就來講解一下有關于IPsec VPN配置的內容。
在前面篇中,我們介紹了基于PSK的IPsec VPN配置的相關信息,接下來,我們繼續(xù)講解關于采用積極模式并PSK的IPsec VPN配置的內容。
1.R1基本配置:
- R1(config)#interface loopback0
- R1(config-if)#ip address 10.1.1.1 255.255.255.0
- R1(config-if)#no shutdown
- R1(config-if)#interface serial0/0
- R1(config-if)#ip address 192.168.1.1 255.255.255.252
- R1(config-if)#clock rate 56000
- R1(config-if)#no shutdown
- R1(config-if)#exit
2.定義感興趣流量與路由協(xié)議:
- R1(config)#access-list 100 permit ip 10.1.1.0 0.0.0.255 10.2.2.0 0.0.0.255
- R1(config)#ip route 0.0.0.0 0.0.0.0 serial0/0
3.全局啟用ISAKMP并定義對等體及其PSK(預共享密鑰),采用積極模式:
- R1(config)#crypto isakmp enable
- R1(config)#crypto isakmp peer address 192.168.1.2
- R1(config-isakmp-peer)#set aggressive-mode client-endpoint ipv4-address 192.168.1.1
- R1(config-isakmp-peer)#set aggressive-mode password 91lab
4.定義IKE策略:
- R1(config)#crypto isakmp policy 10
- R1(config-isakmp)#encryption aes 128 /---默認是DES加密---/
- R1(config-isakmp)#hash sha /---默認是SHA-1---/
- R1(config-isakmp)#authentication pre-share
- R1(config-isakmp)#group 2 /---默認是768位的DH1---/
- R1(config-isakmp)#lifetime 3600 /---默認是86400秒---/
- R1(config-isakmp)#exit
5.定義IPSec轉換集(transform set):
- R1(config)#crypto ipsec transform-set tt esp-aes 128 esp-sha-hmac
- R1(cfg-crypto-trans)#mode tunnel
- R1(cfg-crypto-trans)#exit
6.定義crypto map并應用在接口上:
- R1(config)#crypto map cisco 10 ipsec-isakmp
- R1(config-crypto-map)#match address 100
- R1(config-crypto-map)#set peer 192.168.1.2 /---定義要應用crypto map的對等體地址---/
- R1(config-crypto-map)#set transform-set tt /---定義crypto map要應用的IPsec轉換集---/
- R1(config-crypto-map)#exit
- R1(config)#interface serial0/0
- R1(config-if)#crypto map cisco
- *Mar 1 00:08:31.131: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON
- R1(config-if)#end
- R1#
R1配置完成.
同理,R2配置如下:
- !
- !
- crypto isakmp policy 10
- encr aes
- authentication pre-share
- group 2
- !
- crypto isakmp peer address 192.168.1.1
- set aggressive-mode password 91lab
- set aggressive-mode client-endpoint ipv4-address 192.168.1.1
- !
- !
- crypto ipsec transform-set tt esp-aes esp-sha-hmac
- !
- crypto map cisco 10 ipsec-isakmp
- set peer 192.168.1.1
- set transform-set tt
- match address 100
- !
- !
- !
- !
- interface Loopback0
- ip address 10.2.2.1 255.255.255.0
- !
- interface Serial0/0
- ip address 192.168.1.2 255.255.255.252
- crypto map cisco
- !
- ip route 0.0.0.0 0.0.0.0 Serial0/0
- !
- access-list 100 permit ip 10.2.2.0 0.0.0.255 10.1.1.0 0.0.0.255
- !
責任編輯:佟健
來源:
51CTO整理