API
Get the config of the WAN settings
Available in 8.1.1 or later
Input Parameters
Type | Notation | Mandatory | Description | |
id | NumberMultiple | <number><numlist> | optional | List the WAN config settings base on id, multiple value is accepted List all WAN if absent in id |
infoType | String | { multipleIp, connection, physical, healthcheck, bandwidthAllowanceMonitor, cellular } | optional | Filter of the return object, multiple value is accepted. All types will return if this field is empty |
Return Parameters
Return JSON
Type | Notation | Description | ||
order | Array | list of <conn_id> | The order of the WAN ID | |
<conn_id> | Object | <WAN_Config_Obj> | WAN config information |
<WAN_Config_Obj>
Type | Notation | Description | |
name | String | <string> | Connection Name of the WAN |
asLAN | Boolean | <boolean> | WAN performing WAN as LAN |
enable | Boolean | <boolean> | WAN Enable |
active | Boolean | <boolean> | WAN Active |
multipleIP | Array | list of <ip4> | Additional IP Address, will not appear if asLan is true |
connection | Object | <Connection_Obj> | Connection Settings Object, will not appear if asLan is true |
physical | Object | <Physical_Obj> | Physical Interface Settings Object, will not appear if asLan is true |
healthcheck | Object | <Healthcheck_Obj> | Healthcheck Settings Object, will not appear if asLan is true |
bandwidthAllowanceMonitor | Object | <Bandwidth_Monitor_Obj> | Bandwidth Allowance Monitor Object, will not appear if asLan is true |
<Connection_Obj>
Type | Notation | Description | |
method | String | { DHCP, Static IP, PPPoE, L2TP, GRE, Drop In } | Connection Method of the WAN |
mode | String | { NAT, IP Forwarding } | NAT or IP Forwarding mode |
icmpping | Boolean | <boolean> | Reply ICMP Ping |
priority | Number | <number> | The priority of the WAN in MAX device, or The connection type of the WAN in Balance device |
dns | Object | <DNS_Obj> | DNS Object |
ddns | Object | <DDNS_Obj> | Dynamic DNS Settings Object |
bandwidth | Object | <Max_Speed_Obj> | Bandwidth limit information |
schedule | Number | <number> | Schedule ID, only appear in WAN is scheduled |
pepvpnNat | Boolean | <boolean> | Apply NAT on Remote PepVPN peers’s outgoing Internet traffic |
gobi | Object | <WAN_Gobi_Obj> | Gobi information, only appears if WAN is Gobi |
modem | Object | <WAN_Modem_Obj> | Modem information, only appears if WAN is Modem |
hotStandby | Boolean | <boolean> | To indicate this WAN connection be trying to get connect, when acting as a standby |
idleTimeout | Number | <number> | Modem idle timeout in seconds |
dhcp | Object | <DHCP_Obj> | DHCP Object, for method=DHCP |
staticIp | Object | <Static_IP_Obj> | Static IP Object, for method=Static IP |
pppoe | Object | <PPPoE_Obj> | PPPoE Object, for method=PPPoE |
l2tp | Object | <L2TP_Obj> | L2TP Object, for method=L2TP |
gre | Object | <GRE_Obj> | GRE Object, for method=GRE |
dropin | Object | <DropIn_Obj> | Static IP Object, for method=Static IP |
<Physical_Obj>
Type | Notation | Description | ||
type | String | { ethernet, wireless, modem, gobi } | Port type of the WAN connection | |
speed | String | { Auto, 1000baseTx- FD, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT- HD } | Port speed of WAN | |
advertise | Boolean | <boolean> | Advertise Speed enable | |
supportGigaEthernet | Boolean | <boolean> | Support Giga Ethernet | |
mtu | Number | [ 576, 1500 ] | MTU Value, this field will be absent if MTU is auto | |
mss | Number | [ 536, 1460 ] | MSS Value, this field will be absent if MSS is auto | |
mac | String | <mac> | MAC address, this field will be absent if MAC address is auto | |
vlan | Number | <number> | Only appears if VLAN is enabled |
<Healthcheck_Obj>
Type | Notation | Description | ||
enable | Boolean | <boolean> | Enable config of the Healthcheck function All other field in this object will be absent if this field is false | |
method | String | { http, nslookup, ping, smartcheck } | Healthcheck method | |
timeout | Number | { 1,2,3,4,5,10 } | Timeout in second | |
interval | Number | { 5,10,20,30,60,120,1800,3600 } | Interval in second | |
retry | Number | { 1,3,5,10,15,20 } | Retries times | |
recovery | Number | { 1,3,5,10,15,20 } | Recovery retries times | |
http | Object | <Healthcheck_HTTP_Obj> | Extra information if method=http | |
dns | Object | <Healthcheck_DNS_Obj> | Extra information if method=dns | |
ping | Object | Healthcheck_Ping_Obj> | Extra information if method=ping |
<Bandwidth_Monitor_Obj>
Type | Notation | Description | ||
enable | Boolean | <boolean> | Enable config of Bandwidth Allowance Monitor All other field in this object will be absent if this field is false | |
action | Array | { email, disconnnect } | Action will be taken when the allowance is reach email: when the allowance reach 75% / 95% disconnect: when the allowance reach 100% | |
start | Number | <number> | Start day of bandwidth allowance monitor start=0 means the alst day of the month | |
monthlyAllowance | Object | <Monthly_Obj> | Monthly Allowance |
<DNS_Obj>
Type | Notation | Description | ||
auto | Boolean | <boolean> | Obtain DNS server address automatically | |
server | Array | list of <ipv4> | Custom DNS server addresses |
<DDNS_Obj>
Type | Notation | Description | ||
enable | Boolean | <boolean> | Support DDNS IP update service | |
provider | String | { changeip, dyndns, noip, dnsomatic, customUrl } | Provider of the dynamic DNS provider | |
customUrl | String | <domain> | Custom provider of the DDNS service (only appears if provider=customUrl ) | |
username | String | <string> | Login information of the dynamic DNS provider service | |
password | String | <string> | Password of the dynamic DNS provider service | |
host | Array | list of <string> | Host of dynamic DNS Service |
<Max_Speed_Obj>
Type | Notation | Description | ||
upload | Object | <Bandwidth_Obj> | Upload Limit | |
download | Object | <Bandwidth_Obj> | Download Limit |
<WAN_Gobi_Obj>
Type | Notation | Description | ||
mode | String | <string> | Gobi Mode | |
forceSubnet | Number | <number> | Force Subnet | |
operator | Object | <Operator_Obj> | Operator Object |
<WAN_Modem_Obj>
Type | Notation | Description | ||
mobileType | String | { 4G, 3G, 2G, 2G_3G, 3G_2G } | Mobile Type | |
wimaxLogin | Object | <Login_Pair_Obj> | WIMAX information, only appear if the WAN is WIMAX modem | |
huaweiBand | Array | { GSM1900, GSM900/GSM1800/WCDMA210 } | Huawei information, only appear if the WAN is Huawei modem | |
operator | Object | <Operator_Obj> | Operator Object | |
simPin | String | <string> | SIM Pin |
<DHCP_Obj>
Type | Notation | Description | ||
hostname | String | <string> | Hostname, if hostname does not set or the type of connection method L2TP this field will be absent |
<Static_IP_Obj>
Type | Notation | Description | ||
ip | String | <ipv4> | IP address | |
mask | Number | <maskn> | Subnet Mask | |
gateway | String | <ipv4> | Default gateway |
<PPPoE_Obj>
Type | Notation | Description | ||
username | String | <string> | PPPoE Username | |
password | String | <string> | PPPoE Password | |
service | String | <string> | Service Name, this field will be absent if empty | |
ip | String | <ipv4> | IP address, this field will be absent if empty | |
modemAccess | Object | <Network_Obj> | PPPoE management IP address for access PPPoE modem |
<L2TP_Obj>
Type | Notation | Description | ||
username | String | <string> | L2TPUsername | |
password | String | <string> | L2TP Password | |
host | String | <string> | Server IP address / host | |
staticIp | String | <string> | Static IP, only appears if the IP is set |
<GRE_Obj>
Type | Notation | Description | ||
host | String | <string> | Remote GRE host | |
local | String | <string> | Tunnel Local IP address | |
remote | String | <string> | Tunnel Remote IP address | |
nat | String | <string> | Outgoing NAT IP address | |
staticIp | Object | <Static_IP_Obj>> | Static IP Object This field will only appear if the WAN type is ethernet only |
<Healthcheck_HTTP_Obj>
Type | Notation | Description | ||
url | Array | list of <URL_Pattern_Obj> | Healthcheck URL list |
<Healthcheck_Ping_Obj>
Type | Notation | Description | ||
host | Array | list of <string> | Host for pinging, this field will not appear if the list is empty |
<Healthcheck_DNS_Obj>
Type | Notation | Description | ||
host | Array | list of <string> | DNS Server for healthcheck, this field will not appear if the list is empty | |
includePublic | Boolean | <boolean> | include public DNS server |
<Monthly_Obj>
Type | Notation | Description | ||
value | Number | <number> | Monthly allowance value | |
unit | String | { MB } | Monthly allowance unit, a constant value “MB” |
<Bandwidth_Obj>
Type | Notation | Description | ||
bandwidth | Number | <number> | Limited bandwidth | |
unit | String | { kbps } | Units of bandwidth limitation, a constant value “kbps” |
<Operator_Obj>
Type | Notation | Description | ||
auto | Boolean | <boolean> | Enable auto operator | |
apn | String | <string> | APN | |
username | String | <string> | Username | |
password | String | <string> | Password | |
dialNumber | Number | <number> | Dial Number |
<Login_Pair_Obj>
Type | Notation | Description | ||
username | String | <string> | Username | |
password | String | <string> | Password |
<Network_Obj>
Type | Notation | Description | ||
ip | String | <ipv4> | IP address | |
mask | Number | <maskn> | Subnet Mask |
<URL_Pattern_Obj>
Type | Notation | Description | ||
url | String | <string> | Healthcheck URL | |
pattern | String | <string> | Match string of the url This field will be absent if the match string is empty or disabled |
cURL Example
curl -b cookies.txt http://192.168.1.1/api/config.wan.connection?id=1 2&infoType=connection healthcheck
{ "stat": "ok", "response": { "1": { "name": "WAN 1", "asLan": false, "enable": true, "active": true, "multipleIp": [], "connection": { "method": "dhcp", "mode": "NAT", "icmpPing": true, "priority": 1, "dns": { "auto": true }, "ddns": { "username": "username", "password": "@~HiDdEn~@", "host": [ "kjkjkjkj.com" ], "provider": "noip", "enable": true }, "bandwidth": { "upload": { "bandwidth": 100000, "unit": "kbps" }, "download": { "bandwidth": 100000, "unit": "kbps" } }, "schedule": 4, "dhcp": { "hostname": "" } }, "healthcheck": { "method": "nslookup", "timeout": 5, "interval": 5, "retry": 3, "recovery": 3, "enable": true, "nslookup": { "includePublic": false, "host": [ "208.67.222.222", "208.67.220.220" ] } } }, "2": { "name": "WAN2", "asLan": false, "enable": true, "active": true, "multipleIp": [], "connection": { "method": "dropIn", "mode": "IP Forwarding", "icmpPing": true, "priority": 0, "dns": { "auto": false, "host": [ "3.3.3.3" ] }, "ddns": { "enable": false }, "bandwidth": { "upload": { "bandwidth": 100000, "unit": "kbps" }, "download": { "bandwidth": 100000, "unit": "kbps" } }, "pepVpnNat": true, "dropIn": { "ip": "169.254.0.1", "mask": 24, "gateway": "22.2.2.2" } }, "healthcheck": { "method": "nslookup", "timeout": 5, "interval": 5, "retry": 3, "recovery": 3, "enable": true, "nslookup": { "includePublic": true } } }, "order": [ 1, 2 ] } }