How to get or set the configuration
SecureEdge API AuthenticationRetrieving or modifying the SecureEdge configuration requires authentication. See How to authenticate to the API.
Introduction
You can use the various configuration endpoints to obtain or modify the configuration of the SecureEdge, for example to automatically provision the desired connection settings. See also the other documented use cases.
WAN network
In REST fashion, we can use the /api/v1/network/wan endpoint to retrieve or configure the current WAN network configuration.
Retrieving a WAN network configuration
Use GET for retrieval:
curl --request GET \
--url 'http://192.168.140.1:80/api/v1/network/wan' \
--cookie 'session.jar'{
"dhcp_active": false,
"ip": "172.27.1.111",
"netmask": "255.254.0.0",
"gateway": "172.27.0.1",
"dns_servers": [
"1.1.1.1"
]
}Configuring a WAN network configuration
Use POST to configure options:
curl --request POST \
--url 'http://192.168.140.1:80/api/v1/network/wan' \
--cookie 'session.jar' \
--header 'Content-Type: application/json' \
--data '
{
"dhcp_active": false,
"ip": "172.27.1.111",
"netmask": "255.254.0.0",
"gateway": "172.27.0.1",
"dns_servers": [
"1.1.1.1"
]
}'LAN network
Use the /api/v1/network/lan/networks/<network_name> endpoint to retrieve or configure a LAN configuration. In these examples, we will use the Default LAN network.
Retrieving a LAN network configuration
Use GET for retrieval:
curl --request GET \
--url 'http://192.168.140.1:80/api/v1/network/lan/networks/Default' \
--cookie 'session.jar'{
"name": "Default",
"ip": "192.168.140.1",
"netmask": "255.255.255.0",
"dhcp_range": {
"start": "192.168.140.100",
"end": "192.168.140.249"
},
"dhcp_static_leases": []
}Configuring a LAN network configuration
Use POST to configure options:
curl --request POST \
--url 'http://192.168.140.1:80/api/v1/network/lan/networks/Default' \
--cookie 'session.jar' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Default",
"ip": "192.168.140.1",
"netmask": "255.255.255.0",
"dhcp_range": {
"start": "192.168.140.100",
"end": "192.168.140.249"
},
"dhcp_static_leases": []
}'
In case you change the LAN IP address of the SecureEdge, remember to...
- Perform a login via API using the new LAN IP address to get a new session cookie.
- Make subsequent requests to the new IP address.
Creating a LAN network
Use the /api/v1/network/lan/networks endpoint to create a LAN network, for example Foobar :
curl --request POST \
--url 'http://192.168.140.1:80/api/v1/network/lan/networks' \
--cookie 'session.jar' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Foobar",
"ip": "192.168.150.1",
"netmask": "255.255.255.0"
}'Assigning a LAN port to a LAN network
Use the /api/v1/network/lan/ports/<port> endpoint to configure the network for the LAN port, for example to assign LAN1 to the Foobar network:
curl --request POST \
--url 'http://192.168.140.1/api/v1/network/lan/ports/lan1' \
--cookie 'session.jar' \
--header 'Content-Type: application/json' \
--data '
{
"network": "Foobar"
}'Updated 6 days ago
