Complete these tasks to configure the phy-interface element for two media interfaces.
This example assumes you have exported the access token to the variable $TOKEN
.
- 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.
- 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://${SBCIP}/rest/v1.1/configuration/elementTypes/template?elementType=phy-interface"
The response is saved to the file response.xml
.
- 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
- 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>
- 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>
- Acquire the configuration lock.
curl -X POST \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/rest/v1.1/configuration/lock"
- 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://${SBCIP}/rest/v1.1/configuration/configElements"
curl -X POST \
-d@phy-interface-s0p1.xml \
--header "Accept: application/xml" \
--header "Authorization: Bearer $TOKEN" \
"https://${SBCIP}/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://${SBCIP}/rest/v1.1/configuration/unlock"