LoginSignup
4
2

More than 5 years have passed since last update.

SoftLayer仮想サーバーでVyOSの冗長化構成を勉強2-(GRE LAN間接続編)

Posted at

1. はじめに

VyOSの冗長化構成で、GRE LAN間接続を試しました。
SoftLayer仮想ルーターを冗長化構成で構築する場合、ベアメタルサーバーと有償版のVyattaで構築する方法があります。
今回は、仮想サーバーにVyOSを導入し、VRRPで冗長化を行った環境でGRE LAN間接続の構成です。

下記情報も併せてご覧ください。
・VyOS導入
「SoftLayer仮想サーバにVyOSをインストールしました」
http://qiita.com/Mitsu-Murakita/items/d793250566a8e9f3562b

・GRE LAN間接続
「SoftLayerとvyosでネットワークの基礎を勉強1-(トンネルGRE編)」
http://qiita.com/Mitsu-Murakita/items/73d497b391664273174e

・VRRP
「SoftLayer仮想サーバーでVyOSの冗長化構成を勉強1-(VRRP基本構成編)」
http://qiita.com/Mitsu-Murakita/items/15660fd4281959816a0f

2. 構成について

2-1. 全体構成

SoftlayerのシンガポールDCと東京DCで仮想インスタンスをデプロイし、スパンオフの状態でGREトンネル接続しています。
01.png

【東京DC側】
「vyos-TOK01」と「vyos-TOK02」の2台で冗長化構成
両端の「cent6-TOK」と「win2012-TOK」サーバーでシンガポールの「cent6-SNG」と「win2012-SNG」に対し、PINGとファイル共有を確認します。

【シンガポールDC側】
「vyos-SNG01」と「vyos-SNG02」の2台で冗長化構成
両端の「cent6-SNG」と「win2012-SNG」サーバーでシンガポールの「cent6-TOK」と「win2012-TOK」に対し、PINGとファイル共有を確認します。

02.png
【東京DC側】
「vyos-TOK01」のPrioityが ”250” 、「vyos-TOK02」のPrioityは ”240”。
Prioity値が大きい方が"MASTER"になりますので、起動時は「vyos-TOK01」が"MASTER"、「vyos-TOK02」が "BACKUP"です。
 VRRP仮想PrivateIPは「vyos-TOK01」のeth0-IPと同じアドレスを設定。
 VRRP仮想PublicIPは「vyos-TOK01」のeth1-IPと同じアドレスを設定。

【シンガポールDC側】
「vyos-SNG01」のPrioityが ”250” 、「vyos-SNG02」のPrioityは ”240”。
Prioity値が大きい方が"MASTER"になりますので、起動時は「vyos-SNG01」が"MASTER"、「vyos-SNG02」が "BACKUP"です。
 VRRP仮想PrivateIPは「vyos-SNG01」のeth0-IPと同じアドレスを設定。
 VRRP仮想PublicIPは「vyos-SNG01」のeth1-IPと同じアドレスを設定。

2-2. VyOS設定値

2-2-1. VyOS設定値(vyos-TOK01)

vyos-TOK01設定値
 interfaces {
     ethernet eth0 {
         address 10.132.52.225/26
         duplex auto
         hw-id 06:d5:05:20:2b:59
         smp_affinity auto
         speed auto
         vrrp {
             vrrp-group 100 {
                 advertise-interval 1
                 preempt true
                 priority 250
                 sync-group syncgroup01
                 virtual-address 10.132.52.225
             }
         }
     }
     ethernet eth1 {
         address 161.202.158.218/29
         duplex auto
         hw-id 06:e7:c5:8f:c2:fb
         smp_affinity auto
         speed auto
         vrrp {
             vrrp-group 200 {
                 advertise-interval 1
                 preempt true
                 priority 250
                 sync-group syncgroup01
                 virtual-address 161.202.158.218
             }
         }
     }
     loopback lo {
     }
     tunnel tun0 {
         address 10.20.20.2/24
         description "GRE tunnel0 to vyos-SNG01"
         encapsulation gre
         local-ip 161.202.158.218
         multicast enable
         remote-ip 161.202.18.188
     }
 }
 protocols {
     static {
         route 10.0.0.0/8 {
             next-hop 10.132.52.193 {
             }
         }
         route 10.116.88.64/26 {
             next-hop 10.20.20.2 {
             }
         }
     }
 }
 service {
     ssh {
         port 22
     }
 }
 system {
     config-management {
         commit-revisions 20
     }
     console {
         device hvc0 {
             speed 9600
         }
         device ttyS0 {
             speed 9600
         }
     }
     domain-name softlayer.com
     gateway-address 161.202.158.217
     host-name vyos-TOK01
     login {
         user vyos {
             authentication {
                 encrypted-password xxxxxxxxxx
                 plaintext-password ""
             }
             level admin
         }
     }
     name-server 10.0.80.11
     ntp {
         server time.service.networklayer.com {
         }
     }
     package {
         auto-sync 1
         repository community {
             components main
             distribution helium
             password ""
             url http://packages.vyos.net/vyos
             username ""
         }
     }
     syslog {
         global {
             facility all {
                 level notice
             }
             facility protocols {
                 level debug
             }
         }
     }
     time-zone Asia/Tokyo
 }

