Configure Realms

Complete these tasks to configure the realm-config element for two media interfaces.

Table - Prerequisites

Prerequisite More Information
Authenticate Authenticate
Configure two physical interfaces. Configure Physical Interfaces
Configure two network interfaces. Configure Network Interfaces

This example assumes you have exported the access token to the variable $TOKEN.

  1. Retrieve the realm-config template.

    The template of a configuration element is a data structure containing all required sub-elements and supported attributes with their default values, along with any specified optional sub-elements.

    curl -X GET -o response.xml \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/elementTypes/template?elementType=realm-config"
    The response is saved to the file response.xml.
  2. Copy the content between the opening and closing <configElement> tags to two files called realm-config-s0p0.xml and realm-config-s0p1.xml.

    If you are on a Linux system with xmllint installed, you may optionally format the XML before writing it to the file system.

    sed -n '/<configElement>/,/<\/configElement>/p' response.xml | xmllint --format - > realm-config-s0p0.xml
    sed -n '/<configElement>/,/<\/configElement>/p' response.xml | xmllint --format - > realm-config-s0p1.xml
  3. Open both XML files and set the attributes to their desired values.

    Table - Parameters

    Parameter Description
    identifier Create a unique name for this realm.
    network-interfaces Enter the name of the previously configured network interface, a colon, and the sub-port-id (defaults to 0). For example, s0p0:0 or s0p1:0.

    Note:

    For additional parameters, see the ACLI Configuration Guide.

    The following example shows the full contents of the realm-config-s0p0.xml and realm-config-s0p1.xml files used to create the peer1 realm and the core1 realm.

    Note:

    Missing parameters assume the default values shown in the template.
    <?xml version="1.0"?>
    <configElement>
      <elementType>realm-config</elementType>
      <attribute>
        <name>identifier</name>
        <value>peer1</value>
      </attribute>
      <attribute>
        <name>network-interfaces</name>
        <value>s0p0:0</value>
      </attribute>
    </configElement>
    <?xml version="1.0"?>
    <configElement>
      <elementType>realm-config</elementType>
      <attribute>
        <name>identifier</name>
        <value>core1</value>
      </attribute>
      <attribute>
        <name>network-interfaces</name>
        <value>s0p1:0</value>
      </attribute>
    </configElement>
  4. Acquire the configuration lock.
    curl -X POST \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/lock"
  5. Add both realm-config configurations to the SBC.
    curl -X POST \
        -d@realm-config-s0p0.xml \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/configElements"
    curl -X POST \
        -d@realm-config-s0p1.xml \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/configElements"
  6. If done editing the configuration, save, verify, and activate the configuration.
  7. Release the configuration lock.
    curl -X POST \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/unlock"