实验拓扑如图:R2和ASA分别代表出口,上面同时启用NAT上网,和做ipsec vpn
R2模拟公网,只起ip,不配置任何路由,R3,R4模拟内网主机。
主要启用ikev1 来配置vpn。
R2#show run
Building configuration...
Current configuration : 1658 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
ip subnet-zero
no ip icmp rate-limit unreachable
ip cef
ip tcp synwait-time 5
!
!
no ip dhcp use vrf connected
!
!
no ip domain lookup
no ip ips deny-action ips-interface
crypto isakmp policy 1
encr 3des
authentication pre-share
group 2
crypto isakmp key cisco address 200.1.1.2 ####指定对端地址及密钥交换认证密钥####
!
!
crypto ipsec transform-set A-TO-B esp-3des esp-sha-hmac ###指定转换指令集###
!
crypto map |2| 1 ipsec-isakmp ####加密map |2| 的第一组策略####
set peer 200.1.1.2 ####×××对端地址####
set transform-set A-TO-B ####匹配指令转换####
match address ××× ####匹配感兴趣的流量####
#######此处为vpn配置部分######
!
interface FastEthernet0/0
no ip address
shutdown
duplex half
!
interface FastEthernet1/0
ip address 10.1.1.2 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface FastEthernet1/1
ip address 100.1.1.2 255.255.255.0
ip nat outside
ip virtual-reassembly
duplex auto
speed auto
crypto map |2| #######应用到接口#######
!
ip classless
ip route 0.0.0.0 0.0.0.0 100.1.1.1
no ip http server
no ip http secure-server
!
!
ip nat inside source list NAT interface FastEthernet1/1 overload
!
ip access-list extended NAT
deny ip 10.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255
permit ip any any
ip access-list extended ×××
permit ip 10.1.1.0 0.0.0.255 192.168.1.0 0.0.0.255
###此处为nat 部分,还有定义了vpn的感兴趣的流量。###
!
no cdp log mismatch duplex
!
!
!
!
control-plane
!
!
!
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
!
!
end
R2#
ciscoasa(config)# show run
: Saved
:
ASA Version 8.4(2)
!
hostname ciscoasa
enable password 8Ry2YjIyt7RRXU24 encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
!
interface GigabitEthernet0
nameif outside
security-level 0
ip address 200.1.1.2 255.255.255.0
!
interface GigabitEthernet1
nameif inside
security-level 100
ip address 192.168.1.1 255.255.255.0
!
interface GigabitEthernet2
shutdown
no nameif
no security-level
no ip address
!
interface GigabitEthernet3
shutdown
no nameif
no security-level
no ip address
!
ftp mode passive
object network inside-outside-all
subnet 0.0.0.0 0.0.0.0
object network facB
subnet 192.168.1.0 255.255.255.0
object network facA
subnet 10.1.1.0 255.255.255.0
access-list acl_in extended permit ip any interface outside
access-list acl_in extended permit icmp any any
access-list vpn extended permit ip 192.168.1.0 255.255.255.0 10.1.1.0 255.255.255.0
access-list nat extended permit ip any any
pager lines 24
mtu outside 1500
mtu inside 1500
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
nat (inside,outside) source static facB facB destination static facA facA
#####nat 不转换的配置#####
!
object network inside-outside-all
nat (inside,outside) dynamic interface
###### PAT 配置 ######
access-group acl_in in interface outside
route outside 0.0.0.0 0.0.0.0 200.1.1.1 1
route inside 192.168.2.0 255.255.255.0 192.168.1.4 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
timeout floating-conn 0:00:00
dynamic-access-policy-record DfltAccessPolicy
user-identity default-domain LOCAL
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart warmstart
crypto ipsec ikev1 transform-set B-TO-A esp-3des esp-sha-hmac
crypto map |2| 1 match address vpn
crypto map |2| 1 set peer 100.1.1.2
crypto map |2| 1 set ikev1 transform-set B-TO-A
crypto map |2| interface outside
crypto ikev1 enable outside
crypto ikev1 policy 1
authentication pre-share
encryption 3des
hash sha
group 2
lifetime 86400
crypto ikev1 policy 65535
authentication pre-share
encryption 3des
hash sha
group 2
lifetime 86400
telnet timeout 5
ssh timeout 5
console timeout 0
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
tunnel-group 100.1.1.2 type ipsec-l2l
tunnel-group 100.1.1.2 ipsec-attributes
ikev1 pre-shared-key *****
######指定对端地址及密钥交换认证密钥#####
!
!
prompt hostname context
call-home reporting anonymous prompt 2
call-home
profile CiscoTAC-1
no active
destination address http https://tools.cisco.com/its/service/oddce/services/DDCEService
destination address email callhome@cisco.com
destination transport-method http
subscribe-to-alert-group diagnostic
subscribe-to-alert-group environment
subscribe-to-alert-group inventory periodic monthly
subscribe-to-alert-group configuration periodic monthly
subscribe-to-alert-group telemetry periodic daily
crashinfo save disable
Cryptochecksum:a59c87549d36768a2bceacc594e971a6
: end
ciscoasa(config)#
其他设备配置省略。