网络拓扑如下:
4台3640的路由器 其中两台模拟PC机!
实现50.50.50.0网段和60.60.60.0网段间的VPN连接
pc1:
en
conf t
no ip routing (关闭路由功能)
host pc1
inter f0/0
ip add 50.50.50.1 255.255.255.0
end
wr
PC2:
en
config t
no ip routing (关闭路由功能)
host PC2
inter f0/0
ip add 60.60.60.1 255.255.255.0
no sh
rA:
en
config t
host RA
inter f0/0
ip add 50.50.50.50 255.255.255.0
no sh
exit
inter f1/0
ip add 20.20.20.21 255.255.255.0
no sh
exit
router rip
ver 2
no au
net 50.50.50.0
net 20.20.20.0
end
wr
RB::
en
config t
host RB
inter f1/0
ip add 20.20.20.20 255.255.255.0
no shut
exit
inter f0/0
ip add 60.60.60.60 255.255.255.0
no shut
exit
router rip
ver 2
no au
net 20.20.20.0
net 60.60.60.0
end
wr
实现全网互通。
RA(cnfig)#crypto isakmp policy 1 建立IKE协商策略编号为1
RA(config-isakmp)# hash md5 运用的HASH算法
RA(config-isakmp)#authentication pre-share 共享密钥
RA(config)#crypto isakmp key 0 lxy add 20.20.20.20 设置共享密码和对端IP地址
RA(config)#access-list 100 permit ip host 50.50.50.1 host 60.60.60.1 设置50.50.50.1去60.60.60.1的报文加密
RA(config)#crypto ipsec transform-set lxy ah-md5-hmac esp-des 配制传输模式 认证和加密
RA(cfg-crypto-trans)#exit
RA(config)#crypto map xx 1 ipsec-isakmp 采用自动协商
% NOTE: This new crypto map will remain disabled until a peer
and a valid access list have been configured.
RA(config-crypto-map)#set peer 20.20.20.20 对应VPN链路对端的IP地址
RA(config-crypto-map)#set transform-set lxy 用协商好的传输模式名称
RA(config-crypto-map)#match address 100 访问控制列表和前面配制的要一致
RA(config-crypto-map)#exit
RA(config)#inter f1/0
RA(config-if)#crypto map xx 应用到接口上
*Mar 1 00:17:18.067: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON VPN生效
当R1配制好VPN,而R2没配制好的时候,50.1和60.1是不能通信的