LoginSignup
3

More than 1 year has passed since last update.

Oracle Cloud:イオンモバイルを入れたYAMAHA RTXルータでIPSec VPN接続してみてみた

Last updated at Posted at 2018-07-30

イオンモバイル(タイプ2)は Global IP(Public IP) ということで、YAMAHA RTX830 を使って Wi-Fi によるVPN接続してみました。

・NW 構成イメージ
NW構成イメージ1.png

■Public Subnet?Private Subnet?

一般的なNetworkデザインは大きく2つあります。

①Public IP でアクセスされる Public Subnet

Public Subnet内のインスタンスは Public IPアドレス(Global IP)を持つことができます。
Internet Gatewayを使用してInternet アクセスすることができます。
Public Subnet.png

②VPNを使用したPrivate Subnet

Private Subnet内のインスタンスは パブリックIPアドレスを持つことができません
そのため、Internet Gatewayを使用してInternet アクセスすることができません
今回は完全に外部InternetからのGlobal IP でアクセスできないVPNを使用したプライベート・サブネットの構成でPrivate Cloud環境接続を作ります。
Privaate Subnet.png

■OnP環境

項目 内容
ルーター YAMAHA RTX830
USB Wi-Fi Docomo L-05A
Wi-Fi用SIM イオンモバイル データプラン(TYPE2)
PC ノートPC 100BASE-TX

・OnP環境イメージ
IMGsmall.jpg

■各種環境情報

●Oracle Cloud Infrastructure

項目 内容
VPN CIDR block 10.0.0.0/16
VPN IPSec tunnel1 endpoint 100.100.100.101
VPN IPSec tunnel1 Shared Secret TESTSr4yZv45GlNIpxtfrsGpHPQ6LtrZzu8P0xtEst
VPN IPSec tunnel2 endpoint 100.100.200.102
VPN IPSec tunnel2 Shared Secret ESTSr4yZv45GlNIpxtBjBQ6x0Q6LtrZzu8P0xtEst

●OnP

項目 内容 情報
WAN Wi-Fi AEON-Mobile
WAN AEON-Mobile APN n-aeonmobile.com
WAN AEON-Mobile ユーザ名 user@n-aeonmobile.com
WAN AEON-Mobile パスワード 0000
WAN AEON-Mobile Global IP 200.200.200.201
LAN Private CIDR block 192.168.100.0/24
LAN Router Address 192.168.100.1
LAN PC IP Address 192.168.100.2

■自宅側OnP Router インターネット接続設定

①Wi-Fi設定

