- REST API for the Session Border ControllerREST API for Session Border Controller, Enterprise Session Border Controller, and Subscriber-Aware Load Balancer, Release 8.4.0
- Examples
- Configure Network Interfaces
Configure Network Interfaces
Complete these tasks to configure the network-interface element for two media interfaces.
Table - Prerequisites
| Prerequisite | More Information |
| Authenticate | Authenticate |
| Configure two physical interfaces for media traffic. | Configure Physical Interfaces |
This example assumes you have exported the access token to the variable $TOKEN.
- Retrieve the network-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=network-interface"The response is saved to the fileresponse.xml. - Copy the content between the opening and closing <configElement> tags to two files called
network-interface-s0p0.xmlandnetwork-interface-s0p1.xml.If you are on a Linux system with
xmllintinstalled, you may optionally format the XML before writing it to the file system.sed -n '/<configElement>/,/<\/configElement>/p' response.xml | xmllint --format - > network-interface-s0p0.xmlsed -n '/<configElement>/,/<\/configElement>/p' response.xml | xmllint --format - > network-interface-s0p1.xml - Retreive the configuration element metadata to discover the range of values for each attribute.
curl -X GET -o metadata.xml \ --header "Accept: application/xml" \ --header "Authorization: Bearer $TOKEN" \ "https://10.0.0.2/rest/v1.1/configuration/elementTypes/metadata?elementType=network-interface" - Open both XML files and set the attributes to their desired values.
In HA environments, provide values for at least the following parameters.
Table - Parameters
Parameter Description nameEnter the name of the previously configured physical interface. For example, s0p0ors0p1.ip-addressSet the IP address of this network interface. pri-utility-addr(HA environment) Enter the utility IP address for the primary HA peer. sec-utility-addr(HA environment) Enter the utility IP address for the secondary HA peer. netmaskSet the netmask of this network interface. gatewaySet the gateway that this network interface uses to communicate with the next hop. Note:
For additional parameters, see the ACLI Configuration Guide.The following example shows the full contents of the
network-interface-s0p0.xmlfile.<?xml version="1.0"?> <configElement> <elementType>network-interface</elementType> <attribute> <name>name</name> <value>s0p0</value> </attribute> <attribute> <name>ip-address</name> <value>192.168.1.101</value> </attribute> <attribute> <name>pri-utility-addr</name> <value>192.168.1.102</value> </attribute> <attribute> <name>sec-utility-addr</name> <value>192.168.1.103</value> </attribute> <attribute> <name>netmask</name> <value>255.255.255.0</value> </attribute> <attribute> <name>gateway</name> <value>192.168.1.1</value> </attribute> </configElement>Note:
Missing parameters assume the default values shown in the template. - 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" - Add both network-interface configurations to the SBC.
curl -X POST \ -d@network-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@network-interface-s0p1.xml \ --header "Accept: application/xml" \ --header "Authorization: Bearer $TOKEN" \ "https://10.0.0.2/rest/v1.1/configuration/configElements" - If done editing the configuration, save, verify, and activate the configuration.
- 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"