LoginSignup
3
2

More than 3 years have passed since last update.

Oracle Cloud:YAMAHAルーターのVRRPでWAN回線を冗長化してみてみた

Last updated at Posted at 2019-04-04

ルーター冗長化のために、ISPのインターネット・プロバイダを2つ契約してVRRPでWAN回線を冗長化してみてみます。
回線のISPは、InterlinkとAEON Mobileを使用します。
ルーターは、NVR700wをマスタールーター、RTXをバックアップルーターとして設定します。
NVR700wのWAN回線に障害が発生した場合、RTXがマスタールーターとなって動作します。

■構成

構成.png

■手順

各ルーターの構成までは、以前の記事の手順で構築しOCIへInternetで接続できるところまで確認しておきます。

・NVR700w設定
  Oracle Cloud:YAMAHA NVR700wでOCIへIPsec VPN接続してみてみた

・RTX設定
  Oracle Cloud:イオンモバイルによる VPNルータでPrivate IP アクセスする自宅LABO環境を構築してみてみた

ここでは、VRRPの設定から行います。

●マスター・ルーター RTX700w設定

①LANインターフェースとVRRPの設定(LAN1ポートを使用)

# ip lan1 address 192.168.100.254/24
# ip lan1 vrrp 1 192.168.100.1 priority=200
# ip lan1 vrrp shutdown trigger 1 pp 1

②VRRP設定確認

# show status vrrp
 LAN1 ID:1  Virtual-IP: 192.168.100.1
  Current master: 192.168.100.254 Priority: 200
       Own state: Master / Priority: 200  Preempt  Auth: NONE  Timer: 1

●バックアップ・ルーター RTX設定

・LANインターフェースとVRRPの設定(LAN1ポートを使用)

# ip lan1 address 192.168.100.253/24
# ip lan1 vrrp 1 192.168.100.2 priority=100

②VRRP設定確認
MasterがNVR700wの192.168.100.254で登録されていることを確認

# show status vrrp
 LAN1 ID:1  Virtual-IP: 192.168.100.1
  Current master: 192.168.100.254 Priority: 200
       Own state: Backup / Priority: 100  Preempt  Auth: NONE  Timer: 1

●オンプレミス側インスタンス設定

オンプレミス側インスタンス onp-inst01のDefault GatewayをVRRPの192.168.100.1に設定します。

■接続確認

①onp-inst01からVRRPの192.168.100.1への接続はマスター・ルーターのNVR700Wに接続されることを確認

[root@onp-inst01 ~]#  ssh root@192.168.100.1
    root@192.168.100.1's password:

    NVR700W Rev.15.00.15 (Fri Nov 16 16:17:57 2018)
    Copyright (c) 1994-2018 Yamaha Corporation. All Rights Reserved.
    To display the software copyright statement, use 'show copyright' command.
    00:00:ae:c7:1d:21, 00:00:ae:c7:1d:22
    Memory 256Mbytes, 2LAN, 1ONU, 1WWAN
    >

②onp-inst01からOCIのoci-Inst01へ接続できることを確認

[root@onp-inst01 ~]# ssh -i id_rsa opc@100.100.100.101
    Last login: Tue Apr  2 04:42:48 2019 from 192.168.100.2

■VRRP検証

マスター・ルーター RTX700wのLANを抜線し、バックアップ・ルーター RTXにVRRPのVIP192.168.100.1がフェールオーバーし、Internet回線がEAON Mobleのバックアップ回線使用するようになり、Internetアクセスが使用できることを確認します

●マスター・ルーターLAN抜線検証

①抜線前確認
pingを発行して通信が継続していることを確認

・マスター・ルーター RTX700w

[root@onp-inst01 ~]# ping  192.168.100.254
    PING 192.168.100.254 (192.168.100.254): 56 data bytes
    64 bytes from 192.168.100.254: icmp_seq=0 ttl=254 time=1.405 ms
    64 bytes from 192.168.100.254: icmp_seq=1 ttl=254 time=1.183 ms
    64 bytes from 192.168.100.254: icmp_seq=2 ttl=254 time=2.300 ms
    ・・・

・バックアップ・ルーターRTX

[root@onp-inst01 ~]# ping 192.168.100.253
    PING 192.168.100.253 (192.168.100.253): 56 data bytes
    64 bytes from 192.168.100.253: icmp_seq=0 ttl=254 time=1.435 ms
    64 bytes from 192.168.100.253: icmp_seq=1 ttl=254 time=1.055 ms
    64 bytes from 192.168.100.253: icmp_seq=2 ttl=254 time=1.238 ms
    ・・・

