Tras el manual, tutorial o guía de configuración de VRRP en Vyatta vamos a pasar a la acción y vamos a configurar un entorno ejemplo redundante con VRRP entre dos máquinas Vyatta. En el ejemplo de configuración de VRRP en Vyatta vamos a crear un cluster entre las interfaces de dos routers Vyatta conectadas a una LAN , así, ante cualquier fallo HW (un switch, la NIC de un router Vyatta, un cable, etc), la red LAN seguirá siendo operativa, con lo que conseguimos failover o tolerancia a fallos con Vyatta.

En entornos virtuales VRRP con Vyatta también tiene sentido ya que si por algún motivo cae una de las VMs que contienen Vyatta y no levanta, la otra del cluster se hará cargo de ser la puerta de enlace o router de nuestra LAN.

Para llevar a cabo el ejemplo de configuración de VRRP en Vyatta vamos a partir de la siguiente topología a modo de ejemplo:

Ejemplo de configuración de VRRP en Vyatta - HA con Vyatta



Nota: utilizamos direcciones IPv4 TEST-NET-1

Tal y como se ve en la topología ejemplo VRRP, las interfaces de los routers Vyatta (R1 y R2) que conectan con la LAN son eth0 en ambos casos, cada una de ellas ha de configurarse con una IP de la red privada (192.0.2.0/24 en este caso ejemplo) y finalmente agregar cada una de ellas al mismo grupo VRRP, dicho grupo VRRP ha de configurarse con una IP y dicha IP será la IP virtual del grupo y la que actuara en la LAN como puerta de enlace determinada o router. Con esto se consigue un enlace redundante para una única IP y en el supuesto caso de que caiga alguno de los routers Vyatta (físico o virtual) el otro se hará cargo de actuar como router de la LAN sin que se aprecien cortes o caídas de servicio de red en la LAN.

Para configurar R1 y R2 para que sus interfaces eth0 trabajen en cluster y formen una sola interfaz virtual VRRP los pasos a seguir son los siguientes:

  • En R1:

    vyatta@R1:~$ configure
    [edit]
    vyatta@R1# set interfaces ethernet eth0 address 192.0.2.251/24
    [edit]
    vyatta@R1# set interfaces ethernet eth0 vrrp vrrp-group 10 priority 150
    [edit]
    vyatta@R1# set interfaces ethernet eth0 vrrp vrrp-group 10 virtual-address 192.0.2.254
    [edit]
    vyatta@R1# set interfaces ethernet eth0 vrrp vrrp-group 10 description "LAN VRRP"
    [edit]
    vyatta@R1# set interfaces ethernet eth0 vrrp vrrp-group 10 advertise-interval 1
    [edit]
    vyatta@R1# set interfaces ethernet eth0 vrrp vrrp-group 10 authentication type ah
    [edit]
    vyatta@R1# set interfaces ethernet eth0 vrrp vrrp-group 10 authentication password mipass
    [edit]
    vyatta@R1# commit
    [edit]
    vyatta@R1# save
    [edit]
    vyatta@R1# show interfaces ethernet eth0
     address 192.0.2.251/24
     duplex auto
     hw-id 1a:2b:3c:4d:5e:6f
     smp_affinity auto
     speed auto
     vrrp {
         vrrp-group 10 {
    	     advertise-interval 1
    		 authentication {
    		     password ""
    			 type ah
    		}
    		description LAN VRRP
    		priority 150
    		virtual-address 192.0.2.254
    	}
     }
    [edit]
    vyatta@R1# 



  • En R2:

    vyatta@R2:~$ configure
    [edit]
    vyatta@R2# set interfaces ethernet eth0 address 192.0.2.252/24
    [edit]
    vyatta@R2# set interfaces ethernet eth0 vrrp vrrp-group 10 priority 100
    [edit]
    vyatta@R2# set interfaces ethernet eth0 vrrp vrrp-group 10 virtual-address 192.0.2.254
    [edit]
    vyatta@R2# set interfaces ethernet eth0 vrrp vrrp-group 10 description "LAN VRRP"
    [edit]
    vyatta@R2# set interfaces ethernet eth0 vrrp vrrp-group 10 advertise-interval 1
    [edit]
    vyatta@R2# set interfaces ethernet eth0 vrrp vrrp-group 10 authentication type ah
    [edit]
    vyatta@R2# set interfaces ethernet eth0 vrrp vrrp-group 10 authentication password mipass
    [edit]
    vyatta@R2# commit
    [edit]
    vyatta@R2# save
    [edit]
    vyatta@R2# show interfaces ethernet eth0
     address 192.0.2.252/24
     duplex auto
     hw-id a1:b2:c3:d4:e5:f6
     smp_affinity auto
     speed auto
     vrrp {
         vrrp-group 10 {
    	     advertise-interval 1
    		 authentication {
    		     password ""
    			 type ah
    		}
    		description LAN VRRP
    		priority 100
    		virtual-address 192.0.2.254
    	}
     }
    [edit]
    vyatta@R2#