ガジェットとカメラ生活

2011年9月3日土曜日

Cisco ASAとiPhone, iPadをVPN接続


iPhoneとiPad,iPod touchにはVPN接続する機能が標準で内蔵されています。接続方法はIPSec, L2TP/IPSec, PPTPがあります。VPN接続を行うことで社内や家のサーバへ、通信を暗号化しつつ安全にアクセスできるようになります。以下はIPSec接続時のASAの設定例です。

-->
ASA Version 8.0(5)
!
hostname ciscoasa
!
interface Vlan1
 nameif inside
 security-level 100
 ip address 192.168.1.1 255.255.255.0
!
interface Vlan2
 nameif outside
 security-level 0
 pppoe client vpdn group NTT
 ip address pppoe setroute
!
interface Vlan3
 no forward interface Vlan1
 nameif DMZ  
 security-level 50
 no ip address
!
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
!
boot system disk0:/asa805-k8.bin
ftp mode passive
clock timezone JST 9
dns domain-lookup inside
dns domain-lookup outside
! スプリットトンネリングの設定
access-list SPLIT_TUNNEL standard permit 192.168.1.0 255.255.255.0
! IPSec通信のNAT除外ルールのACL
access-list no_nat_vpn extended deny ip host 192.168.1.255 192.168.10.0 255.255.255.0
access-list no_nat_vpn extended permit ip 192.168.1.0 255.255.255.0 192.168.10.0 255.255.255.0
pager lines 24
mtu inside 1500
mtu outside 1454
mtu DMZ 1500
! IPSecクライアントへ割り当てるアドレスのプール
ip local pool VPN_POOL 192.168.10.1-192.168.10.10 mask 255.255.255.0
global (outside) 1 interface
nat (inside) 0 access-list no_nat_vpn
nat (inside) 1 0.0.0.0 0.0.0.0
! IPSecの設定
crypto ipsec transform-set IPSEC esp-aes esp-sha-hmac
crypto ipsec security-association lifetime seconds 28800
crypto ipsec security-association lifetime kilobytes 4608000
crypto dynamic-map DMAP 1 set transform-set IPSEC
crypto map CMAP 1 ipsec-isakmp dynamic DMAP
crypto map CMAP interface outside
! ISAKMPの設定
crypto isakmp identity address
crypto isakmp enable outside
crypto isakmp policy 1
 authentication pre-share
 encryption aes
 hash sha
 group 2
 lifetime 86400
vpdn group NTT request dialout pppoe
vpdn group NTT localname *****
vpdn group NTT ppp authentication chap
vpdn username ***** password *********
! GroupPolicyの設定
group-policy GP internal
group-policy GP attributes
 vpn-tunnel-protocol IPSec l2tp-ipsec svc webvpn
 split-tunnel-policy tunnelspecified
 split-tunnel-network-list value SPLIT_TUNNEL
 default-domain value local
 split-dns value local
 address-pools value VPN_POOL
! TunnelGroupの設定
tunnel-group TG type remote-access
tunnel-group TG general-attributes
 default-group-policy GP
tunnel-group TG ipsec-attributes
 pre-shared-key *
!

iPhone側での設定

設定 > 一般 > ネットワーク > VPN からVPN構成を追加を選択。IPSecを選択し必要項目を入力。




VPNをオンにするとユーザ名とパスワード入力画面がでます。



入力後VPN接続が完了します。



ラベル: ,