・VRRP

[root@onp-inst01 ~]# ping 192.168.100.1
    PING 192.168.100.1 (192.168.100.1): 56 data bytes
    64 bytes from 192.168.100.1: icmp_seq=0 ttl=254 time=2.096 ms
    64 bytes from 192.168.100.1: icmp_seq=1 ttl=254 time=2.230 ms
    64 bytes from 192.168.100.1: icmp_seq=2 ttl=254 time=2.233 ms
    ・・・

・Internet Google.com

[root@onp-inst01 ~]# ping google.com
    PING google.com (216.58.197.142): 56 data bytes
    64 bytes from 216.58.197.142: icmp_seq=0 ttl=54 time=6.862 ms
    64 bytes from 216.58.197.142: icmp_seq=1 ttl=54 time=4.873 ms
    64 bytes from 216.58.197.142: icmp_seq=2 ttl=54 time=6.746 ms
    ・・・

②抜線
マスター・ルーター RTX700wのLANを抜線し、pingの状況を確認

・マスター・ルーター RTX700w
マスター・ルーターのLANを抜線したので、timeoutで通信不通になることを確認

    ・・・
    64 bytes from 192.168.100.254: icmp_seq=21 ttl=254 time=1.277 ms
    64 bytes from 192.168.100.254: icmp_seq=22 ttl=254 time=1.905 ms
    64 bytes from 192.168.100.254: icmp_seq=23 ttl=254 time=1.923 ms
    Request timeout for icmp_seq 24
    Request timeout for icmp_seq 25
    Request timeout for icmp_seq 26
    ・・・

・バックアップ・ルーターRTX
マスター・ルーターのLANを抜線に影響しないことを確認

    ・・・
    64 bytes from 192.168.100.253: icmp_seq=27 ttl=254 time=1.522 ms
    64 bytes from 192.168.100.253: icmp_seq=28 ttl=254 time=1.128 ms
    64 bytes from 192.168.100.253: icmp_seq=29 ttl=254 time=1.574 ms
    ・・・

・VRRP
マスター・ルーターのLANを抜線したので、timeoutで数秒間通信不通になるが、
自動でバックアップ・ルーターRTXにフェールオーバーするので自動で通信疎通することを確認

    ・・・
    64 bytes from 192.168.100.1: icmp_seq=47 ttl=254 time=1.149 ms
    64 bytes from 192.168.100.1: icmp_seq=48 ttl=254 time=1.033 ms
    64 bytes from 192.168.100.1: icmp_seq=49 ttl=254 time=1.589 ms
    Request timeout for icmp_seq 50
    Request timeout for icmp_seq 51
    Request timeout for icmp_seq 52
    64 bytes from 192.168.100.1: icmp_seq=53 ttl=254 time=1.500 ms
    64 bytes from 192.168.100.1: icmp_seq=54 ttl=254 time=1.153 ms
    64 bytes from 192.168.100.1: icmp_seq=55 ttl=254 time=1.213 ms
    ・・・

・Internet Google.com
マスター・ルーターのLANを抜線したので、timeoutで数秒間通信不通になるが、
自動でバックアップ・ルーターRTXにフェールオーバーするので自動で通信疎通することを確認

    ・・・
    64 bytes from 216.58.197.142: icmp_seq=13 ttl=54 time=5.473 ms
    64 bytes from 216.58.197.142: icmp_seq=14 ttl=54 time=6.335 ms
    64 bytes from 216.58.197.142: icmp_seq=15 ttl=54 time=7.388 ms
    Request timeout for icmp_seq 16
    Request timeout for icmp_seq 17
    Request timeout for icmp_seq 18
    64 bytes from 216.58.197.142: icmp_seq=19 ttl=51 time=410.951 ms
    64 bytes from 216.58.197.142: icmp_seq=20 ttl=51 time=394.324 ms
    64 bytes from 216.58.197.142: icmp_seq=21 ttl=51 time=455.426 ms
    ・・・

③VRRP状態確認

VRRPへ接続ssh接続するとバックアップ・ルーターRTXへ接続されることを確認
これでonp-inst01はバックアップ回線で通信されていることを確認できます

・VRRPへssh接続
VRRPへ接続ssh接続すると接続するホストが変わるため、$HOME/.ssh/known_hostsに登録されているVRRPのアドレスのホスト情報と異なるためsshできません。

