VyOS2台構成でVRRPを組む時のメモです。
マスター側
set interfaces ethernet eth1 vrrp vrrp-group 10 advertise-interval '1' set interfaces ethernet eth1 vrrp vrrp-group 10 authentication password 'hogehoge' set interfaces ethernet eth1 vrrp vrrp-group 10 authentication type 'plaintext-password' set interfaces ethernet eth1 vrrp vrrp-group 10 preempt 'true' set interfaces ethernet eth1 vrrp vrrp-group 10 priority '200' set interfaces ethernet eth1 vrrp vrrp-group 10 'rfc3768-compatibility' set interfaces ethernet eth1 vrrp vrrp-group 10 sync-group 'vrrp-sync' set interfaces ethernet eth1 vrrp vrrp-group 10 virtual-address '192.168.100.1'
バックアップ側
set interfaces ethernet eth1 vrrp vrrp-group 10 advertise-interval '1' set interfaces ethernet eth1 vrrp vrrp-group 10 authentication password 'hogehoge' set interfaces ethernet eth1 vrrp vrrp-group 10 authentication type 'plaintext-password' set interfaces ethernet eth1 vrrp vrrp-group 10 preempt 'true' set interfaces ethernet eth1 vrrp vrrp-group 10 priority '100' set interfaces ethernet eth1 vrrp vrrp-group 10 'rfc3768-compatibility' set interfaces ethernet eth1 vrrp vrrp-group 10 sync-group 'vrrp-sync' set interfaces ethernet eth1 vrrp vrrp-group 10 virtual-address '192.168.100.1'
設定のポイント
①マスターにしたいルーターの「priority」の数字を大きくしておく。
②「preempt ‘true’」でマスター側が復帰した時にフェイルバックさせる。
③「rfc3768-compatibility」で仮想IPに仮想MAC(00:00:5e:00:01:XX)をつける。
④「vrrp-group」で指定する数字は適当で構わないが、仮想MACアドレスの末尾の番号になるので(上記の場合は00:00:5e:00:01:10が割当)、同じネットワーク配下に複数VRRPを張る場合は、仮想MACがかぶらないよう注意。
③を入れるか入れないかはお好みで。
個人的には仮想MACの方がフェイルオーバー時の復帰が早そうなので「rfc3768-compatibility」ありで運用しています。
コメント