Configure Physical Interfaces

Complete these tasks to configure the phy-interface element for two media interfaces.

Table - Prerequisites

Prerequisite More Information
Authenticate Authenticate

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

  1. Log in to the SBC to discover the interface mappings.
    PRIMARY# interface-mapping
    PRIMARY(interface-mapping)# show
    Interface Mapping Info
    -------------------------------------------
    Eth-IF  MAC-Addr                Label
    wancom0 FA:16:3E:20:0D:8F       #generic
    s0p0    FA:16:3E:D3:35:DD       #generic
    s0p1    FA:16:3E:BB:AA:94       #generic
    wancom1 FF:FF:FF:FF:FF:FF       #dummy
    wancom2 FF:FF:FF:FF:FF:FF       #dummy
    spare   FF:FF:FF:FF:FF:FF       #dummy
    s1p0    FF:FF:FF:FF:FF:FF       #dummy
    s1p1    FF:FF:FF:FF:FF:FF       #dummy
    s0p2    FF:FF:FF:FF:FF:FF       #dummy
    s1p2    FF:FF:FF:FF:FF:FF       #dummy
    s0p3    FF:FF:FF:FF:FF:FF       #dummy
    s1p3    FF:FF:FF:FF:FF:FF       #dummy
    
    PRIMARY(interface-mapping)#

    Note:

    The swap command allows you to swap management and media interfaces.

    In this example, wancom0, s0p0, and s0p1 are the available physical interfaces.

  2. Retrieve the phy-interface 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=phy-interface"
    The response is saved to the file response.xml.
  3. Copy the content between the opening and closing <configElement> tags to two files called phy-interface-s0p0.xml and phy-interface-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 - > phy-interface-s0p0.xml
    sed -n '/<configElement>/,/<\/configElement>/p' response.xml | xmllint --format - > phy-interface-s0p1.xml
  4. In the phy-interface-s0p0.xml file, set the name to s0p0 and the operation-type to Media.
    <?xml version="1.0"?>
    <configElement>
      <elementType>phy-interface</elementType>
      <attribute>
        <name>name</name>
        <value>s0p0</value>
      </attribute>
      <attribute>
        <name>operation-type</name>
        <value>Media</value>
      </attribute>
      ...
    </configElement>
  5. In the phy-interface-s0p1.xml file, set the name to s0p1, the operation-type to Media, and the port to 1.
    <?xml version="1.0"?>
    <configElement>
      <elementType>phy-interface</elementType>
      <attribute>
        <name>name</name>
        <value>s0p1</value>
      </attribute>
      <attribute>
        <name>operation-type</name>
        <value>Media</value>
      </attribute>
      <attribute>
        <name>port</name>
        <value>1</value>
      </attribute>
      <attribute>
        <name>slot</name>
        <value>0</value>
      </attribute>
      ...
    </configElement>
  6. 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"
  7. Add both phy-interface configurations to the SBC.
    curl -X POST \
        -d@phy-interface-s0p0.xml \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/configElements"
    curl -X POST \
        -d@phy-interface-s0p1.xml \
        --header "Accept: application/xml" \
        --header "Authorization: Bearer $TOKEN" \
        "https://10.0.0.2/rest/v1.1/configuration/configElements"
  8. If done editing the configuration, save, verify, and activate the configuration.
  9. 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"