Bridge Configuration
By default, the system creates a LAN network (lan-net), a WAN network (wan-net), and wan2-net.
Example for Bridge Payload
<bridge>
<name>sc-br</name>
<port>
<name>eth3</name>
</port>
</bridge>
Property | Type | Description | Mandatory/Default Value |
---|---|---|---|
name | String | Name of the bridge. | Yes |
port name | String | Name of the port the bridge is attached to. | Yes |
dhcp | Flag to specify DHCP configuration. | No | |
ip address | String | IP address. | No |
ip netmask | String | Netmask. | No |
dhcp-ipv6 | Flag to specify DHCP IPv6 configuration. | No | |
slaac-ipv6 | Flag to specify SLAAC IPv6 configuration. | No | |
ipv6 address | String | IPv6 address and prefix length. | No |
vlan | Integer | VLAN tag. | No |
Example: POST Bridge Creation API
curl -k -s -i -u admin:password -X POST --location 'https://a.b.c.d/restconf/data/network:bridges' \
--header 'Accept: application/yang-data+xml' \
--header 'Content-Type: application/yang-data+xml' \
--data '<bridge>
<name>test-br</name>
<port>
<name>eth3</name>
</port>
</bridge>'
Example: GET Bridge Configuration API
curl -k -s -i -u admin:password -X GET --location 'https://a.b.c.d/restconf/data/network:bridges?content=config' \
--header 'Accept: application/yang-data+xml' \
--header 'Content-Type: application/yang-data+xml'
Response:
<bridges xmlns="http://www.cisco.com/nfv/network" xmlns:y="http://tail-f.com/ns/rest" xmlns:network="http://www.cisco.com/nfv/network">
<bridge>
<name>lan-br</name>
<port>
<name>eth0</name>
</port>
</bridge>
<bridge>
<name>wan-br</name>
<port>
<name>eth1</name>
</port>
<ip>
<address>209.165.201.1</address>
<netmask>255.255.255.0</netmask>
</ip>
<ipv6>
<address>2001:DB8:1:1::72/64</address>
</ipv6>
</bridge>
<bridge>
<name>sc-br</name>
<port>
<name>eth3</name>
</port>
</bridge>
</bridges>
Example: DELETE Bridge Configuration API
curl -k -s -i -u admin:password -X DELETE --location 'https://a.b.c.d/restconf/data/network:bridges/bridge=test-br' \
--header 'Accept: application/yang-data+xml' \
--header 'Content-Type: application/yang-data+xml'
Network Configuration
By default, the system creates a LAN network (lan-net), a WAN network (wan-net), and wan2-net.
Example for Network Creation Payload
<network>
<name>sc-net</name>
<bridge>sc-bridge</bridge>
</network>
Network Creation Payload Description
Property | Type | Description | Mandatory/Default Value |
---|---|---|---|
name | String | Name of the network. | Yes |
bridge | String | Name of the bridge the network is attached to. | Yes |
trunk | Boolean | Network set to trunk mode. | No/true |
sriov | Boolean | SR-IOV supported on the network. | No/false |
native-tagged | Boolean | Specifies whether the network has a tag or not. | No |
native-vlan | Integer | Specifies the native VLAN. It sets the native characteristics when the interface is in trunk mode. It sets the native characteristics when the interface operates in trunk mode. If you do not configure a native VLAN, the system uses the default VLAN 1 as the native VLAN. | No |
vlan | Integer | VLAN tag. Specifies the VLAN number. If you configure the trunk parameter as true, this parameter specifies a set of VLAN numbers and ranges If trunk parameter is false, access mode is true, then this parameter can have only one VLAN number. |
No |
Example: POST Network API
curl --tlsv1.2 -k -i -u admin:password -X POST --location 'https://a.b.c.d/restconf/data/network:networks' \
--header 'Accept: application/yang-data+xml' \
--header 'Content-Type: application/yang-data+xml' \
--data '<network>
<name>test-net</name>
<bridge>test-br</bridge>
</network>'
Get Current Networks configuration details
curl -k -u admin:password 'https://a.b.c.d/restconf/data/network:networks?content=config' -H 'Accept: application/yang-data+json'
Response:
{
"network:networks": {
"network": [
{
"name": "wan-net",
"bridge": "wan-br"
},
{
"name": "wan2-net",
"bridge": "wan2-br"
},
{
"name": "lan-net",
"bridge": "lan-br"
},
{
"name": "GE0-0-SRIOV-1",
"sriov": true
},
{
"name": "GE0-0-SRIOV-2",
"sriov": true
},
{
"name": "GE0-1-SRIOV-1",
"sriov": true
},
{
"name": "GE0-1-SRIOV-2",
"sriov": true
},
{
"name": "LAN-SRIOV-1",
"sriov": true
},
{
"name": "LAN-SRIOV-2",
"sriov": true
},
{
"name": "LAN-SRIOV-3",
"sriov": true
},
{
"name": "LAN-SRIOV-4",
"sriov": true
},
{
"name": "LAN-SRIOV-5",
"sriov": true
},
{
"name": "LAN-SRIOV-6",
"sriov": true
},
{
"name": "LAN-SRIOV-7",
"sriov": true
},
{
"name": "LAN-SRIOV-8",
"sriov": true
},
{
"name": "LAN-SRIOV-9",
"sriov": true
},
{
"name": "LAN-SRIOV-10",
"sriov": true
},
{
"name": "LAN-SRIOV-11",
"sriov": true
},
{
"name": "LAN-SRIOV-12",
"sriov": true
},
{
"name": "LAN-SRIOV-13",
"sriov": true
},
{
"name": "LAN-SRIOV-14",
"sriov": true
},
{
"name": "LAN-SRIOV-15",
"sriov": true
},
{
"name": "LAN-SRIOV-16",
"sriov": true
},
{
"name": "LAN-SRIOV-17",
"sriov": true
},
{
"name": "LAN-SRIOV-18",
"sriov": true
},
{
"name": "LAN-SRIOV-19",
"sriov": true
},
{
"name": "LAN-SRIOV-20",
"sriov": true
},
{
"name": "LAN-SRIOV-21",
"sriov": true
},
{
"name": "LAN-SRIOV-22",
"sriov": true
},
{
"name": "LAN-SRIOV-23",
"sriov": true
},
{
"name": "LAN-SRIOV-24",
"sriov": true
},
{
"name": "abc-net",
"trunk": true,
"bridge": "wan-br"
}
]
}
}
Ger Details of Particular Network
curl -k -s -i -u admin:password -X GET --location 'https://a.b.c.d/restconf/data/network:networks/network=test-net' \
--header 'Accept: application/yang-data+xml' \
--header 'Content-Type: application/yang-data+xml'
Delete Network
curl -k -s -i -u admin:password -X DELETE --location 'https://a.b.c.d/restconf/data/network:networks/network=test-net' \
--header 'Accept: application/yang-data+xml' \
--header 'Content-Type: application/yang-data+xml'