WebUI(http://192.168.100.1) へ接続
・プロバイダ情報の設定画面から、モバイルインターネット接続をクリック
1_WAN側設定.png

・以下情報を入力し設定
2_WAN側設定2.png

・DNSは今回は自動認識以下情報を入力し設定
3_WAN側設定3.png

②Internet疎通確認

プロバイダ接続画面で通信中となり、グローバルアドレス(200.200.200.201)が降られていることを確認しメモします。
99_疎通完了1.png

③接続設定確認

CUIで設定値確認

> show config
    # RTX810 Rev.11.01.33 (Fri Apr 20 08:44:58 2018)
    # MAC Address : 00:00:ab:cd:12:ab, 00:00:ab:3cd:12:cd
    # Memory 128Mbytes, 2LAN
    # main:  RTX810 ver=00 serial=RTX2619 MAC-Address=00:00:ab:cd:12:ab MAC-Address=00:00:ab:3cd:12:cd
    # Reporting Date: Jul 30 22:39:29 2018
    login password *
    administrator password *
    login user oracle *
    login timer clear
    ip route default gateway pp 1 filter 500000 gateway pp 1
    ip route 10.0.0.0/16 gateway tunnel 1 hide gateway tunnel 2 hide
    ip lan1 address 192.168.100.1/24
    provider type isdn-terminal
    provider filter routing connection
    pp select 1
     pp name PRV/1/1/5/0/0/0:AEON-Mobile
     pp bind usb1
     pp auth accept pap chap
     pp auth myname user@n-aeonmobile.com 0000
     ppp lcp mru off 1792
     ppp lcp accm on
     ppp lcp pfc on
     ppp lcp acfc on
     ppp ipcp ipaddress on
     ppp ipcp msext on
     ppp ipv6cp use off
     ip pp secure filter in 200003 200020 200021 200022 200023 200024 200025 200030
     200032
     ip pp secure filter out 200013 200020 200021 200022 200023 200024 200025 20002
    6 200027 200099 dynamic 200080 200081 200082 200083 200084 200085 200098 200099
     ip pp nat descriptor 1000
     mobile auto connect on
     mobile access-point name n-aeonmobile.com cid=1
     mobile access limit length off
     mobile access limit time off
     pp enable 1
    provider set 1 AEON-Mobile
     provider dns server pp 1 1
     provider select 1
    dns server pp 1
    dns server select 500001 pp 1 any . restrict pp 1
    dns private address spoof on

■Oracle Cloud 側設定

① Customer-Premises Equipment (CPE)作成

・OCI コンソールの Networking から Customer-Premises Equipment画面を選択し、
自宅WAN の Public IP address(200.200.200.201)をポイントしてCPE作成

02_CPE作成2.jpg

・CPE作成確認
03_CPE作成3.jpg

② DRG作成

・OCI コンソールの Networking から Dynamic Routing Gateways(DRG)画面を選択し、
DRGを接続するVCN:YAMAHA-DRG (10.0.0.0/16)へアタッチして作成
06_DRG作成2.jpg

・DRG作成確認
07_DRG作成3.jpg

③ VCN の Route Rules設定

DRGに 自宅 CIDR (192.168.100.0/24)を Route tablesに追加
14_Route設定1.jpg

④ DRGのIPSec Connections作成

・作成したDRGに 自宅CIDR (192.168.100.0/16)をポイントして作成
09_DRG-IPsec作成2.jpg

・作成後 右端の ・・・(Actions icon) からTunnel Informationメニューをクリックして
11_DRG-IPsec作成4.jpg

・DOWN state (まだ自宅側の設定ができていなため)であることを確認
99_IPsec疎通待ちpng.png

■自宅側OnP Router VPN設定

●VPN設定

sshでCUI接続して以下コマンドを実行して設定

① NAT設定

ip loopback1 address 200.200.200.201
nat descriptor type 1000 masquerade
nat descriptor address outer 1000 200.200.200.201
nat descriptor masquerade static 1000 1 192.168.100.1 udp 500
nat descriptor masquerade static 1000 2 192.168.100.1 esp 

② フィルター設定

    ip filter 200000 reject 10.0.0.0/8 * * * *
    ip filter 200001 reject 172.16.0.0/12 * * * *
    ip filter 200002 reject 192.168.0.0/16 * * * *
    ip filter 200003 reject 192.168.100.0/24 * * * *
    ip filter 200010 reject * 10.0.0.0/8 * * *
    ip filter 200011 reject * 172.16.0.0/12 * * *
    ip filter 200012 reject * 192.168.0.0/16 * * *
    ip filter 200013 reject * 192.168.100.0/24 * * *
    ip filter 200020 reject * * udp,tcp 135 *
    ip filter 200021 reject * * udp,tcp * 135
    ip filter 200022 reject * * udp,tcp netbios_ns-netbios_ssn *
    ip filter 200023 reject * * udp,tcp * netbios_ns-netbios_ssn
    ip filter 200024 reject * * udp,tcp 445 *
    ip filter 200025 reject * * udp,tcp * 445
    ip filter 200026 restrict * * tcpfin * www,21,nntp
    ip filter 200027 restrict * * tcprst * www,21,nntp
    ip filter 200030 pass * 192.168.100.0/24 icmp * *
    ip filter 200031 pass * 192.168.100.0/24 established * *
    ip filter 200032 pass * 192.168.100.0/24 tcp * ident
    ip filter 200033 pass * 192.168.100.0/24 tcp ftpdata *
    ip filter 200034 pass * 192.168.100.0/24 tcp,udp * domain
    ip filter 200035 pass * 192.168.100.0/24 udp domain *
    ip filter 200036 pass * 192.168.100.0/24 udp * ntp
    ip filter 200037 pass * 192.168.100.0/24 udp ntp *
    ip filter 200080 pass * 192.168.100.1 udp * 500 #
    ip filter 200081 pass * 192.168.100.1 esp * * #
    ip filter 200098 reject-nolog * * established
    ip filter 200099 pass * * * * *
    ip filter 500000 restrict * * * * *
    ip filter dynamic 200080 * * ftp
    ip filter dynamic 200081 * * domain
    ip filter dynamic 200082 * * www
    ip filter dynamic 200083 * * smtp
    ip filter dynamic 200084 * * pop3
    ip filter dynamic 200085 * * submission
    ip filter dynamic 200098 * * tcp
    ip filter dynamic 200099 * * udp

③ VPN(IPsec)tunnel1設定

ip route 10.0.0.0/16 gateway tunnel 1 hide gateway tunnel 2 hide

tunnel select 1
description tunnel OCI-VPN1
ipsec tunnel 1
ipsec sa policy 1 1 esp aes256-cbc sha-hmac
ipsec ike duration ipsec-sa 1 3600
ipsec ike duration isakmp-sa 1 28800
ipsec ike encryption 1 aes256-cbc
ipsec ike group 1 modp1536
ipsec ike hash 1 sha256
ipsec ike keepalive log 1 off
ipsec ike keepalive use 1 on dpd 5 4
ipsec ike local address 1 200.200.200.201
ipsec ike local id 1 0.0.0.0/0
ipsec ike nat-traversal 1 on
ipsec ike pfs 1 on
ipsec ike pre-shared-key 1 text TESTSr4yZv45GlNIpxtfrsGpHPQ6LtrZzu8P0xtEst
ipsec ike remote address 1 100.100.100.101
ipsec ike remote id 1 0.0.0.0/0
ip tunnel tcp mss limit auto
tunnel enable 1

④ VPN(IPsec)tunnel2設定

tunnel select 2
description tunnel OCI-VPN2
ipsec tunnel 2
ipsec sa policy 2 2 esp aes256-cbc sha-hmac
ipsec ike duration ipsec-sa 2 3600
ipsec ike duration isakmp-sa 2 28800
ipsec ike encryption 2 aes256-cbc
ipsec ike group 2 modp1536
ipsec ike hash 2 sha256
ipsec ike keepalive log 2 off
ipsec ike keepalive use 2 on dpd 5 4
ipsec ike local address 2 200.200.200.201
ipsec ike local id 2 0.0.0.0/0
ipsec ike nat-traversal 2 on
ipsec ike pfs 2 on
ipsec ike pre-shared-key 2 text TESTSr4yZv45GlNIpxtBjBQ6x0Q6LtrZzu8P0xtEst
ipsec ike remote address 2 100.100.200.102
ipsec ike remote id 2 0.0.0.0/0
ip tunnel tcp mss limit auto
tunnel enable 2
### VPN(IPsec)の設定(共通項目)
ipsec auto refresh on

●routeテーブル確認

> show ip route
宛先ネットワーク    ゲートウェイ     インタフェース  種別  付加情報
default             -                    PP[01]    static  filter:500000
default             -                    PP[01]    static
200.28.103.101/32     -                  PP[01] temporary
200.170.93.102/32   -                    PP[01] temporary
192.168.100.0/24    192.168.100.1          LAN1  implicit

■VPN疎通確認

●自宅Router確認

設定した2つのTunnelが通信中であることを確認
99_疎通完了2.png

●OCI Tunnel Information画面

DOWN state が UP state になっていることを確認
99_IPsec疎通完了2.png

■VPN接続テスト

自宅Windows PC(192.168.100.2) からOCI に作成した Compute Instance(10.0.1.2)との接続確認

●Ping確認

PS C:\Users\shiro> ping 10.0.1.2

    10.0.1.2 に ping を送信しています 32 バイトのデータ:
    10.0.1.2 からの応答: バイト数 =32 時間 =267ms TTL=52
    10.0.1.2 からの応答: バイト数 =32 時間 =265ms TTL=52
    10.0.1.2 からの応答: バイト数 =32 時間 =265ms TTL=52
    10.0.1.2 からの応答: バイト数 =32 時間 =264ms TTL=52

    10.0.1.2 の ping 統計:
        パケット数: 送信 = 4、受信 = 4、損失 = 0 (0% の損失)、
    ラウンド トリップの概算時間 (ミリ秒):
        最小 = 264ms、最大 = 267ms、平均 = 265ms

●ssh確認

・Teraterm 起動
01.png

・接続鍵を指定して[OK]をクリックしてopcユーザーでLogin
02.png

・sshログイン完了

Last login: Sun Jul 29 14:59:18 2018 from 192.168.100.2
[opc@yamaha-inst01 ~]$ hostname
 yamaha-inst01

●連続通信接続テスト

10日間(240時間)以上連続稼働することを確認

連続稼働2.png

■参考

● ヤマハネットワーク製品

- Oracle Cloud Infrastructureの仮想ネットワーク(IPsec)を設定する
- Oracle Cloud InfrastructureとVPN(IPsec)接続するルーターの設定 : コマンド設定

● Oracle Cloud Infrastructureドキュメント

OSite - to - Site VPN: ヤマハRTXシリーズ

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3