YAMAHAルータ リモートアクセスVPN(IKEv2)の設定

2024/02/27 What's Up, YAMAHA, 技術系 投稿者:

弊社お客様からAndroid端末(スマートフォン)から社内サーバへ接続したいとお問い合わせを頂きました。
Android端末はAndroidのバージョン12以降からL2TP/IPsecの設定ができなくなりました。
(Androidバージョン11以前に設定したL2TP/IPsecは利用できます。)
お客様の端末はAndroid端末を新しく切り替えたばかりで、L2TP/IPsecが設定できません。
今回はRTX830にIKEv2を利用したリモートアクセスの設定を紹介したいと思います。

ネットワーク構成

今回のネットワーク構成になります。

使用するルータは「RTX830」で、ファームウェアのリビジョンは「15.02.30」になります。
RTX830でIKEv2リモートVPNに対応しているリビジョンは「15.02.27 」以降になります。
その他の機種についてもリビジョンによって対応していない場合があるので、一度リビジョンの確認をしてください。

ルータ設定

ルータ設定内容

login password *
administrator password encrypted *
user attribute connection=serial,telnet,remote,ssh,sftp,http gui-page=dashboard,lan-map,config login-timer=300
ip route default gateway pp 1
ip lan1 address 192.168.0.1/24
ip lan1 proxyarp on
pp select 1
 pp keepalive interval 30 retry-interval=30 count=12
 pp always-on on
 pppoe use lan2
 pppoe auto disconnect off
 pp auth accept pap chap
 pp auth myname (ISPの接続アカウント) (ISPのパスワード)
 ppp lcp mru on 1454
 ppp ipcp ipaddress on
 ppp ipcp msext on
 ppp ccp type none
 ip pp secure filter in 200003 200020 200021 200022 200023 200024 200025 200030 200032 200100 200101 200102
 ip pp secure filter out 200013 200020 200021 200022 200023 200024 200025 200026 200027 200099 dynamic 200080 200081 200082 200083 200084 200085 200098 200099
 ip pp nat descriptor 1000
 pp enable 1
tunnel select 1
 description tunnel Android
 tunnel encapsulation ipsec
 ipsec tunnel 1
  ipsec sa policy 1 1 esp
  ipsec ike version 1 2
  ipsec ike keepalive log 1 off
  ipsec ike keepalive use 1 on rfc4306 10 3
  ipsec ike local name 1 (ルータAのグローバルIPアドレス) ipv4-addr
  ipsec ike pre-shared-key 1 text (IPsec事前共有鍵)
  ipsec ike remote name 1 (リモートID) fqdn
  ipsec ike mode-cfg address 1 1
  ipsec auto refresh 1 off
 tunnel enable 1
