センタ側 | 192.0.2.1 |
拠点側 | 192.0.2.10 |
IPsecの対象とする中継パケット | 192.168.1.0/24 ⇔ 192.168.2.0/24 |
IPsec Phase1ポリシー |
認証方式 ・・・ 事前共有鍵方式 暗号化方式 ・・・ AES 256ビット ハッシュ方式 ・・・ SHA-256 Diffie-Hellman ・・・ Group 14 IKE SAライフタイム ・・・ 86400秒 IKE SAソフトリミット ・・・ 30秒(拠点のみ) (リキー衝突回避のため拠点のみ設定) |
IPsec Phase2ポリシー |
PFS ・・・ Group 14 暗号化方式 ・・・ AES 256ビット ハッシュ方式 ・・・ SHA-256 IPsec SAライフタイム ・・・ 28800秒 |
項目 | センタ(F220) | 拠点(F220) |
WANインターフェース | interface GigaEthernet 2/1 ※ | interface GigaEthernet 2/1 ※ |
インターフェース名 | pppoe enable | pppoe enable |
VLAN-ID値 | vlan-id 2 | vlan-id 2 |
ブリッジグループ番号 | bridge-group 2 | bridge-group 2 |
インターフェース設定 | interface Tunnel 1 | interface Tunnel 1 |
PPPoE プロファイル | PPPOE_PROF | PPPOE_PROF |
PPPoE プロファイル設定 | pppoe profile PPPOE_PROF | pppoe profile PPPOE_PROF |
LANインターフェース | interface GigaEthernet 1/1 ※ | interface GigaEthernet 1/1 ※ |
インターフェース名 | channel-group 1 | channel-group 1 |
VLAN-ID値 | vlan-id 1 | vlan-id 1 |
ブリッジグループ番号 | bridge-group 1 | bridge-group 1 |
インターフェース設定 | interface Port-channel 1 | interface Port-channel 1 |
項目 | センタ(F220) | 拠点(F220) |
インターフェース設定 | interface Tunnel 2 | interface Tunnel 2 |
マップ名 | KYOTEN | CENTER |
マップ設定 | crypto map KYOTEN ipsec-isakmp | crypto map CENTER ipsec-isakmp |
セレクタ名 | SELECTOR | SELECTOR |
ISAKMP プロファイル | PROF0001 | PROF0001 |
セレクタ設定 (VPN対象パケット) |
crypto ipsec selector SELECTOR | crypto ipsec selector SELECTOR |
ISAKMP プロファイル設定 | crypto isakmp profile PROF0001 | crypto isakmp profile PROF0001 |
ISAKMP ポリシー名 | P1-POLICY | P1-POLICY |
IPSEC ポリシー名 | P2-POLICY | P2-POLICY |
対向装置の識別方法設定 | match identity user id-kyoten | match identity user center |
本装置の識別方法設定 | self-identity user-fqdn center | self-identity user-fqdn id-kyoten |
ISAKMP ポリシー設定 | crypto isakmp policy P1-POLICY | crypto isakmp policy P1-POLICY |
IPSEC ポリシー設定 | crypto ipsec policy P2-POLICY | crypto ipsec policy P2-POLICY |
! ! ! 特権ユーザモードに移行します。 ! > enable password: super *4 ←パスワードを入力します。(実際は表示されない) ! ! ! 基本設定モードに移行します。 ! # configure terminal (config)# ! ! ! デフォルトルートを tunnel 1(PPPoE) に設定します。 ! (config)# ip route 0.0.0.0 0.0.0.0 tunnel 1 ! ! ! 拠点宛の経路情報をtunnel 2(IPsecトンネル)に設定します。 ! (config)# ip route 192.168.2.0 255.255.255.0 tunnel 2 ! ! ! ! NAT で変換対象とする送信元アドレス ! (ここではLAN 側アドレスを対象とします)を登録します。 ! (config)# ip nat list 1 192.168.1.0 0.0.0.255 ! ! ! Port-channel にLAN側IPアドレスを設定します。 ! (config)# interface Port-channel 1 (config-if-ch 1)# ip address 192.168.1.254 255.255.255.0 (config-if-ch 1)# mss 1300 (config-if-ch 1)# exit ! ! ! PPPoEの設定をします。 ! プロバイダから指定された 認証ID、パスワードなどを設定します。 ! (config)# pppoe profile PPPOE_PROF (config-pppoe-profile PPPOE_PROF)# account abc012@***.***.ne.jp xxxyyyzzz (config-pppoe-profile PPPOE_PROF)# exit ! ! ! Tunnel インタフェース設定モードに移行します。 ! (config)# interface Tunnel 1 ! ! ! プロバイダから指定された IPアドレスなどを設定します。 ! (config-if-tun 1)# description FLETS (config-if-tun 1)# ip address 192.0.2.1 255.255.255.255 ! ! ! NAT+ の設定をします。 ! (config-if-tun 1)# ip nat inside source list 1 interface ! ! ! pppoe profile とのリンク付けをします。 ! (config-if-tun 1)# tunnel mode pppoe profile PPPOE_PROF ! ! GigaEthernet インタフェースとのリンク付けをします。 ! (config-if-tun 1)# pppoe interface gigaethernet 2/1 *1 ! ! ! 基本設定モードに戻ります。 ! (config-if-tun 1)# exit ! ! ! PPPoE 通信で使用する物理インタフェースを設定します。 ! (config)# interface GigaEthernet 2/1 *1 (config-if-ge 2/1)# vlan-id 2 (config-if-ge 2/1)# bridge-group 2 (config-if-ge 2/1)# pppoe enable (config-if-ge 2/1)# exit ! ! ! GigaEthernet インタフェースに、port-channel をリンク付けします。 ! (config)# interface GigaEthernet 1/1 *1 (config-if-ge 1/1)# vlan-id 1 (config-if-ge 1/1)# bridge-group 1 (config-if-ge 1/1)# channel-group 1 (config-if-ge 1/1)# exit ! ! ! VPNセレクタの設定を行ないます。 ! (config)# crypto ipsec selector SELECTOR (config-ip-selector)# src 1 ipv4 any (config-ip-selector)# dst 1 ipv4 any (config-ip-selector)# exit ! ! ! DPDの設定をします。 ! (config)# crypto isakmp keepalive ! ! ! VPN通信動作中の詳細なログを残す設定にします。 ! (config)# crypto isakmp log sa (config)# crypto isakmp log session (config)# crypto isakmp log negotiation-fail ! (config)#logging buffer level informational ! ! ! ISAKMP ポリシーの設定を行ないます。 ! (config)# crypto isakmp policy P1-POLICY ! ! ! 認証方式に事前共有鍵を使用します。 ! (config-isakmp)# authentication pre-share ! ! ! 暗号方式の指定します。 ! (config-isakmp)# encryption aes ! ! ! 鍵長を指定します。 ! (config-isakmp)# encryption-keysize aes 256 256 256 ! ! ! Diffie Hellmanのグループの指定します。 ! (config-isakmp)# group 14 ! ! ! IKE SAのライフタイムの指定(秒)します。 ! (config-isakmp)# lifetime 86400 ! ! ! ハッシュ方式の指定します。 ! (config-isakmp)# hash sha-256 ! ! ! 基本設定モードに戻ります。 ! (config-isakmp)# exit ! ! ! 拠点向けのISAKMP プロファイルを設定します。 ! (config)# crypto isakmp profile PROF0001 ! ! ! 自装置のWAN アドレスを設定します。 ! (conf-isa-prof)# local-address 192.0.2.1 ! ! ! ISAKMP ポリシーとリンク付けします。 ! (conf-isa-prof)# set isakmp-policy P1-POLICY ! ! ! IPSEC ポリシーとリンク付けします。 ! (conf-isa-prof)# set ipsec-policy P2-POLICY ! ! ! 拠点のWAN アドレスを設定します。 ! (conf-isa-prof)# set peer 192.0.2.10 ! ! ! 対向装置の識別方法を設定します。 ! (conf-isa-prof)# match identity user id-kyoten ! ! ! 本装置の識別方法を設定します。 ! (conf-isa-prof)# self-identity user-fqdn center ! ! ! IKE バージョンを指定します。 ! (conf-isa-prof)# ike-version 2 ! ! ! 共通鍵を設定します。 ! (conf-isa-prof)# local-key SECRET-VPN ! ! ! 基本設定モードに戻ります。 ! (conf-isa-prof)# exit ! ! ! IPSEC ポリシーを設定します。 ! (config)# crypto ipsec policy P2-POLICY ! ! ! Diffie Hellmanのグループの指定します。 ! (conf-ipsec)# set pfs group14 ! ! ! IPsec SAのライフタイムの指定(秒)します。 ! (conf-ipsec)# set security-association lifetime seconds 28800 ! ! ! 鍵長を指定します。 ! (conf-ipsec)# set security-association transform-keysize aes 256 256 256 ! ! ! 暗号化アルゴリズム、認証アルゴリズムを指定します。 ! (conf-ipsec)# set security-association transform esp-aes esp-sha256-hmac ! ! ! 暗号化されたESPパケットの MTU 長を設定します。 ! !(conf-ipsec)# set mtu 1454 ! ! ! インナーのパケットのDFビットの状態にかかわらず、暗号化されたESPパケットではDFビットをoffにします。 ! (conf-ipsec)# set ip df-bit 0 ! ! ! Post-Fragment 方式とします。 *3 ! (conf-ipsec)# set ip fragment post ! ! ! 基本設定モードに戻ります。 ! (conf-ipsec)# exit ! ! ! 拠点のVPNピアとのセレクタ情報をエントリします。 ! (config)# crypto map KYOTEN ipsec-isakmp (config-crypto-map)# match address SELECTOR (config-crypto-map)# set isakmp-profile PROF0001 (config-crypto-map)# exit ! ! ! 拠点のtunnel インタフェースで有効にするVPNセレクタを設定します。 ! (config)# interface Tunnel 2 (config-if-tun 2)# tunnel mode ipsec map KYOTEN (config-if-tun 2)# exit ! ! ! 学習フィルタリングの設定をします。 ! (config)# access-list 111 deny ip any any (config)# access-list 121 spi ip any any ! (config)# interface tunnel 1 (config-if-tun 1)# ip access-group 111 in (config-if-tun 1)# ip access-group 121 out (config-if-tun 1)# exit ! ! ! VPNで使用するパケットを受信許可するフィルタリングの設定をします。 ! (config)# access-list 100 permit udp any eq 500 any eq 500 (config)# access-list 100 permit 50 any any ! (config)# interface tunnel 1 (config-if-tun 1)# ip access-group 100 in (config-if-tun 1)# exit ! ! ! 特権ユーザモードに戻ります。 ! (config)# end ! ! ! 設定を有効にするために refresh をします。 ! #refresh refresh ok?[y/N]:yes ..................Done ! ! ! 設定を保存します。 ! 任意の名前で保存して下さい(*2)。 ! #save [ファイル名] save ok?[y/N]:yes % saving working-config 100% |*************************************************| xxx/ xxx ( Lines) # *1: 物理ポート番号の設定 *2: ファイル名を省略した場合、boot.cfgで保存されます。 装置起動時に適用する設定はboot configurationコマンドで指定することができます(デフォルトはboot.cfg)。 *3: インナーのパケットを暗号化した上でESPパケットの MTU 長に応じてフラグメントする方式です。 それに対してインナーのパケットをあらかじめフラグメントした上で暗号化する方式をPre-Fragmentと言います。 *4:特権ユーザモード移行時のパスワードは、初期状態では設定されていません。 本設定例のように、パスワード "super" を受け付けるようにするためには、あらかじめ特権ユーザモードにて password enable super を実行しておくことが必要です。
! ! ! 特権ユーザモードに移行します。 ! > enable password: super *4 ←パスワードを入力します。(実際は表示されない) ! ! ! 基本設定モードに移行します。 ! # configure terminal (config)# ! ! ! デフォルトルートを tunnel 1(PPPoE) に設定します。 ! (config)# ip route 0.0.0.0 0.0.0.0 tunnel 1 ! ! ! センタ宛の経路情報をtunnel 2(IPsecトンネル)に設定します。 ! (config)# ip route 192.168.1.0 255.255.255.0 tunnel 2 ! ! ! ! NAT で変換対象とする送信元アドレス ! (ここではLAN 側アドレスを対象とします)を登録します。 ! (config)# ip nat list 1 192.168.2.0 0.0.0.255 ! ! ! Port-channel にLAN側IPアドレスを設定します。 ! (config)# interface Port-channel 1 (config-if-ch 1)# ip address 192.168.2.254 255.255.255.0 (config-if-ch 1)# mss 1300 (config-if-ch 1)# exit ! ! ! PPPoEの設定をします。 ! プロバイダから指定された 認証ID、パスワードなどを設定します。 ! (config)# pppoe profile PPPOE_PROF (config-pppoe-profile PPPOE_PROF)# account abc345@***.***.ne.jp zzzyyyxxx (config-pppoe-profile PPPOE_PROF)# exit ! ! ! Tunnel インタフェース設定モードに移行します。 ! (config)# interface Tunnel 1 ! ! ! プロバイダから指定された IPアドレスなどを設定します。 ! (config-if-tun 1)# description FLETS (config-if-tun 1)# ip address 192.0.2.10 255.255.255.255 ! ! ! NAT+ の設定をします。 ! (config-if-tun 1)# ip nat inside source list 1 interface ! ! ! pppoe profile とのリンク付けをします。 ! (config-if-tun 1)# tunnel mode pppoe profile PPPOE_PROF ! ! GigaEthernet インタフェースとのリンク付けをします。 ! (config-if-tun 1)# pppoe interface gigaethernet 2/1 *1 ! ! ! 基本設定モードに戻ります。 ! (config-if-tun 1)# exit ! ! ! PPPoE 通信で使用する物理インタフェースを設定します。 ! (config)# interface GigaEthernet 2/1 *1 (config-if-ge 2/1)# vlan-id 2 (config-if-ge 2/1)# bridge-group 2 (config-if-ge 2/1)# pppoe enable (config-if-ge 2/1)# exit ! ! ! GigaEthernet インタフェースに、port-channel をリンク付けします。 ! (config)# interface GigaEthernet 1/1 *1 (config-if-ge 1/1)# vlan-id 1 (config-if-ge 1/1)# bridge-group 1 (config-if-ge 1/1)# channel-group 1 (config-if-ge 1/1)# exit ! ! ! VPNセレクタの設定を行ないます。 ! (config)# crypto ipsec selector SELECTOR (config-ip-selector)# src 1 ipv4 any (config-ip-selector)# dst 1 ipv4 any (config-ip-selector)# exit ! ! ! DPDの設定をします。 ! (config)# crypto isakmp keepalive ! ! ! VPN通信動作中の詳細なログを残す設定にします。 ! (config)# crypto isakmp log sa (config)# crypto isakmp log session (config)# crypto isakmp log negotiation-fail ! (config)#logging buffer level informational ! ! ! ISAKMP ポリシーの設定を行ないます。 ! (config)# crypto isakmp policy P1-POLICY ! ! ! 認証方式に事前共有鍵を使用します。 ! (config-isakmp)# authentication pre-share ! ! ! 暗号方式の指定します。 ! (config-isakmp)# encryption aes ! ! ! 鍵長を指定します。 ! (config-isakmp)# encryption-keysize aes 256 256 256 ! ! ! Diffie Hellmanのグループの指定します。 ! (config-isakmp)# group 14 ! ! ! IKE SAのライフタイムの指定(秒)します。 ! (config-isakmp)# lifetime 86400 ! ! ! IKE SAのソフトリミットの指定(秒)します(*5)。 ! (conf-ipsec)# set security-association softlimit initiate seconds 30 (conf-ipsec)# set security-association softlimit respond seconds 30 ! ! ! ハッシュ方式の指定します。 ! (config-isakmp)# hash sha-256 ! ! ! 基本設定モードに戻ります。 ! (config-isakmp)# exit ! ! ! センタ向けのISAKMP プロファイルを設定します。 ! (config)# crypto isakmp profile PROF0001 ! ! ! 自装置のWAN アドレスを設定します。 ! (conf-isa-prof)# local-address 192.0.2.10 ! ! ! ISAKMP ポリシーとリンク付けします。 ! (conf-isa-prof)# set isakmp-policy P1-POLICY ! ! ! IPSEC ポリシーとリンク付けします。 ! (conf-isa-prof)# set ipsec-policy P2-POLICY ! ! ! センタのWAN アドレスを設定します。 ! (conf-isa-prof)# set peer 192.0.2.1 ! ! ! 対向装置の識別方法を設定します。 ! (conf-isa-prof)# match identity user center ! ! ! 本装置の識別方法を設定します。 ! (conf-isa-prof)# self-identity user-fqdn id-kyoten ! ! ! IKE バージョンを指定します。 ! (conf-isa-prof)# ike-version 2 ! ! ! 共通鍵を設定します。 ! (conf-isa-prof)# local-key SECRET-VPN ! ! ! 基本設定モードに戻ります。 ! (conf-isa-prof)# exit ! ! ! IPSEC ポリシーを設定します。 ! (config)# crypto ipsec policy P2-POLICY ! ! ! Diffie Hellmanのグループの指定します。 ! (conf-ipsec)# set pfs group14 ! ! ! 常にSAを確立しておく設定をします。 ! (conf-ipsec)# set security-association always-up ! ! ! IPsec SAのライフタイムの指定(秒)します。 ! (conf-ipsec)# set security-association lifetime seconds 28800 ! ! 鍵長を指定します。 ! (conf-ipsec)# set security-association transform-keysize aes 256 256 256 ! ! ! 暗号化アルゴリズム、認証アルゴリズムを指定します。 ! (conf-ipsec)# set security-association transform esp-aes esp-sha256-hmac ! ! ! 暗号化されたESPパケットの MTU 長を設定します。 ! !(conf-ipsec)# set mtu 1454 ! ! ! 暗号化されたESPパケットの MSS を設定します(*6)。 ! !(conf-ipsec)# set mss 1300 ! ! ! インナーのパケットのDFビットの状態にかかわらず、暗号化されたESPパケットではDFビットをoffにします。 ! (conf-ipsec)# set ip df-bit 0 ! ! ! Post-Fragment 方式とします。 *3 ! (conf-ipsec)# set ip fragment post ! ! ! 基本設定モードに戻ります。 ! (conf-ipsec)# exit ! ! ! センタのVPNピアとのセレクタ情報をエントリします。 ! (config)# crypto map CENTER ipsec-isakmp (config-crypto-map)# match address SELECTOR (config-crypto-map)# set isakmp-profile PROF0001 (config-crypto-map)# exit ! ! ! センタのtunnel インタフェースで有効にするVPNセレクタを設定します。 ! (config)# interface Tunnel 2 (config-if-tun 2)# tunnel mode ipsec map CENTER (config-if-tun 2)# exit ! ! ! 学習フィルタリングの設定をします。 ! (config)# access-list 111 deny ip any any (config)# access-list 121 spi ip any any ! (config)# interface tunnel 1 (config-if-tun 1)# ip access-group 111 in (config-if-tun 1)# ip access-group 121 out (config-if-tun 1)# exit ! ! ! VPNで使用するパケットを受信許可するフィルタリングの設定をします。 ! (config)# access-list 100 permit udp any eq 500 any eq 500 (config)# access-list 100 permit 50 any any ! (config)# interface tunnel 1 (config-if-tun 1)# ip access-group 100 in (config-if-tun 1)# exit ! ! ! 特権ユーザモードに戻ります。 ! (config)# end ! ! ! 設定を有効にするために refresh をします。 ! #refresh refresh ok?[y/N]:yes ..................Done ! ! ! 設定を保存します。 ! 任意の名前で保存して下さい(*2)。 ! #save [ファイル名] save ok?[y/N]:yes % saving working-config 100% |*************************************************| xxx/ xxx ( Lines) # *1: 物理ポート番号の設定 *2: ファイル名を省略した場合、boot.cfgで保存されます。 装置起動時に適用する設定はboot configurationコマンドで指定することができます(デフォルトはboot.cfg)。 *3: インナーのパケットを暗号化した上でESPパケットの MTU 長に応じてフラグメントする方式です。 それに対してインナーのパケットをあらかじめフラグメントした上で暗号化する方式をPre-Fragmentと言います。 *4:特権ユーザモード移行時のパスワードは、初期状態では設定されていません。 本設定例のように、パスワード "super" を受け付けるようにするためには、あらかじめ特権ユーザモードにて password enable super を実行しておくことが必要です。 *5:IKEv2の場合、Phase1削除時にPhase2が削除されます。Phase1リキー衝突による削除を防ぐため、拠点のみ ソフトリミット30秒を設定します。 *6:IPsecトンネルの先のホストから送信されたDFビットつきのTCPパケットがPPPoE回線で破棄されてしまうような ケースを考慮して、インナーのMTU長以下になるようにMSSの書き換え設定を行います。 センター経由でインターネット上のサーバと通信を行うような場合に、本設定を推奨します。