古河電工ネットワーク機器の総合ブランド ファイテルネット
古河電工
FITELnetトップ製品ラインナップイベント&セミナーセールス&サポート
Routing to the Future FITELnet
お問い合わせはこちら
 
設定例
Google Cloud Platform と IKEv2 により VPN 接続する (BGP 経路を利用)
概要
BGP 経路を用いた IKEv2 IPsec tunnel により、Google Cloud Platform (GCP) と VPN 接続するための設定例です。
構成図
補足・注意点
GCP ではカスタマ側ネットワークと GCP ネットワークを IPsec により、VPN 接続することができます。
GCP Cloud VPN については Web で提供されている技術資料をご覧ください。

Google Cloud VPN の設定

下記の文書に従って Google Cloud VPN を設定します。

https://cloud.google.com/compute/docs/cloudrouter#setting_up_vpn_with_cloud_router


以下、主要な設定画面について説明していきます。

1.GCP グローバル IP の取得

Cloud VPN gateway に割り当てるグローバル IP を取得しておきます。
詳細は Web で提供されている技術資料をご覧ください。

2.Cloud Router の作成

GCP ネットワークとカスタマ側ネットワークの経路情報を BGP により Dynamic に行うため Cloud Router を作成します。
各パラメータの詳細は Web で提供されている技術資料をご覧ください。

設定画面#1

3.VPN instance の作成

GCP Developers Console へログインし、メインメニューから "ネットワーキング" を選択します。
メニューの "VPN" を選択し、"VPN 接続を作成" をクリックします。

設定画面#2

事前共有鍵、IPsec 終端アドレス、VPN セレクタ、及び、他のパラメータを入力し、VPN instance 設定を行います。
各パラメータの詳細は Web で提供されている技術資料をご覧ください。

設定画面#3 設定画面#4

4.ファイアウォールの設定

GCP ネットワークへ送信されるトラフィックのファイアウォール設定を行います。
詳細は Web で提供されている技術資料をご覧ください。

設定画面#5

設定画面#6


F シリーズのルータ設定例
〜IPsec Phase1 ポリシー〜
暗号化アルゴリズム: AES128
認証アルゴリズム: SHA-1
認証方式: Pre-Shared Key
事前共有鍵の形式: プレインテキスト
Pre-Shared Key: GCP の VPN instance 作成時に設定したものを利用します。
Diffie-Hellman (DH): Group 2
Phase1 ライフタイム: 36,000 秒
VPN ピア IP アドレス: Cloud VPN gateway のグローバル IP を指定します。
〜IPsec Phase2 ポリシー〜
暗号化アルゴリズム: AES (鍵サイズ: 128, 192, 256)
認証アルゴリズム: SHA-1
PFS: Group 2
Phase2 ライフタイム: 10,800 秒

ルータの設定
(!の行はコメントです。実際に入力する必要はありません。)
この設定を利用したい方は
!
!
! 特権ユーザモードに移行します。
!
Router> enable
Enter password: super ←パスワードを入力します(実際は何も表示されません)。

