Cisco ASA iPhone VPN Config

I recently purchased a shiny new iPhone 3G and wanted to be able to connect back to my house where I have a Cisco ASA 5505.  I have noticed a lot of questions about how to get this to work, so here it is…

 

First, make sure you are running ASA Software version 8.0(3) or better. The previous versions have a bug when the iPhone connects that will boot all other users connected to the VPN.

 

On the ASA, we need to get the VPN configured.  First, the ACLs for split-tunneling, no NAT and VPN access:

access-list RA_VPN_ACL extended permit ip any 172.30.30.0 255.255.255.0
access-list RA_VPN_SplitTunnel_ACL standard permit 172.25.25.0 255.255.255.0
access-list NoNAT_ACL extended permit ip 172.25.25.0 255.255.255.0 172.30.30.0 255.255.255.0
nat (inside) 0 access-list NoNAT_ACL

 

Since this config will authenticate to the local ASA, we need to have a username and password setup:

username iPhone password your_password

 

Now setup a DHCP pool for VPN clients:

ip local pool RA_VPN_POOL 172.30.30.100-172.30.30.200

 

Now create the crypto maps and apply them to the outside interface:

crypto ipsec transform-set RA_VPN_SET esp-aes esp-sha-hmac
crypto dynamic-map RA_VPN_MAP 1 match address RA_VPN_ACL
crypto dynamic-map RA_VPN_MAP 1 set transform-set RA_VPN_SET
crypto dynamic-map RA_VPN_MAP 1 set reverse-route
crypto map RA_VPN 65535 ipsec-isakmp dynamic RA_VPN_MAP
crypto map RA_VPN interface outside

 

Setup ISAKMP:

crypto isakmp enable outside
crypto isakmp policy 65535
  authentication pre-share
  encryption 3des
  hash sha
  group 2
  lifetime 86400
crypto isakmp nat-traversal 20

 

Now create a remote access VPN policy. Make sure to add the split-dns value for your local domian. If you leave this out, the iPhone will not resolve DNS on the internal network!

group-policy RA_VPN_Policy internal
group-policy RA_VPN_Policy attributes
  dns-server value DNS_Server_IP
  vpn-tunnel-protocol IPSec
  split-tunnel-policy tunnelspecified
  split-tunnel-network-list value RA_VPN_SplitTunnel_ACL
  split-dns value domain.local

 

Add the tunnel-group to allow the VPN connection:

tunnel-group RA_VPN type ipsec-ra
tunnel-group RA_VPN general-attributes
  address-pool RA_VPN_POOL
  default-group-policy RA_VPN_Policy
tunnel-group RA_VPN ipsec-attributes
  pre-shared-key your_password

 

Now to configure the iPhone. First, go to Settings -> General -> Network -> VPN. Then Add VPN Configuration. Select IPSec at the top and enter your information. The Server is the IP address or hostname of the ASA. The Account is the Username you created in the config above. The Group Name is the tunnel-group name created on the ASA.

 

iPhone VPN Config

 

 

iPhone VPN Config

 

iPhone VPN Config

 

 

To connect the VPN, go to Settings -> VPN (this appears after you create a VPN connection).  Just change the option to ON.

iPhone VPN Config

 

 

iPhone VPN Config

 
iPhone VPN Config 

 

Once you see the VPN icon on the top bar, you are connected!

 

 