2-2-2. VyOS設定値(vyos-TOK02)

vyos-TOK02設定値
 interfaces {
     ethernet eth0 {
         address 10.132.52.226/26
         duplex auto
         hw-id 06:5c:3e:9e:16:d2
         smp_affinity auto
         speed auto
         vrrp {
             vrrp-group 100 {
                 advertise-interval 1
                 preempt true
                 priority 240
                 sync-group syncgroup01
                 virtual-address 10.132.52.225
             }
         }
     }
     ethernet eth1 {
         address 161.202.158.219/29
         duplex auto
         hw-id 06:18:8f:41:ce:a5
         smp_affinity auto
         speed auto
         vrrp {
             vrrp-group 200 {
                 advertise-interval 1
                 preempt true
                 priority 240
                 sync-group syncgruop01
                 virtual-address 161.202.158.218
             }
         }
     }
     loopback lo {
     }
     tunnel tun0 {
         address 10.20.20.2/24
         description "GRE tunnel0 to vyos-SNG"
         encapsulation gre
         local-ip 161.202.158.218
         multicast disable
         remote-ip 161.202.18.188
     }
 }
 protocols {
     static {
         route 10.0.0.0/8 {
             next-hop 10.132.52.193 {
             }
         }
         route 10.116.88.64/26 {
             next-hop 10.20.20.2 {
             }
         }
     }
 }
 service {
     ssh {
         port 22
     }
 }
 system {
     config-management {
         commit-revisions 20
     }
     console {
         device hvc0 {
             speed 9600
         }
         device ttyS0 {
             speed 9600
         }
     }
     domain-name softlayer.com
     gateway-address 161.202.158.217
     host-name vyos-TOK02
     login {
         user vyos {
             authentication {
                 encrypted-password xxxxxxxxxx
                 plaintext-password ""
             }
             level admin
         }
     }
     name-server 10.0.80.11
     ntp {
         server time.service.natworklayer.com {
         }
     }
     package {
         auto-sync 1
         repository community {
             components main
             distribution helium
             password ""
             url http://packages.vyos.net/vyos
             username ""
         }
     }
     syslog {
         global {
             facility all {
                 level notice
             }
             facility protocols {
                 level debug
             }
         }
     }
     time-zone Asia/Tokyo
 }

2-2-3. VyOS設定値(vyos-SNG01)

vyos-SNG01設定値
 interfaces {
     ethernet eth0 {
         address 10.116.88.92/26
         duplex auto
         hw-id 06:b3:7e:13:c9:e2
         smp_affinity auto
         speed auto
         vrrp {
             vrrp-group 110 {
                 advertise-interval 1
                 preempt true
                 priority 250
                 sync-group syncgroup01
                 virtual-address 10.116.88.92
             }
         }
     }
     ethernet eth1 {
         address 161.202.18.188/29
         duplex auto
         hw-id 06:80:65:92:2e:62
         smp_affinity auto
         speed auto
         vrrp {
             vrrp-group 210 {
                 advertise-interval 1
                 preempt true
                 priority 250
                 sync-group syncgroup01
                 virtual-address 161.202.18.188
             }
         }
     }
     loopback lo {
     }
     tunnel tun0 {
         address 10.20.20.1/24
         description "GRE tunnel0 to vyos-TOK01"
         encapsulation gre
         local-ip 161.202.18.188
         multicast disable
         remote-ip 161.202.158.218
     }
 }
 protocols {
     static {
         route 10.0.0.0/8 {
             next-hop 10.116.88.65 {
             }
         }
         route 10.132.52.192/26 {
             next-hop 10.20.20.1 {
             }
         }
     }
 }
 service {
     ssh {
         port 22
     }
 }
 system {
     config-management {
         commit-revisions 20
     }
     console {
         device hvc0 {
             speed 9600
         }
         device ttyS0 {
             speed 9600
         }
     }
     domain-name softlayer.com
     gateway-address 161.202.18.185
     host-name vyos-SNG01
     login {
         user vyos {
             authentication {
                 encrypted-password xxxxxxxxxx
                 plaintext-password ""
             }
             level admin
         }
     }
     name-server 10.0.80.11
     ntp {
         server time.service.networklayer.com {
         }
     }
     package {
         auto-sync 1
         repository community {
             components main
             distribution helium
             password ""
             url http://packages.vyos.net/vyos
             username ""
         }
     }
     syslog {
         global {
             facility all {
                 level notice
             }
             facility protocols {
                 level debug
             }
         }
     }
     time-zone Asia/Tokyo
 }

