IPsec(サイト間トンネル)機能を用いた接続¶
動作確認バージョン: | Brocade 5600vRouter Version4.2R1S1 |
---|
|vfirewall| では、IPsecがサポートされています。IPsecを利用してサイト間接続用トンネルの設定を紹介します。
IPsecのトンネルを構築することで、互いのサイト内ネットワークをIPsecトンネルを経由して接続し通信をすることが可能になります。
注釈
IPsecの宛先にVRRPの仮想IPアドレスを指定できません。IPsecでの冗長設定に関しては、動作確認済み構成例のモデル をご参照ください。
IPsec(site-to-siteモード)接続¶
サンプル設定のシナリオ
- ファイアウォール間をVPN接続(トンネル接続)させ各ファイアウォール配下のサーバー間で通信が可能にしたい
- VPN接続の方式は、IPsec機能(site-to-site)を利用したい
- IPsecの認証パラメータは、以下の表に基づいて設定したい
構成図
IPsecパラメータ情報
ファイアウォールでIPsecネゴシエーションや暗号化に必要になるパラメータは以下のとおり設定していきます。
- 認証情報
パラメータ | 値 |
Key management protocol | IKEv1(ISAKMP + Oakley) |
Phase1 | |
Authentication Method | pre-shared key |
pre-shared key password | test_key_1 |
DH group | 2 |
Hash Algorithm | SHA1 |
ISAKMP SA life time | 28800 seconds |
key exchange mode | Main mode |
Phase2 | |
IPsec SA life time | 3600 seconds |
Security protocol | ESP |
Authentication Algorithm | HMAC-SHA1 |
Perfect Forward Secrecy | Enable |
Capsuling mode | Tunnel |
key exchange mode | Quick mode |
注釈
IPsec設定前に、2台のファイアウォール間の通信は確立できているものとします。
シナリオにおける設定の流れ
- ファイアウォール1号機側設定
1.インターフェイスにvti0というトンネルのインターフェイスを作成
2.vti0のインターフェイスは、10.1.1.2/30を設定
3.ESPの設定は、ESP-1W を設定パラメータにしたがって設定
4.IKEの設定は、IKE-1W を設定パラメータにしたがって設定
5.IPsecのモードをsite-to-siteに設定
6.IPsec接続する対向のファイアウォールのアドレスに、153.xxx.xxx.182を設定
7.設定した対向アドレスに、IKE-1W/ESP-1W/vti0インターフェイスを設定
8.対向ファイアウォール配下のネットワーク(192.168.3.128/28)はトンネル経由の通信になるようにスタティックルート設定
- ファイアウォール2号機側設定
1.インターフェイスにvti0というトンネルのインターフェイスを作成
2.vti0のインターフェイスは、10.1.1.1/30を設定
3.ESPの設定は、ESP-1W を設定パラメータにしたがって設定
4.IKEの設定は、IKE-1W を設定パラメータにしたがって設定
5.IPsecのモードをsite-to-siteに設定
6.IPsecが接続する対向のファイアウォールのアドレスに、153.xxx.xxx.227を設定
7.設定した対向アドレスに、IKE-1W/ESP-1W/vti0インターフェイスを設定
8.対向ファイアウォール配下のネットワーク(192.168.1.0/28)はトンネル経由の通信になるようにスタティックルート設定
CLIにて入力するコマンド
- ファイアウォール1号機 IPsec(site-to-site)設定
set interfaces vti vti0 address '10.1.1.2/30'
set security vpn ipsec esp-group ESP-1W lifetime '3600'
set security vpn ipsec esp-group ESP-1W proposal 1 encryption 'aes256'
set security vpn ipsec esp-group ESP-1W proposal 1 hash 'sha1'
set security vpn ipsec ike-group IKE-1W lifetime '28800'
set security vpn ipsec ike-group IKE-1W proposal 1 dh-group '2'
set security vpn ipsec ike-group IKE-1W proposal 1 encryption 'aes256'
set security vpn ipsec ike-group IKE-1W proposal 1 hash 'sha1'
set security vpn ipsec site-to-site peer 153.xxx.xx.182 authentication pre-shared-secret 'test_key_1'
set security vpn ipsec site-to-site peer 153.xxx.xx.182 ike-group 'IKE-1W'
set security vpn ipsec site-to-site peer 153.xxx.xx.182 local-address '153.xxx.xxx.227'
set security vpn ipsec site-to-site peer 153.xxx.xx.182 vti bind 'vti0'
set security vpn ipsec site-to-site peer 153.xxx.xx.182 vti esp-group 'ESP-1W'
set protocols static interface-route 192.168.3.128/28 next-hop-interface 'vti0'
- ファイアウォール2号機 IPsec(site-to-site)設定
set interfaces vti vti0 address '10.1.1.1/30'
set security vpn ipsec esp-group ESP-1W lifetime '3600'
set security vpn ipsec esp-group ESP-1W proposal 1 encryption 'aes256'
set security vpn ipsec esp-group ESP-1W proposal 1 hash 'sha1'
set security vpn ipsec ike-group IKE-1W lifetime '28800'
set security vpn ipsec ike-group IKE-1W proposal 1 dh-group '2'
set security vpn ipsec ike-group IKE-1W proposal 1 encryption 'aes256'
set security vpn ipsec ike-group IKE-1W proposal 1 hash 'sha1'
set security vpn ipsec site-to-site peer 153.xxx.xxx.227 authentication pre-shared-secret 'test_key_1'
set security vpn ipsec site-to-site peer 153.xxx.xxx.227 ike-group 'IKE-1W'
set security vpn ipsec site-to-site peer 153.xxx.xxx.227 local-address '153.xxx.xx.182'
set security vpn ipsec site-to-site peer 153.xxx.xxx.227 vti bind 'vti0'
set security vpn ipsec site-to-site peer 153.xxx.xxx.227 vti esp-group 'ESP-1W'
set protocols static interface-route 192.168.1.0/28 next-hop-interface 'vti0'
正しく設定が完了したときのコンフィグレーションは次のとおりです。
- ファイアウォール1号機コンフィグ
interfaces {
vti vti0 {
address 10.1.1.2/30
}
}
security {
vpn {
ipsec {
esp-group ESP-1W {
lifetime 3600
proposal 1 {
encryption aes256
hash sha1
}
}
ike-group IKE-1W {
lifetime 28800
proposal 1 {
dh-group 2
encryption aes256
hash sha1
}
}
site-to-site {
peer 153.xxx.xx.182 {
authentication {
pre-shared-secret test_key_1
}
ike-group IKE-1W
local-address 153.xxx.xxx.227
vti {
bind vti0
esp-group ESP-1W
}
}
}
}
}
}
protocols {
static {
interface-route 192.168.3.128/28 {
next-hop-interface vti0 {
}
}
}
}
- ファイアウォール2号機コンフィグ
interfaces {
vti vti0 {
address 10.1.1.1/30
}
}
security{
vpn {
ipsec {
esp-group ESP-1W {
lifetime 3600
proposal 1 {
encryption aes256
hash sha1
}
}
ike-group IKE-1W {
lifetime 28800
proposal 1 {
dh-group 2
encryption aes256
hash sha1
}
}
site-to-site {
peer 153.xxx.xxx.227 {
authentication {
pre-shared-secret test_key_1
}
ike-group IKE-1W
local-address 153.xxx.xx.182
vti {
bind vti0
esp-group ESP-1W
}
}
}
}
}
}
protocols {
static {
interface-route 192.168.1.0/28 {
next-hop-interface vti0 {
}
}
}
動作確認結果
互いのファイアウォールにて、IPsecトンネルが確立しており、配下の端末間での通信も可能であることを確認しましたのでサイト間のIPsec設定が正しく動作していることを確認できました。
- ファイアウォール1号機と2号機で互いにIPsecトンネルが確立できていることが確認できました。
# ファイアウォール1号機側でのトンネル状態確認 → OK
user-admin@FW01:~$ show vpn ipsec sa
Peer ID / IP Local ID / IP
------------ -------------
153.xx.xxx.182 153.xx.xx.227
Tunnel State Bytes Out/In Encrypt Hash A-Time L-Time Proto
------ ----- ------------- ------------ -------- ------ ------ -----
vti up 0.0/0.0 aes256 sha1 1698 3600 all
# ファイアウォール2号機側でのトンネル状態確認 → OK
user-admin@FW02:~$ show vpn ipsec sa
Peer ID / IP Local ID / IP
------------ -------------
153.xx.xx.227 153.xx.xx.182
Tunnel State Bytes Out/In Encrypt Hash A-Time L-Time Proto
------ ----- ------------- ------------ -------- ------ ------ -----
vti up 0.0/0.0 aes256 sha1 1364 3600 all
- ファイアウォール1号機と2号機でIPsec用のvtiインターフェイスが正常にUPしていることをが確認できました。
# ファイアウォール1号機側でのvti0インターフェイス状態 → OK
user-admin@FW01:~$ show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description
--------- ---------- --- -----------
dp0s6 153.xxx.xxx.227/29 u/u
dp0s7 192.168.1.12/28 u/u
vti0 10.1.1.2/30 u/u
# ファイアウォール2号機側でのvti0インターフェイス状態 → OK
user-admin@FW02:~$ show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description
--------- ---------- --- -----------
dp0s8 153.xx.xxx.182/28 u/u
dp0s11 192.168.3.140/28 u/u
vti0 10.1.1.1/30 u/u
- サーバーインスタンス(192.168.1.3)から対向のサーバーインスタンスに対しての通信確認を実行しました。
# Pingを用いた通信確認 → OK
[test-user@cent001 ~]$ ping 192.168.3.130
PING 192.168.3.130 (192.168.3.130) 56(84) bytes of data.
64 bytes from 192.168.3.130: icmp_seq=1 ttl=62 time=195 ms
64 bytes from 192.168.3.130: icmp_seq=2 ttl=62 time=193 ms
64 bytes from 192.168.3.130: icmp_seq=3 ttl=62 time=193 ms
64 bytes from 192.168.3.130: icmp_seq=4 ttl=62 time=193 ms
64 bytes from 192.168.3.130: icmp_seq=5 ttl=62 time=193 ms
^C
--- 192.168.3.130 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 193.078/193.838/195.951/1.074 ms
[test-user@cent001 ~]$
# FTPを用いた通信確認 → OK
[test-user@cent001 tmp]$ ftp 192.168.3.130
Connected to 192.168.3.130 (192.168.3.130).
220 (vsFTPd 3.0.2)
Name (192.168.3.130:test-user):
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
ftp>
ftp> dir
227 Entering Passive Mode (192,168,3,130,118,221).
150 Here comes the directory listing.
226 Directory send OK.
ftp>
ftp> put test_file
local: test_file remote: test_file
227 Entering Passive Mode (192,168,3,130,118,35).
150 Ok to send data.
226 Transfer complete.
ftp>
ftp> dir
227 Entering Passive Mode (192,168,3,130,118,209).
150 Here comes the directory listing.
-rw-r--r-- 1 1000 1000 0 Mar 23 18:12 test_file
226 Directory send OK.
ftp>
ftp> bye
221 Goodbye.