VPN实例
配置只有这里的对端IP不一样)
routerB(config-crypto-map)#set transform-set test routerB(config-crypto-map)#match address 101 4 把crypto map 的名字应用到端口
routerA(config)#inter s0/0 (进入应用VPN的接口)
routerA(config-if)#crypto map testmap (testmap:crypto map的名字)
B路由和A完全一样
查看VPN的配置 查看安全联盟(SA)
Router#show crypto ipsec sa 显示crypto map 内的所有配置 router#show crypto map 查看优先级
router#show crypto isakmp policy 没做vpn之前 r1 en conf t int fa0/0
ip add 2.2.2.1 255.255.255.0 no shu int fa1/0
ip add 1.1.1.1 255.255.255.0 no shu exit
ip route 3.3.3.0 255.255.255.0 1.1.1.2 end r2 en conf t int fa 1/0
ip add 1.1.1.2 255.255.255.0 no shu int fa0/0
ip add 3.3.3.1 255.255.255.0 no shu exit
ip route 2.2.2.0 255.255.255.0 1.1.1.1 end vpc 1
ip 2.2.2.2 2.2.2.1 24 2
ip 3.3.3.2 3.3.3.1 24
交换机抓包 默认可以抓自己接收或者发送的报文,以及广播报文 如果想抓另外两台机子通信的内容,应该做端口镜像 命令如下 en conf t
monitor session 1 source int fa0/0 monitor session 1 destination int fa0/2
两台路由器之间做ipsec vpn后 r1 en conf t
crypto isakmp enable crypto isakmp policy 1 authentication pre-share hash md5 encryption 3des lifetime 86400 exit
crypto isakmp key benet add 1.1.1.2
crypto ipsec transform-set test ah-md5 esp-aes exit
access-list 100 permit ip 2.2.2.0 0.0.0.255 3.3.3.0 0.0.0.255 crypto map cisco 1 ipsec-isakmp match add 100 set peer 1.1.1.2 set transform-set test exit int fa1/0
crypto map cisco end
r2 en conf t
crypto isakmp enable crypto isakmp policy 1 authentication pre-share hash md5 encryption 3des lifetime 86400 exit
crypto isakmp key benet add 1.1.1.1
crypto ipsec transform-set test ah-md5 esp-aes exit
access-list 100 permit ip 3.3.3.0 0.0.0.255 2.2.2.0 0.0.0.255 crypto map cisco 1 ipsec-isakmp match add 100 set peer 1.1.1.1 set transform-set test exit int fa1/0
crypto map cisco end
因篇幅问题不能全部显示,请点此查看更多更全内容