tunnel select 2
 description tunnel Android2
 tunnel encapsulation ipsec
 ipsec tunnel 2
  ipsec sa policy 2 2 esp
  ipsec ike version 2 2
  ipsec ike keepalive log 2 off
  ipsec ike keepalive use 2 on rfc4306 10 3
  ipsec ike local name 2 (ルータAのグローバルIPアドレス) ipv4-addr
  ipsec ike pre-shared-key 2 text (IPsec事前共有鍵)
  ipsec ike remote name 2 (リモートID) fqdn
  ipsec ike mode-cfg address 2 1
  ipsec auto refresh 2 off
 tunnel enable 2
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.0.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.0.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.0.0/24 icmp * *
ip filter 200031 pass * 192.168.0.0/24 established * *
ip filter 200032 pass * 192.168.0.0/24 tcp * ident
ip filter 200033 pass * 192.168.0.0/24 tcp ftpdata *
ip filter 200034 pass * 192.168.0.0/24 tcp,udp * domain
ip filter 200035 pass * 192.168.0.0/24 udp domain *
ip filter 200036 pass * 192.168.0.0/24 udp * ntp
ip filter 200037 pass * 192.168.0.0/24 udp ntp *
ip filter 200099 pass * * * * *
ip filter 200100 pass * 192.168.0.1 udp * 500
ip filter 200101 pass * 192.168.0.1 esp
ip filter 200102 pass * 192.168.0.1 udp * 4500
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
nat descriptor type 1000 masquerade
nat descriptor masquerade static 1000 1 192.168.0.1 udp 500
nat descriptor masquerade static 1000 2 192.168.0.1 esp
nat descriptor masquerade static 1000 3 192.168.0.1 udp 4500
ipsec ike mode-cfg address pool 1 192.168.0.200-192.168.0.215/24
telnetd host lan
dhcp service server
dhcp server rfc2131 compliant except remain-silent
dhcp scope 1 192.168.0.2-192.168.0.99/24
dns host lan1
dns server pp 1
dns server select 500001 pp 1 any . restrict pp 1
dns private address spoof on
schedule at 1 */* 05:00:00 * ntpdate ntp.nict.jp syslog
statistics traffic on

設定の注意点

IKEv2の設定にあたり下記に気を付けましょう。
・WEB GUIに対応していないため、コマンドを入力する必要があります。
・認証方式は事前共有鍵方式(PSK)のみの対応となります。

IKEv2の設定

IKEv2の設定はWEB GUIの管理画面から設定はできません。しかし、LANアドレスやDHCP範囲、PPPoE設定などWEB GUIで設定できるものは事前に設定をしておきましょう。
WEB GUIから必要な設定が終わったのち、下記のコマンドをtelnetやWEB GUIの「コマンドの実行」から入力・設定を行います。

外部から応答できるように代理ARPの設定

ip lan1 proxyarp on

NATの設定

nat descriptor masquerade static 1000 1 192.168.0.1 udp 500
nat descriptor masquerade static 1000 2 192.168.0.1 esp
nat descriptor masquerade static 1000 3 192.168.0.1 udp 4500

フィルタ設定

ip filter 200100 pass * 192.168.0.1 udp * 500
ip filter 200101 pass * 192.168.0.1 esp
ip filter 200102 pass * 192.168.0.1 udp * 4500
pp select 1
ip pp secure filter in 200003 200020 200021 200022 200023 200024 200025 200030 200032 200100 200101 200102

トンネル設定

tunnel select 1
description tunnel Android
tunnel encapsulation ipsec
ipsec tunnel 1
ipsec sa policy 1 1 esp
ipsec ike version 1 2
ipsec ike keepalive log 1 off
ipsec ike keepalive use 1 on rfc4306 10 3
ipsec ike local name 1 (ルータAのグローバルIPアドレス) ipv4-addr
ipsec ike pre-shared-key 1 text (IPsec事前共有鍵)
ipsec ike remote name 1 (リモートID) fqdn
ipsec ike mode-cfg address 1 1
ipsec auto refresh 1 off
tunnel enable 1

IPsecクライアントに割り当てるIPアドレスの範囲設定

ipsec ike mode-cfg address pool 1 192.168.0.200-192.168.0.215/24

クライアント設定

アンドロイド端末へ設定する内容になります。
アンドロイド端末では項目名がルータ設定と違いわかりにくい場合がありますので、下記を参考にして設定を行います。

L2TP/IPsecとの併用

リビジョンがIKEv2に対応していれば、既存の設定に追記するだけでIKEv2に対応ができます。もちろん、L2TP/IPsecとの併用も可能です。現在の設定を確認した上で、下記に注意し設定してください。

・NAT設定
  NATディスクリプタ番号
  静的 IP マスカレードエントリの識別情報
・フィルタ設定
  静的フィルタ番号
・トンネル設定
  トンネルインタフェース番号
  ポリシーID
  セキュリティ・ゲートウェイの識別子
・IPsecクライアントに割り当てるIPアドレスの範囲設定
  DHCPサーバの範囲

まとめ

今までL2TP/IPsecが利用できていたのが、Androidバージョン12以降では設定ができなくなりました。対応させるため新しくルータを購入したり、設定を一からやり直したりする前に一度立ち止まって考えましょう。YAMAHAルータであれば既存の設定に追記するだけでIKEv2に対応できるだけでなく、L2TP/IPsecとの併用ができる場合があります。
追記するためには既存設定をしっかり把握し、追記するコマンドもそのまま利用できるわけではないので、既存設定を考慮した内容に書き換える必要があります。設定をミスしてしまうと既存設定が消えてしまうので気を付けましょう。
ネディアでは既存設定の確認から追加設定まで対応できますので、お気軽にお問い合わせください。

 

カレンダー

    123
45678910
11121314151617
18192021222324
25262728293031
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
      1
2345678
9101112131415
16171819202122
23242526272829
30      
   1234
567891011
12131415161718
19202122232425
262728293031 
       
 123456
78910111213
14151617181920
21222324252627
282930    
       
     12
3456789
10111213141516
17181920212223
24252627282930
31      
     12
3456789
10111213141516
17181920212223
2425262728  
       
  12345
6789101112
13141516171819
20212223242526
2728293031  
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
    123
45678910
11121314151617
18192021222324
252627282930 
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
      1
2345678
9101112131415
16171819202122
23242526272829
30      
   1234
567891011
12131415161718
19202122232425
262728293031 
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
     12
3456789
10111213141516
17181920212223
24252627282930
       
  12345
6789101112
13141516171819
20212223242526
2728293031  
       
1234567
891011121314
15161718192021
22232425262728
2930     
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
   1234
567891011
12131415161718
19202122232425
26272829   
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
  12345
6789101112
13141516171819
20212223242526
27282930   
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
    123
45678910
11121314151617
18192021222324
252627282930 
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
     12
3456789
10111213141516
17181920212223
24252627282930
31      
   1234
567891011
12131415161718
19202122232425
2627282930  
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
     12
3456789
10111213141516
17181920212223
24252627282930
       
  12345
6789101112
13141516171819
20212223242526
2728293031  
       
  12345
6789101112
13141516171819
20212223242526
2728     
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
   1234
567891011
12131415161718
19202122232425
262728293031 
       
 123456
78910111213
14151617181920
21222324252627
282930    
       
     12
3456789
10111213141516
17181920212223
24252627282930
31      
   1234
567891011
12131415161718
19202122232425
2627282930  
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
  12345
6789101112
13141516171819
20212223242526
27282930   
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
    123
45678910
11121314151617
18192021222324
252627282930 
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
  12345
6789101112
13141516171819
20212223242526
2728293031  
       
1234567
891011121314
15161718192021
22232425262728
2930     
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
  12345
6789101112
13141516171819
20212223242526
27282930   
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
   1234
567891011
12131415161718
19202122232425
262728293031 
       
 123456
78910111213
14151617181920
21222324252627
282930    
       
     12
3456789
10111213141516
17181920212223
24252627282930
31      
   1234
567891011
12131415161718
19202122232425
2627282930  
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
1234567
891011121314
15161718192021
22232425262728
       
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
      1
2345678
9101112131415
16171819202122
23242526272829
30      
     12
3456789
10111213141516
17181920212223
24252627282930
31      
1234567
891011121314
15161718192021
22232425262728
2930     
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
  12345
6789101112
13141516171819
20212223242526
27282930   
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
     12
3456789
10111213141516
17181920212223
242526272829 
       
  12345
6789101112
13141516171819
20212223242526
2728293031  
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
    123
45678910
11121314151617
18192021222324
252627282930 
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
      1
2345678
9101112131415
16171819202122
23242526272829
30      
   1234
567891011
12131415161718
19202122232425
262728293031 
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
     12
3456789
10111213141516
17181920212223
24252627282930
       
  12345
6789101112
13141516171819
20212223242526
2728293031  
       
1234567
891011121314
15161718192021
22232425262728
2930     
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
    123
45678910
11121314151617
18192021222324
25262728   
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
     12
3456789
10111213141516
17181920212223
24252627282930
31      
   1234
567891011
12131415161718
19202122232425
2627282930  
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
     12
3456789
10111213141516
17181920212223
24252627282930
       
  12345
6789101112
13141516171819
20212223242526
2728293031  
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
    123
45678910
11121314151617
18192021222324
252627282930 
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
      1
2345678
9101112131415
16171819202122
23242526272829
30      
   1234
567891011
12131415161718
19202122232425
262728293031 
       
   1234
567891011
12131415161718
19202122232425
262728    
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
  12345
6789101112
13141516171819
20212223242526
27282930   
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
    123
45678910
11121314151617
18192021222324
252627282930 
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
     12
3456789
10111213141516
17181920212223
24252627282930
31      
   1234
567891011
12131415161718
19202122232425
2627282930  
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
     12
3456789
10111213141516
17181920212223
24252627282930
       
  12345
6789101112
13141516171819
20212223242526
2728     
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
   1234
567891011
12131415161718
19202122232425
262728293031 
       
 123456
78910111213
14151617181920
21222324252627
282930    
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
  12345
6789101112
13141516171819
20212223242526
27282930   
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
    123
45678910
11121314151617
18192021222324
252627282930 
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
1234567
891011121314
15161718192021
22232425262728
29      
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
      1
2345678
9101112131415
16171819202122
23242526272829
30      
   1234
567891011
12131415161718
19202122232425
262728293031 
       
 123456
78910111213
14151617181920
21222324252627
282930    
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
  12345
6789101112
13141516171819
20212223242526
27282930   
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
      1
2345678
9101112131415
16171819202122
232425262728 
       
   1234
567891011
12131415161718
19202122232425
262728293031 
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
     12
3456789
10111213141516
17181920212223
24252627282930
       
  12345
6789101112
13141516171819
20212223242526
2728293031  
       
1234567
891011121314
15161718192021
22232425262728
2930     
       
    123
45678910
11121314151617
18192021222324
25262728293031
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
      1
2345678
9101112131415
16171819202122
23242526272829
30      
   1234
567891011
12131415161718
19202122232425
262728293031 
       
 123456
78910111213
14151617181920
21222324252627
282930    
       
     12
3456789
10111213141516
17181920212223
2425262728  
       
  12345
6789101112
13141516171819
20212223242526
2728293031  
       
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
    123
45678910
11121314151617
18192021222324
252627282930 
       
 123456
78910111213
14151617181920
21222324252627
28293031   
       
      1
2345678
9101112131415
16171819202122
23242526272829
30      
   1234
567891011
12131415161718
19202122232425
262728293031 
       
1234567
891011121314
15161718192021
22232425262728
293031    
       
U・Iターン転職しませんか?
群馬データセンター
群馬の法人ITサポートサービス Wide Net[ワイドネット]
Wide Netのクラウドバックアップ
クラウド型ファイル共有サービスRushDrive
ワイドオフィス
ネディアのSDGsへの取り組み
健康経営優良法人
IT-commons(ITコモンズ)