Skip to content

Contents

describe

  • WAN interface

Interface version

Version numberMakerDate of formulationRevision date
1.0alan2022-07-26

POST request address

http://192.168.1.1/api

API List

NameDescription
setSet WAN Internet access mode
getGet WAN configuration
get_runtimeGet the real-time status of WAN

1、set

wan is set to static Internet access parameters

{
"version": "1.0",
"sid": "5bdd8aec153a8ff183387bfcea40e3aa",
"module":"wan",
"api":"set",
"param": {
"proto":"static",
"static": {
"ipv4addr": "192.168.18.100",
"ipv4mask": "255.255.255.0",
"ipv4gateway": "192.168.18.1",
"ipv4dns1": "114.114.114.114"
}
}
}

Wan set to dhcp Internet access parameters

{
"version": "1.0",
"sid": "5bdd8aec153a8ff183387bfcea40e3aa",
"module":"wan",
"api":"set",
"param": {
"proto":"dhcp",
"dhcp":{
"peerdns":"0",
"ipv4dns1":"114.114.114.114",
"ipv4dns2":"8.8.8.8"
}
}
}

Wan set to pppoe Internet access parameters

{
"version": "1.0",
"sid": "5bdd8aec153a8ff183387bfcea40e3aa",
"module":"wan",
"api":"set",
"param": {
"proto": "pppoe",
"pppoe": {
"username": "cHBwb2V0ZXN0",
"password": "cHBwb2V0ZXN0",
"peerdns": "1",
"advance": "0"
}
}
}

Request parameter description

Parameter nametypedescription
verstringAPI version
sidstringsession id returned after logging
modulestringrequested module
apistringrequested api interface
param.protostringSet the WAN port Internet access method, dhcp, pppoe, static
param.dhcp.peerdnsstringdhcp is manually set to DNS, 0 identification is manually set, parameters need to have ipv4dns1 and ipv4dns2
param.dhcp.ipv4dns1stringpeerdns is set to 0, manually set the first dns
param.dhcp.ipv4dns2stringpeerdns is set to 0, manually set the second dns
param.static.ipv4addrstringIP address of static Internet access WAN port
param.static.ipv4maskstringMask of static Internet WAN port
param.static.ipv4gatewaystringGateway IP of static Internet access WAN port
param.static.ipv4dns1stringfirst dns set manually, optional settings
param.static.ipv4dns2stringSecond DNS set manually, optional settings
param.pppoe.usernamestringpppoe’s dialing username, base64 encrypted ciphertext
param.pppoe.passwordstringpppoe’s dialing password, base64 encrypted ciphertext
param.pppoe.peerdnsstringWhether to set dns manually, if it is 0, you need to set ipv4dns1 and ipv4dns2
param.pppoe.advancestringWhether advanced settings are required, if it is 1, you need to set the mtu parameters
param.pppoe.mtustringadvance is set to 1
param.pppoe.ipv4dns1stringpeerdns is set to 0, manually set the first dns
param.pppoe.ipv4dns2stringpeerdns is set to 0, manually set the second dns

Return to the example

{
"module": "wan",
"version": "1.0",
"api": "set",
"errcode": 0,
"result": {},
"sid": "9f871caadd083d82cefa516de04ac31a"
}

Return to parameter description

Parameter nametypedescription
modulestringrequested module
versionstringapi version
apistringrequested api interface
errcodestringReturned error code
sidstringrequested sid

2、get

Get the configuration request format of the wan port

{
"version": "1.0",
"sid": "3675428b10de8a6c06ac67d5f33db45a",
"module": "wan",
"api": "get"
}

Request parameter description

Parameter nametypedescription
versionstringAPI version
sidstringsession id returned after logging
modulestringrequested module
apistringrequested api interface

Return to the example

{
"module": "wan",
"version": "1.0",
"api": "get",
"errcode": 0,
"result": {
"config": {
"dhcp": {
"ipv4dns1": "114.114.114.114",
"peerdns": "0",
"ipv4dns2": "8.8.8.8",
"mtu": "1500"
},
"static": {
"mtu": "1500",
"ipv4dns1": "114.114.114.114",
"ipv4gateway": "192.168.18.1",
"ipv4mask": "255.255.255.0",
"ipv4addr": "192.168.18.100"
},
"pppoe": {
"username": "cHBwb2V0ZXN0",
"special_dial": "0",
"advance": "0",
"mtu": "1480",
"peerdns": "1",
"password": "cHBwb2V0ZXN0"
}
},
"proto": "dhcp"
},
"sid": "3675428b10de8a6c06ac67d5f33db45a"
}

Return to parameter description

Parameter nametypedescription
modulestringrequested module
versionstringapi version
apistringrequested api interface
errcodestringReturned error code
sidstringrequested sid
result.config.protostringcurrent wan working mode
result.config.dhcpstringConfiguration when wan port is used for dhcp, subfields refer to set interface
result.config.staticstringConfiguration when wan port is static, subfields refer to set interface
result.config.pppoestringwan port configuration when using pppoe, subfield reference set interface

3、get_runtime

Request parameter description

{
"version": "1.0",
"sid": "49bb324560eb4eaf3c6d9ed652ca1e8c",
"module": "wan",
"api": "get_runtime",
"param": {}
}

Request parameter description

Parameter nametypedescription
versionstringAPI version
sidstringsession id returned after logging
modulestringrequested module
apistringrequested api interface

Return to the example

{
"module": "wan",
"version": "1.0",
"api": "get_runtime",
"errcode": 0,
"result": {
"status": {
"cable": true,
"ipv4dns2": "8.8.8.8",
"up": true,
"ipv4dns1": "114.114.114.114",
"ipv4gateway": "192.168.18.1",
"ipv4mask": "255.255.255.0",
"ipv4addr": "192.168.18.248"
},
"proto": "dhcp"
},
"sid": "9f667090acfa315b0e797cd8d28fc6f0"
}

Return to parameter description

Parameter nametypedescription
modulestringrequested module
versionstringapi version
apistringrequested api interface
errcodestringReturned error code
sidstringrequested sid
result.protostringcurrent wan working mode
result.status.cablestringWan port network cable is connected
result.status.upstringWand port is getting the IP address
result.status.ipv4addrstringwan port’s ip address
result.status.ipv4maskstringwan port subnet mask
result.status.ipv4gatewaystringwan port gateway address
result.status.ipv4dns1stringfirst dns address of wan port
result.status.ipv4dns2stringThe second dns address of wan port