Go to main content

Configuring an Oracle® Solaris 11.4 System as a Router or a Load Balancer

Exit Print View

Updated: November 2020
 
 

Use Case: Configuring a Layer 2 VRRP Router

The following figure shows a typical VRRP configuration.

Figure 2  Layer 2 VRRP Router

image:Graphic shows a typical VRRP network setup.

In this example, the IP address 203.0.113.8 is configured as the default gateway for host1. This IP address is the virtual IP address that is protected by the virtual router that is configured on two routers: router1 and router2. At any given time, only one of the two routers serves as the master router, which assumes the responsibilities of the virtual router and forwards packets that come from host1.

Assume that the VRID of the virtual router is 12. The following examples show the commands that are used to configure the example VRRP configuration on router1 and router2. router1 is the owner of the virtual IP address 203.0.113.8 and its priority is the default value (255). router2 is the standby router whose priority is 100.

On router1:

$ pkg install vrrp

$ dladm create-vnic -m vrrp -V 12 -A inet -l net0 vnic0
$ vrrpadm create-router -V 12 -A inet -I net0 vrrp1

$ ipadm create-ip vnic0
$ ipadm create-addr -T vrrp -a 203.0.113.8/24 vnic0/router1

$ ipadm create-ip net0
$ ipadm create-addr -a 203.0.113.100/24 net0/router1

$ vrrpadm show-router -x vrrp1
NAME  STATE   PRV_STAT STAT_LAST  VNIC   PRIMARY_IP     VIRTUAL_IPS
vrrp1 MASTER  INIT     14.444s    vnic0  203.0.113.100  203.0.113.8

On router2:

$ dladm create-vnic -m vrrp -V 12 -A inet -l net1 vnic1

$ vrrpadm create-router -V 12 -A inet -I net1 -p 100 vrrp2

$ ipadm create-ip vnic1
$ ipadm create-addr -T vrrp -a 203.0.113.8/24 vnic1/router2

$ ipadm create-ip net1
$ ipadm create-addr -a 203.0.113.101/24 net1/router2

$ vrrpadm show-router -x vrrp2
NAME  STATE    PRV_STAT  STAT_LAST  VNIC   PRIMARY_IP     VIRTUAL_IPS
vrrp2 BACKUP   INIT      2m32s      vnic1  203.0.113.101  203.0.113.8

Using the configuration of router1 as an example, you would configure at least one IP address over net0. This IP address of router1 is the primary IP address, which is used to send the VRRP advertisement packets.

$ vrrpadm show-router -x vrrp1
NAME  STATE   PRV_STAT STAT_LAST  VNIC  PRIMARY_IP     VIRTUAL_IPS
vrrp1 MASTER  INIT     14.444s    vnic1 203.0.113.100  203.0.113.8