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

Exit Print View

Updated: September 2014
 
 

Creating a VRRP Router

The vrrpadm create-router command creates a Layer 2 or Layer 3 VRRP router with the specified VRID and address family, along with other specified parameters. For more information, see the vrrpadm (1M) man page.

To create a VRRP router, use the following syntax:

# vrrpadm create-router [-T {l2 | l3}] [-f] -V VRID -I ifname \ 
-A [inet | inet6] [-a assoc-IPaddress] [-P primary-IPaddress] \
[-p priority] [-i adv-interval] [-o flags] router-name 
–T l2 | l3

Specifies the type of the router. You can set the type to one of the following values. The default is l2.

  • l2 – L2 type VRRP router

  • l3– L3 type VRRP router

–f

(L2 VRRP only) Specifies the creation of the VRRP VNIC with an L2 VRRP router. When you specify the –f option, the vrrpadm command checks whether the VRRP VNIC with the specified VRID and address family exists. A VRRP VNIC is created only if it does not already exist. The system generates the name of the VRRP VNIC with the naming convention: vrrp-VRID_ifname_v4 | 6. The –f option does not have any effect when you are creating a Layer 3 VRRP router.

–V VRID

The virtual router identifier that defines the VLAN when associated with the address family.

–I ifname

The interface on which the VRRP router is configured. For a Layer 2 VRRP, the interface can be a physical link, a VLAN, or an aggregation. For a Layer 3 VRRP, the interface can also include an IPMP interface, a DHCP managed interface, and an InfiniBand interface. This link determines the LAN in which this VRRP router is running.

–A [inet | inet6]

The address family, either inet or inet6, which refers to either IPv4 or IPv6 addresses.

–a assoc-IPaddress

Specifies the comma-separated list of IP addresses.

You can specify the IP address in any of the following formats:

  • IP-address[/prefix-length]

  • hostname[/prefix-length]

  • linklocal

    If you specify linklocal, an IPv6 link-local vrrp address is configured based on the VRID of the associated virtual router. The linklocal form applies only to IPv6 VRRP routers. You can combine the –a option with the –f option so that the VNIC is created and plumbed automatically.

–P primary-IPaddress

Specifies the VRRP primary IP address that is used to send the VRRP advertisement.

–p priority

The priority of the specified VRRP router used for master selection. The default value is 255. The router with the highest priority value is selected as the master router.

–i adv-interval

The advertisement interval in milliseconds. The default value is 1000.

–o flags

The pre-empt and accept modes of the VRRP router. The values are preempt or un_preempt, or accept or no_accept. By default, the pre-empt and accept modes are set to preempt and accept respectively.

router-name

The router-name is the unique identifier of this VRRP router. The permitted characters in a router name are alphanumeric (a-z, A-Z, 0-9), and underscore (_). The maximum length of a router name is 31 characters.

Example 4-1  Creating a Layer 2 VRRP Router

The following example shows how to create a router over a datalink net0.

# dladm create-vnic -m vrrp -V 12 -A inet -l net0 vnic1
# vrrpadm create-router -V 12 -A inet -p 100 -I net0 l2router1
# vrrpadm show-router l2router1
NAME       VRID  TYPE   IFNAME AF   PRIO ADV_INTV MODE  STATE  VNIC
l2router1  12    L2     net0   IPv4 100  1000     e-pa- BACK   vnic1

An L2 VRRP router l2router1 is created over the datalink net0 with an IPv4 address family and VRID 12. For information about the vrrpadm show-router command, see Displaying Layer 2 and Layer 3 VRRP Router Configurations.

Example 4-2  Creating a Layer 3 VRRP Router

The following example shows how to create an L3 VRRP router over an IPMP interface named ipmp0.

# vrrpadm create-router -V 6 -I ipmp0 -A inet -T l3 l3router1
# vrrpadm show-router
NAME      VRID TYPE IFNAME AF   PRIO ADV_INTV MODE  STATE VNIC
l3router1 6    L3   ipmp0  IPv4 255  1000     eopa- INIT  --
  

An L3 VRRP router l3router1 is created over the IPMP interface ipmp0 with an IPv4 address family and VRID 6. For information about the vrrpadm show-router command, see Displaying Layer 2 and Layer 3 VRRP Router Configurations.