Cisco ASA で AnyConnect 用のコンフィグをメモしておきます。ASA は 9.6(2) を使いました。
検証環境
- WAN 回線は PPPoE 接続
- DNS は Google DNS を利用
- NTP は Google NTP を利用
- AnyConnect はローカル認証(RADIUS や LDAP、クライアント証明書は利用しない)
- AnyConnect 接続時の SSL/TLS サーバ証明書は、ASA の自己証明書を利用
- AnyConnect 接続時はトンネルグループを選択させない
基本的な設定
パラメータ
項目 | 値 |
---|---|
ホスト名 | asa |
ドメイン名 | example.local |
PPPoE 接続ユーザ | PPPoE-USER@DOMAIN |
PPPoE 接続パスワード | PPPoE-PASS |
outside インターフェイス | GigabitEthernet1/1 |
outside アドレス | (PPPoE 接続時、動的に決定) |
inside インターフェイス | GigabitEthernet1/2 |
inside アドレス | 172.31.98.253/24 |
DNS サーバ 1 | 8.8.8.8 |
DNS サーバ 2 | 8.8.4.4 |
NTP サーバ 1 | 216.239.35.0 |
NTP サーバ 2 | 216.239.35.4 |
NTP サーバ 3 | 216.239.35.8 |
NTP サーバ 4 | 216.239.35.12 (優先) |
コンフィグ
hostname asa domain-name example.local ! username ADMIN password ADMIN-PASS privilege 15 ! vpdn group VPDN-GROUP request dialout pppoe vpdn group VPDN-GROUP localname PPPoE-USER@DOMAIN vpdn group VPDN-GROUP ppp authentication chap vpdn username PPPoE-USER@DOMAIN password PPPoE-PASS ! interface GigabitEthernet1/1 nameif outside security-level 0 pppoe client vpdn group VPDN-GROUP ip address pppoe setroute no shutdown ! interface GigabitEthernet1/2 nameif inside security-level 100 ip address 172.31.98.253 255.255.255.0 no shutdown ! clock timezone JST 9 ! dns domain-lookup outside dns server-group DefaultDNS name-server 8.8.8.8 outside name-server 8.8.4.4 outside domain-name example.local ! no pager logging enable ! mtu outside 1454 ! route inside 172.16.0.0 255.240.0.0 172.31.98.254 1 ! object network OBJ_LAN subnet 172.16.0.0 255.240.0.0 nat (inside,outside) dynamic interface ! aaa authentication ssh console LOCAL ! ssh 172.16.0.0 255.240.0.0 inside ssh timeout 60 ssh version 2 console timeout 60 ! ntp server 216.239.35.0 ntp server 216.239.35.4 ntp server 216.239.35.8 ntp server 216.239.35.12 prefer ! policy-map global_policy class inspection_default inspect icmp ! no service call-home clear config call-home ! end
SSH 接続用 RSA 鍵の生成
SSH 接続を受け入れる為に RSA 鍵を生成しておきます。
asa(config)# crypto key generate rsa modulus 2048 WARNING: You have a RSA keypair already defined named <Default-RSA-Key>. Do you really want to replace them? [yes/no]: yes Keypair generation process begin. Please wait...
AnyConnect の設定
パラメータ
項目 | 値 |
---|---|
AnyConnect クライアント用アドレス範囲 | 192.168.250.100 〜 199/24 |
ASA の LAN 側を集約したアドレス | 172.16.0.0/12 |
AnyConnect 接続ユーザ | USER1 |
AnyConnect 接続パスワード | USER1-PASS |
コンフィグ
ip local pool POOL_ANYCONNECT 192.168.250.100-192.168.250.199 mask 255.255.255.0 ! object network OBJ_POOL_ANYCONNECT subnet 192.168.250.0 255.255.255.0 ! nat (inside,outside) source static OBJ_LAN OBJ_LAN destination static OBJ_POOL_ANYCONNECT OBJ_POOL_ANYCONNECT ! access-list ACL_OUTSIDE-TO-INSIDE extended permit icmp any4 any4 time-exceeded access-list ACL_OUTSIDE-TO-INSIDE extended permit icmp any4 any4 unreachable access-list ACL_OUTSIDE-TO-INSIDE extended permit ip object OBJ_POOL_ANYCONNECT object OBJ_LAN ! access-group ACL_OUTSIDE-TO-INSIDE in interface outside ! access-list ACL_SPLIT_TUNNEL extended permit ip object OBJ_LAN any ! webvpn enable outside anyconnect image disk0:/anyconnect-win-4.2.04039-k9.pkg 1 anyconnect image disk0:/anyconnect-macosx-i386-4.2.04039-k9.pkg 2 anyconnect enable ! group-policy POLICY_ANYCONNECT internal group-policy POLICY_ANYCONNECT attributes vpn-tunnel-protocol ssl-client split-tunnel-policy tunnelspecified split-tunnel-network-list value ACL_SPLIT_TUNNEL ! tunnel-group DefaultWEBVPNGroup general-attributes address-pool POOL_ANYCONNECT default-group-policy POLICY_ANYCONNECT tunnel-group DefaultWEBVPNGroup webvpn-attributes group-alias SSL-VPN enable ! username USER1 password USER1-PASS username USER1 attributes service-type remote-access ! end