| 最終変更日 | 2018/Nov/06 |
| 文書サイズ | 24KB |
[ 環境 ]
| 項目 | 内容 |
|---|---|
| 接続形態 | LAN側IPマスカレードで使用中の2つRT140e間でVPNを張る |
| ルータ | ローカルルータ(RT140e)を2台 |
| ルーティング情報 | 使わない/static |
| NAT変換タイプ | IPマスカレード |
| 外側アドレス | 各1個(SGW用とIPマスカレード用を兼ねる) |
| 内側アドレス | プライベートアドレス |
| DHCP | LAN1側で使用する |
[ ネットワーク図 ]
133.176.200.0/24
----------+-------------------------------------------+--------------
| |
|133.176.200.46 |133.176.200.68
| VPN |
| ????????????????????????? |
RT140e(A) | ? ? | RT140e(B)
+--------+---------+------+ +------+---------+-------+
| [ LAN2 ] [tunnel] | | [tunnel] [ LAN2 ] |
| | | | | | | |
| [NAT] | | | | [NAT] |
| | | | | | | |
| IPルーティング | | IPルーティング |
| | | | | |
| [ LAN1 ] | | [ LAN1 ] |
+--------+----------------+ +----------------+-------+
|192.168.0.1 |192.168.1.1
| |
| 192.168.0.0/24 192.168.1.0/24 |
----------+------------------ ------------------+---------
| |
|192.168.0.2 |192.168.1.2
[ PC ] [ PC ]
[ 設定例 ]
[ 2のプライベートネットワークをstaticルーティング ]
| 宛先/ネットマスク | 次のホップ | 生成コマンド |
|---|---|---|
| default | 今回省略 | ip { pp | lan } route add net |
| 192.168.0.0/24 | LAN1(192.168.0.1) | ip lan1 address |
| 133.176.200.0/24 | LAN2(133.176.200.46) | ip lan2 address |
| 192.168.1.0/24 | LAN2(133.176.200.68) | ip lan2 route add net |
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.46/24 ip lan2 routing protocol none ip lan2 route add net 192.168.1.0/24 133.176.200.68 1 dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24
| 宛先/ネットマスク | 次のホップ | 生成コマンド |
|---|---|---|
| default | 今回省略 | ip { pp | lan } route add net |
| 192.168.1.0/24 | LAN1(192.168.1.1) | ip lan1 address |
| 133.176.200.0/24 | LAN2(133.176.200.68) | ip lan2 address |
| 192.168.0.0/24 | LAN2(133.176.200.46) | ip lan2 route add net |
ip lan1 address 192.168.1.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 route add net 192.168.0.0/24 133.176.200.46 1 dhcp scope 1 192.168.1.2-192.168.1.254/24
[ NATディスクリプタによるLAN側IPマスカレードの導入 ]
| NATディスクリプタ番号 | 1 |
| タイプ | masquerade |
| 外側アドレス | 133.176.200.46 |
| 内側アドレス | 133.176.200.46 192.168.0.1〜192.168.0.254 |
| 静的なNAT設定 | なし |
| 静的IPマスカレード | 133.176.200.46, tcp, telnet 133.176.200.46, udp, tftp 133.176.200.46, udp, 500 (IKE) |
| 適用インタフェース | LAN2 |
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.46/24 ip lan2 routing protocol none ip lan2 nat descriptor 1 nat descriptor type 1 masquerade nat descriptor address outer 1 133.176.200.46 nat descriptor address inner 1 133.176.200.46 192.168.0.1-192.168.0.254 nat descriptor masquerade static 1 1 133.176.200.46 tcp telnet nat descriptor masquerade static 1 2 133.176.200.46 udp tftp nat descriptor masquerade static 1 3 133.176.200.46 udp 500 dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24
| NATディスクリプタ番号 | 2 |
| タイプ | masquerade |
| 外側アドレス | 133.176.200.68 |
| 内側アドレス | 133.176.200.68 192.168.1.1〜192.168.1.254 |
| 静的なNAT設定 | なし |
| 静的IPマスカレード | 133.176.200.68, tcp, telnet 133.176.200.68, udp, tftp 133.176.200.68, udp, 500 (IKE) |
| 適用インタフェース | LAN2 |
ip lan1 address 192.168.1.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 nat descriptor 2 nat descriptor type 2 masquerade nat descriptor address outer 2 133.176.200.68 nat descriptor address inner 2 133.176.200.68 192.168.1.1-192.168.1.254 nat descriptor masquerade static 2 1 133.176.200.68 tcp telnet nat descriptor masquerade static 2 2 133.176.200.68 udp tftp nat descriptor masquerade static 2 3 133.176.200.68 udp 500 dhcp service server dhcp scope 1 192.168.1.2-192.168.1.254/24
[ IPsecによるVPNの導入 (プライベート空間の暗号トンネル) ]
| SGWアドレス1 | 133.176.200.46 |
| SGWアドレス2 | 133.176.200.68 |
| 事前共有鍵 | kagi |
| トンネルモード | ESP, 暗号(des-cbc), 認証(md5-hmac) |
| SGW定義 | |
|---|---|
| SGWアドレス | 133.176.200.68 |
| RT140e(A)-RT140e(B)事前共有鍵 | kagi |
| IPsecポリシーの定義 | |
| ポリシー識別番号 | 101 |
| 形式 | ESP |
| 暗号 | des-cbc |
| 認証 | md5-hmac |
| トンネルの定義 | |
| トンネルIF番号 | 1 |
| ボリシー番号 | 101 |
| 宛先/ネットマスク | 次のホップ | 生成コマンド |
|---|---|---|
| default | 今回省略 | ip { pp | lan } route add net |
| 192.168.0.0/24 | LAN1(192.168.0.1) | ip lan1 address |
| 133.176.200.0/24 | LAN2(133.176.200.46) | ip lan2 address |
| 192.168.1.0/24 | TUNNEL[01] | ip tunnel route add net |
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.46/24 ip lan2 routing protocol none ip lan2 nat descriptor 1 nat descriptor type 1 masquerade nat descriptor address outer 1 133.176.200.46 nat descriptor address inner 1 133.176.200.46 192.168.0.1-192.168.0.254 nat descriptor masquerade static 1 1 133.176.200.46 tcp telnet nat descriptor masquerade static 1 2 133.176.200.46 udp tftp nat descriptor masquerade static 1 3 133.176.200.46 udp 500 # 鍵交換に関する設定 (IPsecリリース3) ipsec auto refresh on ipsec ike remote address 1 133.176.200.68 !# 鍵交換に関する設定 (IPsecリリース1,2) !ipsec auto refresh on !ipsec ike host 133.176.200.68 ipsec pre-shared-key 133.176.200.68 text kagi ipsec sa policy 101 133.176.200.68 esp des-cbc md5-hmac tunnel select 1 ip tunnel route add net 192.168.1.0/24 1 ipsec tunnel 101 tunnel enable 1 dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24
| SGW定義 | |
|---|---|
| SGWアドレス | 133.176.200.46 |
| RT140e(A)-RT140e(B)事前共有鍵 | kagi |
| IPsecポリシーの定義 | |
| ポリシー識別番号 | 101 |
| 形式 | ESP |
| 暗号 | des-cbc |
| 認証 | md5-hmac |
| トンネルの定義 | |
| トンネルIF番号 | 2 |
| ボリシー番号 | 101 |
| 宛先/ネットマスク | 次のホップ | 生成コマンド |
|---|---|---|
| default | 今回省略 | ip { pp | lan } route add net |
| 192.168.1.0/24 | LAN1(192.168.1.1) | ip lan1 address |
| 133.176.200.0/24 | LAN2(133.176.200.68) | ip lan2 address |
| 192.168.0.0/24 | TUNNEL[02] | ip tunnel route add net |
ip lan1 address 192.168.1.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 nat descriptor 2 nat descriptor type 2 masquerade nat descriptor address outer 2 133.176.200.68 nat descriptor address inner 2 133.176.200.68 192.168.1.1-192.168.1.254 nat descriptor masquerade static 2 1 133.176.200.68 tcp telnet nat descriptor masquerade static 2 2 133.176.200.68 ucp tftp nat descriptor masquerade static 2 3 133.176.200.68 udp 500 # 鍵交換に関する設定 (IPsecリリース3) ipsec auto refresh on ipsec ike remote address 1 133.176.200.46 !# 鍵交換に関する設定 (IPsecリリース1,2) !ipsec auto refresh on !ipsec ike host 133.176.200.46 ipsec pre-shared-key 133.176.200.46 text kagi ipsec sa policy 101 133.176.200.46 esp des-cbc md5-hmac tunnel select 2 ip tunnel route add net 192.168.0.0/24 1 ipsec tunnel 101 tunnel enable 2 dhcp service server dhcp scope 1 192.168.1.2-192.168.1.254/24
[ IPsecによるVPNの導入 (ルータ間のtelnetの暗号化) ]
| SGWアドレス1 | 133.176.200.46 |
| SGWアドレス2 | 133.176.200.68 |
| 事前共有鍵 | kagi |
| トンネルモード | ESP, 暗号(des-cbc), 認証(md5-hmac) |
| トランスポートモード | ESP, 暗号(des-cbc), 認証(md5-hmac) |
| SGW定義 | |
|---|---|
| SGWアドレス | 133.176.200.68 |
| RT140e(A)-RT140e(B)事前共有鍵 | kagi |
| IPsecポリシーの定義 | |
| ポリシー識別番号 | 101 |
| 形式 | ESP |
| 暗号 | des-cbc |
| 認証 | md5-hmac |
| トンネルの定義 | |
| トンネルIF番号 | 1 |
| ボリシー番号 | 101 |
| トランスポートの定義 (A→Bでtelnetを暗号化) | |
| トランスポート識別番号 | 1 |
| 対象プロトコル | TCP |
| ソースポート番号 | * |
| デスティネーションポート番号 | telnet |
| ボリシー番号 | 101 (トンネルと兼ねる) |
| トランスポートの定義 (B→Aでtelnetを暗号化) | |
| トランスポート識別番号 | 2 |
| 対象プロトコル | TCP |
| ソースポート番号 | telnet |
| デスティネーションポート番号 | * |
| ボリシー番号 | 101 (トンネルと兼ねる) |
| 宛先/ネットマスク | 次のホップ | 生成コマンド |
|---|---|---|
| default | 今回省略 | ip { pp | lan } route add net |
| 192.168.0.0/24 | LAN1(192.168.0.1) | ip lan1 address |
| 133.176.200.0/24 | LAN2(133.176.200.46) | ip lan2 address |
| 192.168.1.0/24 | TUNNEL[01] | ip tunnel route add net |
security class 1 on on ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.46/24 ip lan2 routing protocol none ip lan2 nat descriptor 1 nat descriptor type 1 masquerade nat descriptor address outer 1 133.176.200.46 nat descriptor address inner 1 133.176.200.46 192.168.0.1-192.168.0.254 nat descriptor masquerade static 1 1 133.176.200.46 tcp telnet nat descriptor masquerade static 1 2 133.176.200.46 udp tftp nat descriptor masquerade static 1 3 133.176.200.46 udp 500 # 鍵交換に関する設定 (IPsecリリース3) ipsec auto refresh on ipsec ike remote address 1 133.176.200.68 !# 鍵交換に関する設定 (IPsecリリース1,2) !ipsec auto refresh on !ipsec ike host 133.176.200.68 ipsec pre-shared-key 133.176.200.68 text kagi ipsec sa policy 101 133.176.200.68 esp des-cbc md5-hmac ipsec transport 1 101 tcp * telnet ipsec transport 2 101 tcp telnet * tunnel select 1 ip tunnel route add net 192.168.1.0/24 1 ipsec tunnel 101 tunnel enable 1 dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24
| SGW定義 | |
|---|---|
| SGWアドレス | 133.176.200.46 |
| RT140e(A)-RT140e(B)事前共有鍵 | kagi |
| IPsecポリシーの定義 | |
| ポリシー識別番号 | 101 |
| 形式 | ESP |
| 暗号 | des-cbc |
| 認証 | md5-hmac |
| トンネルの定義 | |
| トンネルIF番号 | 2 |
| ボリシー番号 | 101 |
| トランスポートの定義 (B→Aでtelnetを暗号化) | |
| トランスポート識別番号 | 1 |
| 対象プロトコル | TCP |
| ソースポート番号 | * |
| デスティネーションポート番号 | telnet |
| ボリシー番号 | 101 (トンネルと兼ねる) |
| トランスポートの定義 (A→Bでtelnetを暗号化) | |
| トランスポート識別番号 | 2 |
| 対象プロトコル | TCP |
| ソースポート番号 | telnet |
| デスティネーションポート番号 | * |
| ボリシー番号 | 101 (トンネルと兼ねる) |
| 宛先/ネットマスク | 次のホップ | 生成コマンド |
|---|---|---|
| default | 今回省略 | ip { pp | lan } route add net |
| 192.168.1.0/24 | LAN1(192.168.1.1) | ip lan1 address |
| 133.176.200.0/24 | LAN2(133.176.200.68) | ip lan2 address |
| 192.168.0.0/24 | TUNNEL[02] | ip tunnel route add net |
security class 1 on on ip lan1 address 192.168.1.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 nat descriptor 2 nat descriptor type 2 masquerade nat descriptor address outer 2 133.176.200.68 nat descriptor address inner 2 133.176.200.68 192.168.1.1-192.168.1.254 nat descriptor masquerade static 2 1 133.176.200.68 tcp telnet nat descriptor masquerade static 2 2 133.176.200.68 ucp tftp nat descriptor masquerade static 2 3 133.176.200.68 udp 500 # 鍵交換に関する設定 (IPsecリリース3) ipsec auto refresh on ipsec ike remote address 1 133.176.200.46 !# 鍵交換に関する設定 (IPsecリリース1,2) !ipsec auto refresh on !ipsec ike host 133.176.200.46 ipsec auto refresh on ipsec ike host 133.176.200.46 ipsec pre-shared-key 133.176.200.46 text kagi ipsec sa policy 101 133.176.200.46 esp des-cbc md5-hmac ipsec transport 1 101 tcp * telnet ipsec transport 2 101 tcp telnet * tunnel select 2 ip tunnel route add net 192.168.0.0/24 1 ipsec tunnel 101 tunnel enable 2 dhcp service server dhcp scope 1 192.168.1.2-192.168.1.254/24
1個の外側アドレスでSGWとIPマスカレードを兼用した上で、
ルータ間の通信にtransportを適用した場合、
プライベートアドレス機器から相手側のSGWに通信をする場合、
パケットの行きと帰りで異なる変換が掛ります。
| 192.168.0.2→133.176.200.68 | IPマスカレード |
| 133.176.200.68→192.168.0.2 | IPsecのトランスポート |
[ 対策 ]
| 192.168.0.2→192.168.1.1 | トンネル |
| 192.168.1.1(133.176.200.68)→192.168.0.2 | トンネル |
行きと帰りでは、ソースポートとデスティネーションポートが反対になります。 特定のポートに関して、双方向で暗号化する場合は、 2組設定することになります。
[ IPsecの運用について ]
IPsecリリースによる仕様の違いを明示することとします。
IPsecリリース1やIPsecリリース2からIPsecリリース3に移行する場合は、 「セキュリティ・ゲートウェイ機能とIPsec」の 「IPsecリリース3への設定変更の手引き」を参考にしてください。
Rev.4.00.33から追加されたダイヤルアップVPN機能により、ipsec pre-shared-keyコマンドの仕様変更 があり、コマンドもipsec ike pre-shared-keyへと変更されました。
Rev.4.00.33以降のファームウェアの場合は、 ipsec pre-shared-keyコマンドの代りにipsec ike pre-shared-keyコマンドを 設定してください。
無効です。
IPsecでは、TCP(6)やUDP(17)の代りに、
ESP(50)やAH(51)のパケットが使われます。
|
|