[root@onp-inst01 ~]# ssh root@192.168.100.1
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
    Someone could be eavesdropping on you right now (man-in-the-middle attack)!
    It is also possible that a host key has just been changed.
    The fingerprint for the RSA key sent by the remote host is
    SHA256:ABRTXLPNlIBE7PxAS.
    Please contact your system administrator.
    Add correct host key in /Users/root/.ssh/known_hosts to get rid of this message.
    Offending RSA key in /Users/root/.ssh/known_hosts:22
    RSA host key for 192.168.100.1 has changed and you have requested strict checking.
    Host key verification failed.

・$HOME/.ssh/known_hosts修正
そのため、$HOME/.ssh/known_hostsから、VRRPの192.168.100.1の行を削除します。

[root@onp-inst01 ~]# vi .ssh/known_hosts
    192.168.100.1 ssh-rsa AAAAB3・・・eUc=
    <--この行を削除

・VRRPへssh再接続

[root@onp-inst01 ~]# ssh root@192.168.100.1
    The authenticity of host '192.168.100.1 (192.168.100.1)' can't be established.
    RSA key fingerprint is SHA256:ABRTXLPNlIBE7PxAS.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '192.168.100.1' (RSA) to the list of known hosts.
    root@192.168.100.1's password:


    RTX810 BootROM Ver. 1.00
    RTX810 FlashROM Table Ver. 1.00

    RTX810 Rev.11.01.33 (Fri Apr 20 08:44:58 2018)
    Copyright (c) 1994-2018 Yamaha Corporation. All Rights Reserved.
    To display the software copyright statement, use 'show copyright' command.
    00:00:ae:c7:1d:bd, 00:00:ae:c7:1d:be
    Memory 128Mbytes, 2LAN

・VRRP状態確認
バックアップ・ルーターRTXのLAN IPアドレス192.168.100.253がCurrent masterになっていることを確認

> administrator
    Password:
# show status vrrp
     LAN1 ID:1  Virtual-IP: 192.168.100.1
      Current master: 192.168.100.253 Priority: 100
           Own state: Master / Priority: 100  Preempt  Auth: NONE  Timer: 1

●マスター・ルーターLAN再結線検証

抜線したマスター・ルーターNVR700wのLANケーブルを挿し戻すことで、バックアップ・ルーターRTXにVRRPが移っていたものが、マスター・ルーターNVR700wへフェールバックすることを確認します。

①マスター・ルーターLAN再結線
抜線したマスター・ルーターNVR700wのLANケーブルを挿し戻します

②VRRPへssh接続
VRRPへssh接続することで、マスター・ルーターNVR700wに接続されることを確認

[root@onp-inst01 ~]# ssh root@192.168.100.1
    The authenticity of host '192.168.100.1 (192.168.100.1)' can't be established.
    RSA key fingerprint is SHA256:NVR700wRWtaw8.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '192.168.100.1' (RSA) to the list of known hosts.
    root@192.168.100.1's password:


    NVR700W Rev.15.00.15 (Fri Nov 16 16:17:57 2018)
    Copyright (c) 1994-2018 Yamaha Corporation. All Rights Reserved.
    To display the software copyright statement, use 'show copyright' command.
    00:00:ae:c7:1d:21, 00:00:ae:c7:1d:22
    Memory 256Mbytes, 2LAN, 1ONU, 1WWAN

③VRRP状態確認
マスター・ルーターNVR700wのIPアドレス192.168.100.254がCurrent masteになっていることを確認

# show status vrrp
 LAN1 ID:1  Virtual-IP: 192.168.100.1
  Current master: 192.168.100.254 Priority: 200
       Own state: Master / Priority: 200  Preempt  Auth: NONE  Timer: 1

④バックアップ・ルーターRTXのVRRP状態確認

・バックアップ・ルーターRTXへssh接続

[root@onp-inst01 ~]# ssh root@192.168.100.253
    root@192.168.100.253's password:


    RTX810 BootROM Ver. 1.00
    RTX810 FlashROM Table Ver. 1.00

    RTX810 Rev.11.01.33 (Fri Apr 20 08:44:58 2018)
    Copyright (c) 1994-2018 Yamaha Corporation. All Rights Reserved.
    To display the software copyright statement, use 'show copyright' command.
    00:00:ae:c7:1d:bd, 00:00:ae:c7:1d:be
    Memory 128Mbytes, 2LAN

・VRRP状態確認
マスター・ルーターNVR700wのIPアドレス192.168.100.254がCurrent masteになっていることを確認

> administrator
    Password:
# show status vrrp
     LAN1 ID:1  Virtual-IP: 192.168.100.1
      Current master: 192.168.100.254 Priority: 200
           Own s

■参考

YAMAHA:WAN回線障害時に備える(VRRPを使用) : コマンド設定
VRRP/VRRPv3

3
2
0

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
2