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

Exit Print View

Updated: September 2014
 
 

Use Case: Configuring a Layer 2 VRRP Router

The following figure shows a typical VRRP configuration.

image:This figure describes a typical VRRP setup.

In this example, the IP address 10.68.82.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 consists of two VRRP routers: router1 and router2. At any given time, only one of the two routers serves as the master router, assuming the responsibilities of the virtual router and forwarding 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 10.68.82.8 and its priority is the default value (255). router2 is the standby router whose priority is 100.

For more information about the commands that are used for configuring VRRP, see the vrrpadm(1M), dladm(1M), and ipadm(1M) man pages.

    For router1:

  1. Install VRRP package.

    # pkg install vrrp
  2. Create the VNIC vnic0 over net0 with the VRID value as 12.

    # dladm create-vnic -m vrrp -V 12 -A inet -l net0 vnic0
  3. Create a VRRP router vrrp1 over net0.

    # vrrpadm create-router -V 12 -A inet -I net0 vrrp1
  4. Configure IP interfaces vnic0 and net0.

    # ipadm create-ip vnic0
    # ipadm create-addr -T vrrp -a 10.68.82.8/24 vnic0/router1
    # ipadm create-ip net0
    # ipadm create-addr -T static -a 10.68.82.100/24 net0/router1
  5. Display the router information for vrrp1.

    # vrrpadm show-router -x vrrp1
    NAME  STATE   PRV_STAT STAT_LAST  VNIC  PRIMARY_IP    VIRTUAL_IPS
    vrrp1 MASTER  INIT     14.444s    vnic0 10.68.82.100  10.68.82.8

    Similarly, for router2:

  1. Create the VNIC vnic1 over net1 with the VRID value as 12.

    # dladm create-vnic -m vrrp -V 12 -A inet -l net1 vnic1
  2. Create a VRRP router vrrp2 over net1.

    # vrrpadm create-router -V 12 -A inet -I net1 -p 100 vrrp2
  3. Configure IP interfaces on vnic1 and net1.

    # ipadm create-ip vnic1
    # ipadm create-addr -T vrrp -a 10.68.82.8/24 vnic1/router2
    # ipadm create-ip net1
    # ipadm create-addr -T static -a 10.68.82.101/24 net1/router2
  4. Display the router information for vrrp2.

    # vrrpadm show-router -x vrrp2
    NAME  STATE    PRV_STAT  STAT_LAST  VNIC  PRIMARY_IP    VIRTUAL_IPS
    vrrp2 BACKUP   INIT      2m32s      vnic1 10.68.82.101  10.68.82.8

By using the configuration of router1 as an example, you must 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 10.68.82.100  10.68.82.8