Configuring VRRPv2

By default, when VRRPv2 is enabled on the device, a MO calls /sys/vrrp/inst/ is created. This is a VRRPv2 configuration instance. As you create VRRP IDs, additional objects are created under the /sys/vrrp/inst/ object.

Enabling VRRPv2

Enabling VRRPv2
POST http://<IP_Address>/api/mo/sys/fm/vrrp.json
{
  "fmEntity": {
    "children": [
      {
        "fmVrrp": {
          "attributes": {
            "adminSt": "enabled"
}}}]}}
{
    imdata:[]
}
<System>
  <fm-items>
    <vrrp-items>
      <adminSt>enabled</adminSt>
    </vrrp-items>
  </fm-items>
</System>


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

feature vrrp

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Disabling VRRPv2

Disabling VRRPv2
POST http://<IP_Address>/api/mo/sys/fm/vrrp.json
{
  "fmEntity": {
    "children": [
      {
        "fmVrrp": {
          "attributes": {
            "adminSt": "disabled"
}}}]}}
{
    imdata:[]
}
<System>
  <fm-items>
    <vrrp-items>
      <adminSt>disabled</adminSt>
    </vrrp-items>
  </fm-items>
</System>


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

no feature vrrp

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Creating a VRRPv2 Interface

Creating a VRRPv2 Interface 
POST http://<IP_Address>/api/mo/sys/fm/vrrp.json
{
  "vrrpInst": {
    "children": [
      {
        "vrrpInterface": {
          "attributes": {
            "id": "eth1/7"
          },
          "children": [
            {
              "vrrpId": {
                "attributes": {
                  "id": "123"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <vrrp-items>
    <inst-items>
      <if-items>
        <Interface-list>
          <id>eth1/7</id>
          <id-items>
            <Id-list>
              <id>123</id>
              <adminSt>enabled</adminSt>
            </Id-list>
          </id-items>
        </Interface-list>
      </if-items>
    </inst-items>
  </vrrp-items>
</System>


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

interface ethernet 1/7
 vrrp 123

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Creating a Primary VRRPv2 ID

Creating a Primary VRRPv2 ID  
POST http://<IP_address>/api/mo/sys/vrrp/inst.json
{
  "vrrpInst": {
    "children": [
      {
        "vrrpInterface": {
          "attributes": {
            "id": "eth1/7"
          },
          "children": [
            {
              "vrrpId": {
                "attributes": {
                  "adminSt": "enabled",
                  "id": "123",
                  "primary": "1.2.3.4"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <vrrp-items>
    <inst-items>
      <if-items>
        <Interface-list>
          <id>eth1/7</id>
          <id-items>
            <Id-list>
              <id>123</id>
              <primary>1.2.3.4</primary>
            </Id-list>
          </id-items>
        </Interface-list>
      </if-items>
    </inst-items>
  </vrrp-items>
</System>

The HTTP request shown in this example creates a Managed Object called with an ID of 123 and a primary IP address of 1.2.3.4.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

interface ethernet 1/7
 vrrp 123
 &nbsp;address 1.2.3.4`

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Creating a Secondary VRRPv2 ID

Creating a Secondary VRRPv2 ID 
POST http://<IP_address>/api/mo/sys/vrrp/inst.json
{
  "vrrpInst": {
    "children": [
      {
        "vrrpInterface": {
          "attributes": {
            "id": "eth1/7"
          },
          "children": [
            {
              "vrrpId": {
                "attributes": {
                  "id": "123"
                },
                "children": [
                  {
                    "vrrpSecondary": {
                      "attributes": {
                        "secondary": "4.3.2.1"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <vrrp-items>
    <inst-items>
      <if-items>
        <Interface-list>
          <id>eth1/7</id>
          <id-items>
            <Id-list>
              <id>123</id>
              <secondary-items>
                <Secondary-list>
                  <secondary>4.3.2.1</secondary>
                </Secondary-list>
              </secondary-items>
            </Id-list>
          </id-items>
        </Interface-list>
      </if-items>
    </inst-items>
  </vrrp-items>
</System>

The HTTP request in this example creates a secondary VRRPv2 ID named 4.3.2.1 under the primary VRRP ID 123.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload or the YANG tab to view the XML payload.

interface ethernet 1/7
 vrrp 123
 &nbsp;address 4.3.2.1 secondary`

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:
http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide
https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html