11 Responses to “Cisco ASA iPhone VPN Config”


  1. 1 Magnus Jan 30th, 2010 at 4:15 pm

    Nope didn’t work, but a nice initiative.

  2. 2 Kablooie Feb 11th, 2010 at 1:17 pm

    I have no problems with a similar conf on my asa5510 except the internal dns lookup does not work.

  3. 3 Aleksey Aug 11th, 2010 at 8:20 am

    I have no problems too. I`ve iphone 3gs os 4.0.1 and ASA 5505!!! Thank you!

  4. 4 Moeabm Oct 13th, 2010 at 1:18 pm

    This is simply beautiful. haha

  5. 5 Rob May 23rd, 2011 at 9:22 am

    Can somebody translate this to the ASA 8.0.x software? In particular, the no-nat line:

    nat (inside) 0 access-list NoNAT_ACL

    Thanks…

  6. 6 Josue Garcia May 24th, 2011 at 3:42 pm

    I’ve try to put working with mac osx vs cisco asa 5505

    I have no problems with ipsec, but I cant cross any traffic from mac network 172.30.30.0 to remote network 192.168.82.0, this is my conf, any ideas?

    ASA Version 8.2(2)
    !
    hostname ciscoasa
    domain-name domain.local
    names
    !
    interface Vlan1
    nameif inside
    security-level 100
    ip address 192.168.82.2 255.255.255.0
    !
    interface Vlan2
    nameif outside
    security-level 0
    ip address XXX.XXX.XXX.XXX 255.255.255.248
    !
    interface Ethernet0/0
    switchport access vlan 2
    !
    interface Ethernet0/1
    !
    interface Ethernet0/2
    !
    interface Ethernet0/3
    !
    interface Ethernet0/4
    !
    interface Ethernet0/5
    !
    interface Ethernet0/6
    !
    interface Ethernet0/7
    !
    ftp mode passive
    dns server-group DefaultDNS
    domain-name domain.local
    access-list RA_VPN_ACL extended permit ip 192.168.82.0 255.255.255.0 172.30.30.0 255.255.255.0
    access-list RA_VPN_SplitTunnel_ACL standard permit 192.168.82.0 255.255.255.0
    access-list NoNAT_ACL extended permit ip 192.168.82.0 255.255.255.0 172.30.30.0 255.255.255.0
    access-list inside_access_in extended permit ip 172.30.30.0 255.255.255.0 interface inside
    pager lines 24
    logging asdm informational
    mtu inside 1500
    mtu outside 1500
    ip local pool RA_VPN_POOL 172.30.30.100-172.30.30.200 mask 255.255.255.0
    icmp unreachable rate-limit 1 burst-size 1
    no asdm history enable
    arp timeout 14400
    global (outside) 1 interface
    nat (inside) 0 access-list NoNAT_ACL
    nat (inside) 1 0.0.0.0 0.0.0.0
    access-group inside_access_in in interface inside
    !
    router ospf 1
    log-adj-changes
    !
    route outside 0.0.0.0 0.0.0.0 200.66.64.209 1
    route inside 192.168.70.0 255.255.255.0 192.168.82.1 1
    route inside 192.168.72.0 255.255.255.128 192.168.82.1 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
    dynamic-access-policy-record DfltAccessPolicy
    aaa authentication ssh console LOCAL
    aaa authentication http console LOCAL
    http server enable
    http 192.168.72.0 255.255.255.128 inside
    no snmp-server location
    no snmp-server contact
    snmp-server enable traps snmp authentication linkup linkdown coldstart
    crypto ipsec transform-set RA_VPN_SET esp-aes esp-sha-hmac
    crypto ipsec security-association lifetime seconds 28800
    crypto ipsec security-association lifetime kilobytes 4608000
    crypto dynamic-map RA_VPN_MAP 1 set transform-set RA_VPN_SET
    crypto dynamic-map RA_VPN_MAP 1 set reverse-route
    crypto map RA_VPN 65535 ipsec-isakmp dynamic RA_VPN_MAP
    crypto map RA_VPN interface outside
    crypto isakmp enable outside
    crypto isakmp policy 65535
    authentication pre-share
    encryption 3des
    hash sha
    group 2
    lifetime 86400
    telnet timeout 5
    ssh 0.0.0.0 0.0.0.0 inside
    ssh timeout 5
    ssh version 2
    console timeout 0
    dhcpd auto_config outside
    !

    threat-detection basic-threat
    threat-detection statistics access-list
    no threat-detection statistics tcp-intercept
    webvpn
    group-policy RA_VPN_Policy internal
    group-policy RA_VPN_Policy attributes
    dns-server value 4.2.2.2
    vpn-tunnel-protocol IPSec
    split-tunnel-policy tunnelspecified
    split-tunnel-network-list value RA_VPN_SplitTunnel_ACL
    split-dns value domain.local
    username telecom password 8o9dUfeQPbbWT8FE encrypted privilege 15
    username hespinosag password 8uJIq3lW8r1VHOG. encrypted
    tunnel-group RA_VPN type remote-access
    tunnel-group RA_VPN general-attributes
    address-pool RA_VPN_POOL
    default-group-policy RA_VPN_Policy
    tunnel-group RA_VPN ipsec-attributes
    pre-shared-key *****
    !
    class-map inspection_default
    match default-inspection-traffic
    !
    !
    policy-map type inspect dns preset_dns_map
    parameters
    message-length maximum client auto
    message-length maximum 512
    policy-map global_policy
    class inspection_default
    inspect dns preset_dns_map
    inspect ftp
    inspect h323 h225
    inspect h323 ras
    inspect rsh
    inspect rtsp
    inspect esmtp
    inspect sqlnet
    inspect skinny
    inspect sunrpc
    inspect xdmcp
    inspect sip
    inspect netbios
    inspect tftp
    inspect ip-options
    !
    service-policy global_policy global
    prompt hostname context
    Cryptochecksum:d41d8cd98f00b204e9800998ecf8427e
    : end
    ciscoasa#

  7. 7 Brendan Aug 10th, 2011 at 3:35 pm

    @Rob: the “inside” part of the command refers to the name of the inside-facing interface on the ASA. For us, it’s “internal” – so I entered “nat (internal) 0 access-list NoNAT_ACL” instead of what’s above. We’re running 8.2.5, btw.

  8. 8 ced Oct 31st, 2011 at 3:12 am

    Hello,

    Thanks for this détailed Tutorial !!

    But now I’am in 8.4(1) and the “nat (internal) 0 access-list NoNAT_ACL” command is no longer usable.

    Please, what synthax is correct for replacing the old one ?

    thank you,

    Ced,

  9. 9 fl Nov 22nd, 2011 at 6:21 am

    if you get connection but no traffic split tunnel is the problem so remote that ACL, my input to this config :)

  10. 10 dave Dec 14th, 2011 at 9:08 am

    You dont have to have ANYconnect lics do you for basic set up like this

  1. 1 Store VPN password on iPhone (3.0) IPSec Client Pingback on Oct 2nd, 2010 at 3:44 am

Leave a Reply