Get network card info
1. API Description
This API is used to get network card information.
Request mode: POST [ip]/api/network/if-info
Administrator Rights | Logged-in |
---|---|
Yes | Yes |
2. Input Parameters
None
3. Output Parameters
Name | Type | Description |
---|---|---|
status | Int | Status code |
device-name | String | The device name |
net | Array of NetData | The network card list |
ext-mobile-first | Booean | Reserved |
NetData
Name | Type | Description |
---|---|---|
support-enable | Boolean | Whether to supportEnable/Disable Wi-Fi/AP true: Yes; false: No |
enable | Boolean | Whether the network card service is enabled true: Yes; false: No |
prio | Int | Network card priority |
iface | String | The network card name eth0: Ethernet; wlan0: Wi-Fi; wlan1: AP; usb0: USB NET |
type | Int | The network card type 0: Ethernet 1: Wi-Fi/AP 3: USB NET |
use-dhcp | Boolean | Whether to enable DHCP to get IP address true: Yes; false: No |
ipaddr | String | IP address |
ipv6addr | String | IPv6 address |
netmask | String | Subnet mask |
gateway | String | Gateway address |
link-speed | Int | Link speed 10: 10Mbps 100: 100Mbps 1000: 1Gbps 2500: 2.5Gbps 10000: 10Gbps 12: full-speed 480: high-speed 5000: super-speed-5g 10000: super-speed-10g |
link-state | Int | Link state 0: Network port exception 1: Not connected 2: Connected |
tx-speed-kbps | Int | The sending speed (Kbps) |
rx-speed-kbps | Int | The receiving speed (Kbps) |
mode | Int | The working mode of wireless network card 0: STA mode; 1: AP mode |
mode-lock | Boolean | Whether the wireless card working mode is locked true: Yes; false: No |
ssid | String | AP name |
reboot-require | Boolean | Whether it requires reboot when the wireless network card switches working mode true: Yes; false: No |
enable-ncm | Boolean | Whether USB NET is enabled. true: Enabled; false: Disabled |
4. Example
Obtaining network card information.
Input Example
None
Output Example
{
"device-name": "USB Fusion A506220808456-1",
"ext-mobile-first": false,
"net": [
{
"support-enable": false,
"enable": true,
"prio": 33,
"iface": "eth0",
"type": 0,
"use-dhcp": true,
"ipaddr": "10.10.13.168",
"netmask": "255.255.240.0",
"gateway": "10.10.0.1",
"mac": "d0:c8:57:81:07:b0",
"link-speed": 1000,
"link-state": 2,
"tx-speed-kbps": 120,
"rx-speed-kbps": 8
},
{
"support-enable": true,
"enable": false,
"prio": 34,
"iface": "wlan0",
"type": 1,
"mode": 0,
"mode-lock": true,
"ssid": "",
"reboot-require": false,
"use-dhcp": true,
"ipaddr": "",
"netmask": "",
"gateway": "",
"mac": "20:50:e7:16:5e:b1",
"link-speed": -1,
"link-state": 1,
"tx-speed-kbps": 0,
"rx-speed-kbps": 0
},
{
"support-enable": true,
"enable": true,
"prio": 35,
"iface": "wlan1",
"type": 1,
"mode": 1,
"mode-lock": true,
"ssid": "USB-Fusion_8456_5G",
"reboot-require": false,
"use-dhcp": true,
"ipaddr": "192.168.67.1",
"netmask": "255.255.255.0",
"gateway": "",
"mac": "22:50:e7:16:1e:b1",
"link-speed": -1,
"link-state": 2,
"tx-speed-kbps": 0,
"rx-speed-kbps": 0
},
{
"support-enable": false,
"enable": true,
"prio": 0,
"iface": "usb0",
"type": 3,
"enable-ncm": true,
"use-dhcp": true,
"ipaddr": "192.168.66.1",
"netmask": "255.255.255.0",
"gateway": "192.168.66.1",
"mac": "8e:40:1a:34:69:d4",
"link-speed": 5000,
"link-state": 2,
"tx-speed-kbps": 10,
"rx-speed-kbps": 39
}
],
"status": 0
}
5. Error Code
No error code related to the API business logic. For other error codes, see Common Error Codes.