Network Configuration
The network configuration of a device is managed via Device Configs in the API. Device configurations describe the configuration attributes for network connections on a gateway type device.
Important: Network Configuration Affects Device Reachability
When you change the network configuration for a device, be sure the settings don't cause the device to lose connection to the internet, such that the device becomes unreachable. If our service can't reach our management platform, we won't be able to remotely manage the device.
Below is a list of the supported connection types and their related properties:
ethernet-wan
ethernet-wan
Tag Name | Type | Value | Default | Description |
---|---|---|---|---|
net_enable | integer | 1 / 0 | 0 | Enables/disables connection |
net_ip_assign | string | auto / static | auto | Automatic or static IP address assignment |
net_ip | string | IPv4 | (empty_string) | Static IP address |
net_mask | string | IPv4 | (empty_string) | Subnet mask |
net_gateway | string | IPv4 | (empty_string) | Default gateway address |
net_broadcast | string | IPv4 | (empty_string) | Broadcast address |
net_nat | integer | 1 / 0 | 1 | Enables/disables NAT masquerading |
net_mtu | integer | 68 - 1500 | 1500 | Maximum Transition Unit MTU |
net_metric | integer | 0 - 65535 | 10 | Sets ethernet connections priority relative to other connections metrics |
net_dns_1 | string | IPv4 | (empty_string) | Primary DNS server |
net_dns_2 | string | IPv4 | (empty_string) | Secondary DNS server |
ethernet-lan
ethernet-lan
Tag Name | Type | Value | Default | Description |
---|---|---|---|---|
net_enable | integer | 1 / 0 | 0 | Enables/disables connection |
net_ip | string | IPv4 | (empty_string) | Static IP address |
net_mask | string | IPv4 | (empty_string) | Subnet mask |
dhcp_relay | integer | 1 / 0 | 0 | Enables/disables DHCP relay |
dhcp_enable | integer | 1 / 0 | 0 | Enables/disables DHCP |
dhcp_start | string | IPv4 | (empty_string) | DHCP start address |
dhcp_end | string | IPv4 | (empty_string) | DHCP end address |
dhcp_lease | integer | 0 - 2^31 | 86400 | DHCP lease time (seconds) |
dhcp_dns1 | string | IPv4 | (empty_string) | Primary DNS server |
dhcp_dns2 | string | IPv4 | (empty_string) | Secondary DNS server |
wifi
wifi
Tag Name | Type | Value | Default | Description |
---|---|---|---|---|
wifi_enable | integer | 1 / 0 | 0 | Enables/disables connection |
wifi_mode | string | ap / bridge | ap | Access point or bridge WiFi operation mode |
wifi_ssid | string | SSID | (empty_string) | Broadcasted SSID in AP mode or SSID to connect in bridge mode |
wifi_auth | string | wpa2psk / wpapsk | wpa2psk | WiFi authentication type |
wifi_crypt | string | aes / tkip | aes | WiFi encryption type |
wifi_psk | string | PSK | (empty_string) | WiFi Pre-shared key (password) |
wifi_channel | integer | 1 - 14 | 11 | WiFi channel |
cellular
cellular
Tag Name | Type | Value | Default | Description |
---|---|---|---|---|
cell_enable | integer | 1 / 0 | 0 | Enables/disables connection |
cell_auto_apn | string | 1 / 0 | 0 | Enables/disables automatic APN selection |
cell_apn | string | string | (empty_string) | Cellular APN (when automatic APN selection is disabled) |
cell_user | string | string | (empty_string) | Cellular APN username |
cell_pass | string | string | (empty_string) | Cellular APN password |
cell_auth | string | chap / pap | chap | Cellular authentication type |
cell_reconn_delay | integer | 30 - 65535 | 30 | Reconnect delay (seconds) |
cell_reconn_retries | integer | 0 - 65535 | 0 | Reconnect retried (0 = unlimited) |
cell_metric | integer | 0 - 65535 | 20 | Sets connection's priority relative to other connection's metrics |
cell_mtu | integer | 68 - 1500 | 1500 | Maximum Transition Unit (MTU) |
Connection Names
The name of the connection objects must match the name of the interface in the operating system on the device. Using a tool like
ifconfig
may help you in determining the name. If in doubt, our support can help you.
{
"name": "Config Group 1",
"device_type_id":"564a13f6a5667f507901017e",
"connections": [
{
"type": "ethernet-wan",
"name": "eth0",
"config": {
"net_enable": 1,
"net_ip_assign": "static",
"net_ip": "192.168.2.60",
"net_mask": "255.255.255.0",
"net_gateway": "192.168.2.1",
"net_broadcast": "",
"net_nat": 1,
"net_mtu": 1500,
"net_metric": 10,
"net_dns_1": "192.168.2.1",
"net_dns_2": "8.8.8.8"
}
},
{
"type": "ethernet-lan",
"name": "eth1",
"config": {
"net_enable": 1,
"net_ip": "192.168.10.1",
"net_mask": "255.255.255.0",
"dhcp_relay": 0,
"dhcp_enable": 1,
"dhcp_start": "192.168.10.100",
"dhcp_end": "192.168.10.199",
"dhcp_lease": 86400,
"dhcp_dns1": "192.168.10.1",
"dhcp_dns2": "8.8.4.4"
}
},
{
"type": "wifi",
"name": "wlan1",
"config": {
"wifi_enable": 1,
"wifi_mode": "ap",
"wifi_ssid": "EdgeDevice",
"wifi_auth": "wpa2psk",
"wifi_crypt": "aes",
"wifi_psk": "apricotsoup",
"wifi_channel": 11
}
},
{
"type": "cellular",
"name": "wwan1",
"config": {
"cell_enable": 1,
"cell_auto_apn": 0,
"cell_apn": "broadband",
"cell_user": "",
"cell_pass": "",
"cell_auth": "chap",
"cell_reconn_delay": 30,
"cell_reconn_retries": 0,
"cell_metric": 20,
"cell_mtu": 1500
}
}
]
}
IP Tables
The IP Tables configuration for a (linux) device is managed via Device Configs in the API. It defines an ordered list of iptables
commands to manage the tables of IP packet filter rules in the Linux kernel.
Field | Type | Value(s) | Required | Description |
---|---|---|---|---|
action | string | 'append' / 'flush' | true | The command action |
chain | string | 'INPUT' / 'OUTPUT' / 'PREROUTING' / 'POSTROUTING' / 'FORWARD' / '[YOUR_CUSTOM_CHAIN]' | true | The rule chain |
jump | string | 'ACCEPT' / 'DROP' / 'QUEUE' / 'RETURN' | true, if action is 'append' | The rule jump target |
table | string | 'filter' / 'nat' / 'mangle' / 'raw' / 'security' | false | The rule table |
protocol | string | 'tcp' / 'udp' / 'udplite' / 'icmp' / 'esp' / 'ah' / 'sctp' | false | The rule protocol |
source | string | 'N.N.N.N/M.M.M.M' / 'N.N.N.N/M' | false | The rule source - May be formatted as: 'N.N.N.N/M.M.M.M', where N.N.N.N is the IP address range and M.M.M.M is the netmask or 'N.N.N.N/M', where N.N.N.N is the IP address range and M is the bitmask |
destination | string | 'N.N.N.N/M.M.M.M' / 'N.N.N.N/M' | false | The rule destination - May be formatted as: 'N.N.N.N/M.M.M.M', where N.N.N.N is the IP address range and M.M.M.M is the netmask or 'N.N.N.N/M', where N.N.N.N is the IP address range and M is the bitmask |
source_port | string | 'XXXX' / 'XXXX:YYYY' | false | The rule source port - May only be used when the procotol option is set as 'tcp' or 'udp'. To specify a range of port numbers, separate the two numbers with a colon (:), such as '3000:3200'. The largest acceptable valid range is '0:65535' |
destination_port | string | 'XXXX' / 'XXXX:YYYY' | false | The rule destination port - May only be used when the procotol option is set as 'tcp' or 'udp'. To specify a range of port numbers, separate the two numbers with a colon (:), such as '3000:3200'. The largest acceptable valid range is '0:65535' |
in_interface | string | i.e. 'eth0' | false | The rule incoming network interface - May only be used with the 'INPUT' and 'FORWARD' chains when used with the 'filter' table and the 'PREROUTING' chain with the 'nat' and 'mangle' tables |
out_interface | string | i.e. 'eth0' | false | The rule outgoing network interface - May only be used with 'OUTPUT' and 'FORWARD' chains in the 'filter' table, and the 'POSTROUTING' chain in the 'nat' and 'mangle' tables |
{
"name": "Config Group 2",
"device_type_id":"564a13f6a5667f507901017e",
"iptables": [
{
"action": "append",
"chain": "INPUT",
"protocol": "tcp",
"in_interface": "eth0",
"destination_port": "666:777",
"destination": "66.66.66.66",
"jump": "DROP"
},
{
"action": "append",
"chain": "INPUT",
"protocol": "tcp",
"in_interface": "eth1",
"destination_port": "555",
"destination": "55.55.55.55",
"jump": "ACCEPT"
}
]
}
Updated over 4 years ago