2-2-4. VyOS設定値(vyos-SNG02)

vyos-SNG02設定値
 interfaces {
     ethernet eth0 {
         address 10.116.88.98/26
         duplex auto
         hw-id 06:47:62:c7:ed:00
         smp_affinity auto
         speed auto
         vrrp {
             vrrp-group 110 {
                 advertise-interval 1
                 preempt true
                 priority 240
                 sync-group syncgrup01
                 virtual-address 10.116.88.92
             }
         }
     }
     ethernet eth1 {
         address 161.202.18.190/29
         duplex auto
         hw-id 06:16:4f:4e:81:ec
         smp_affinity auto
         speed auto
         vrrp {
             vrrp-group 210 {
                 advertise-interval 1
                 preempt true
                 priority 240
                 sync-group syncgroup01
                 virtual-address 161.202.18.188
             }
         }
     }
     loopback lo {
     }
     tunnel tun0 {
         address 10.20.20.1/24
         description "GRE tunnel to vyos=TOK"
         encapsulation gre
         local-ip 161.202.18.188
         multicast disable
         remote-ip 161.202.158.218
     }
 }
 protocols {
     static {
         route 10.0.0.0/8 {
             next-hop 10.116.88.65 {
             }
         }
         route 10.132.52.192/26 {
             next-hop 10.20.20.1 {
             }
         }
     }
 }
 service {
     ssh {
         port 22
     }
 }
 system {
     config-management {
         commit-revisions 20
     }
     console {
         device hvc0 {
             speed 9600
         }
         device ttyS0 {
             speed 9600
         }
     }
     domain-name softlayer.com
     gateway-address 161.202.18.185
     host-name vyos-SNG02
     login {
         user vyos {
             authentication {
                 encrypted-password xxxxxxxxxx
                 plaintext-password ""
             }
             level admin
         }
     }
     name-server 10.0.80.11
     ntp {
         server time.service.networklayer.com {
         }
     }
     package {
         auto-sync 1
         repository community {
             components main
             distribution helium
             password ""
             url http://packages.vyos.net/vyos
             username ""
         }
     }
     syslog {
         global {
             facility all {
                 level notice
             }
             facility protocols {
                 level debug
             }
         }
     }
     time-zone Asia/Tokyo
 }

2-3. 両端サーバーのスタティックルート

cent6-TOK
# route add -net 10.116.88.64/26 gw 10.132.52.225 
cent6-SNG
# route add -net 10.132.52.192/26 gw 10.116.88.92 
1in2012-TOK
> route add -p 10.116.88.64 mask 255.255.255.192 10.132.52.225
1in2012-SNG
> route add -p 10.132.52.192 mask 255.255.255.192 10.116.88.92

3. 接続確認

接続確認は、両端の「cent6-TOK」、「cent6-SNG」間でのPINGで行いました。
尚、サーバーの電源オフで疑似的に障害発生としています。

03.png

問題なく、疎通確認できました。

ここでは省略しますが、ファイル共有も問題ありませんでした。

4. おわりに

MASTER ⇒BACKUPの切り替えを、SoftLayerポータル画面のデバイス詳細からインターフェースの停止で行いましたが、MASTER ⇒BACKUPの切り替えは確かに行えてますが、疎通確認はNGでVyOSのリブート後OKとなりました。
セッション情報まで引き継がないので、当たり前だと思います。
いずれにしても、VyOSのリブートでつながりますので、仮想ルーター障害対策としては使えそうです。

4
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
4
2