Router#
!
!
! 基本設定モードに移行します。
!
Router# configure terminal
Router(config)#!
Router(config)#! VPN設定
Router(config)#!
Router(config)# vpn enable
Router(config)# vpnlog enable
Router(config)#!
Router(config)# ipsec access-list 1 ipsec ip any any
Router(config)# ipsec access-list 64 bypass ip any any
Router(config)#!
Router(config)# ipsec transform-set AES-SHA ikev2 esp-aes esp-sha-hmac
Router(config)# ipsec transform-keysize AES128 esp-aes-cbc 128 256 128
Router(config)#!
Router(config)# crypto ikev2 policy 1
Router(config-ikev2)# authentication pre-share
Router(config-ikev2)# encryption aes
Router(config-ikev2)# group 2
Router(config-ikev2)# hash sha
Router(config-ikev2)# key ascii SECRET
Router(config-ikev2)# lifetime 36000
Router(config-ikev2)# match identity address 192.0.2.1
Router(config-ikev2)# self-identity address 198.51.100.1
Router(config-ikev2)# set peer 192.0.2.1
Router(config-ikev2)# exit
Router(config)#!
Router(config)# crypto map GCE1 1
Router(config-crypto-map)# match address 1
Router(config-crypto-map)# set ikev2-policy 1
Router(config-crypto-map)# set pfs group2
Router(config-crypto-map)# set security-association lifetime seconds 10800
Router(config-crypto-map)# set transform-set AES-SHA
Router(config-crypto-map)# set transform-keysize AES128
Router(config-crypto-map)# exit
Router(config)#!
Router(config)# crypto security-association
Router(config-crypto-sa)# ikealive retry max 3
Router(config-crypto-sa)# ikealive retry timer 10
Router(config-crypto-sa)# ikealive freq 10
Router(config-crypto-sa)# exit
Router(config)#!
Router(config)# interface ipsecif 1
Router(config-if ipsecif 1)# crypto map GCE1
Router(config-if ipsecif 1)# ip address 169.254.0.2 255.255.255.252
Router(config-if ipsecif 1)# ip mtu 1390
Router(config-if ipsecif 1)# exit
Router(config)#!
Router(config)#! 経路設定
Router(config)# ip route 0.0.0.0 0.0.0.0 pppoe 1
Router(config)#!
Router(config)#! NAT対象設定
Router(config)# access-list 1 permit any
Router(config)#!
Router(config)#! route-map 対象設定
Router(config)# access-list 5 permit 192.168.10.0 0.0.0.255
Router(config)#!
Router(config)#! フィルタ対象設定
Router(config)# access-list 100 dynamic permit ip any any
Router(config)# access-list 101 permit udp any host 198.51.100.1 eq 500
Router(config)# access-list 101 permit esp any any
Router(config)# access-list 199 deny ip any any
Router(config)#!
Router(config)#! route-map 設定
Router(config)# route-map local_net permit 1
Router(config-rmap local_net permit 1)# match ip address 5
Router(config-rmap local_net permit 1)# exit
Router(config)#!
Router(config)#! BGP 設定
Router(config)# router bgp 65501
Router(config-bgp)# neighbor 169.254.0.1 ebgp-multihop 255
Router(config-bgp)# neighbor 169.254.0.1 remote-as 65500
Router(config-bgp)# redistribute connected route-map local_net
Router(config-bgp)# exit
Router(config)#!
Router(config)#! WANインターフェース設定
Router(config)# interface pppoe 1
Router(config-if pppoe 1)# ip address 198.51.100.1
Router(config-if pppoe 1)# pppoe server internet
Router(config-if pppoe 1)# pppoe account xxxxxxxx@xxx.xxx.ne.jp xxxxxxxx
Router(config-if pppoe 1)# pppoe type lan
Router(config-if pppoe 1)#!  NAT設定
Router(config-if pppoe 1)# ip nat inside source list 1 interface
Router(config-if pppoe 1)#!  フィルタ設定
Router(config-if pppoe 1)# ip access-group 100 out
Router(config-if pppoe 1)# ip access-group 101 in
Router(config-if pppoe 1)# ip access-group 199 in
Router(config-if pppoe 1)# exit
Router(config)#!
Router(config)#! LANインターフェース設定
Router(config)# interface lan 1
Router(config-if lan 1)# ip address 192.168.10.1 255.255.255.0
Router(config-if lan 1)# exit
Router(config)#!
Router(config)#! proxydns設定
Router(config)# proxydns mode v4
Router(config)#!
Router(config)#! DHCPサーバ設定
Router(config)# service dhcp-server
Router(config)# ip dhcp pool lan 1
Router(config-dhcp-pool)# dns-server 0.0.0.0
Router(config-dhcp-pool)# default-router 0.0.0.0
Router(config-dhcp-pool)# exit
Router(config)#!
Router(config)#! 特権ユーザモードに戻ります。
Router(config)#!
Router(config)# end
Router#
!
!
! 設定を保存します。
!
Router# save SIDE-A.cfg
% saving working-config
% finished saving

Router#
!
!
! 設定を有効にするために再起動します。
!
Router# reset
Are you OK to cold start?(y/n) y
GCP への VPN 接続確立確認
拠点ルータから GCP 内に作成した Google Compute Engine VM へ PING による疎通確認ができます。
Router#show ip route
Max entry: 10000 (Commonness in IPv4 and IPv6)
Active entry:7 (IPv4), 2 (IPv6)  Peak:7

Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF
       B - BGP, I - IKE, U - SA-UP, D - REDUNDANCY, E - EventAction
       A - AutoConfig, P - l2tp-ppp
       > - selected route, * - FIB route, p - stale info.

S> * 0.0.0.0/0 [1/0] is directly connected, PPPoE1
B> * 10.100.100.0/24 [20/100] via 169.254.0.1, IPSECIF1, 00:03:24
B> * 10.200.200.0/24 [20/100] via 169.254.0.1, IPSECIF1, 00:03:24
C> * 127.0.0.0/8 is directly connected, LOOP0
C> * 198.51.100.1/32 is directly connected, PPPoE1
C> * 169.254.0.0/30 is directly connected, IPSECIF1
C> * 192.168.10.0/24 is directly connected, LAN

Router#
Router#ping 10.100.100.2 source-interface lan 1
Sending 5, 100-byte ICMP Echos to 10.100.100.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/44/50 ms

Router#
Router#ping 10.200.200.2 source-interface lan 1
Sending 5, 100-byte ICMP Echos to 10.200.200.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/44/50 ms

Router#

ページトップへ

All Rights Reserved, Copyright(C) FURUKAWA ELECTRIC CO., LTD. 2016