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

Tag NameTypeValueDefaultDescription
net_enableinteger1 / 00Enables/disables connection
net_ip_assignstringauto / staticautoAutomatic or static IP address assignment
net_ipstringIPv4(empty_string)Static IP address
net_maskstringIPv4(empty_string)Subnet mask
net_gatewaystringIPv4(empty_string)Default gateway address
net_broadcaststringIPv4(empty_string)Broadcast address
net_natinteger1 / 01Enables/disables NAT masquerading
net_mtuinteger68 - 15001500Maximum Transition Unit MTU
net_metricinteger0 - 6553510Sets ethernet connections priority relative to other connections metrics
net_dns_1stringIPv4(empty_string)Primary DNS server
net_dns_2stringIPv4(empty_string)Secondary DNS server

ethernet-lan

Tag NameTypeValueDefaultDescription
net_enableinteger1 / 00Enables/disables connection
net_ipstringIPv4(empty_string)Static IP address
net_maskstringIPv4(empty_string)Subnet mask
dhcp_relayinteger1 / 00Enables/disables DHCP relay
dhcp_enableinteger1 / 00Enables/disables DHCP
dhcp_startstringIPv4(empty_string)DHCP start address
dhcp_endstringIPv4(empty_string)DHCP end address
dhcp_leaseinteger0 - 2^3186400DHCP lease time (seconds)
dhcp_dns1stringIPv4(empty_string)Primary DNS server
dhcp_dns2stringIPv4(empty_string)Secondary DNS server

wifi

Tag NameTypeValueDefaultDescription
wifi_enableinteger1 / 00Enables/disables connection
wifi_modestringap / bridgeapAccess point or bridge WiFi operation mode
wifi_ssidstringSSID(empty_string)Broadcasted SSID in AP mode or SSID to connect in bridge mode
wifi_authstringwpa2psk / wpapskwpa2pskWiFi authentication type
wifi_cryptstringaes / tkipaesWiFi encryption type
wifi_pskstringPSK(empty_string)WiFi Pre-shared key (password)
wifi_channelinteger1 - 1411WiFi channel

cellular

Tag NameTypeValueDefaultDescription
cell_enableinteger1 / 00Enables/disables connection
cell_auto_apnstring1 / 00Enables/disables automatic APN selection
cell_apnstringstring(empty_string)Cellular APN (when automatic APN selection is disabled)
cell_userstringstring(empty_string)Cellular APN username
cell_passstringstring(empty_string)Cellular APN password
cell_authstringchap / papchapCellular authentication type
cell_reconn_delayinteger30 - 6553530Reconnect delay (seconds)
cell_reconn_retriesinteger0 - 655350Reconnect retried (0 = unlimited)
cell_metricinteger0 - 6553520Sets connection's priority relative to other connection's metrics
cell_mtuinteger68 - 15001500Maximum 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.

FieldTypeValue(s)RequiredDescription
actionstring'append' / 'flush'trueThe command action
chainstring'INPUT' / 'OUTPUT' / 'PREROUTING' / 'POSTROUTING' / 'FORWARD' / '[YOUR_CUSTOM_CHAIN]'trueThe rule chain
jumpstring'ACCEPT' / 'DROP' / 'QUEUE' / 'RETURN'true, if action is 'append'The rule jump target
tablestring'filter' / 'nat' / 'mangle' / 'raw' / 'security'falseThe rule table
protocolstring'tcp' / 'udp' / 'udplite' / 'icmp' / 'esp' / 'ah' / 'sctp'falseThe rule protocol
sourcestring'N.N.N.N/M.M.M.M' / 'N.N.N.N/M'falseThe 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
destinationstring'N.N.N.N/M.M.M.M' / 'N.N.N.N/M'falseThe 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_portstring'XXXX' / 'XXXX:YYYY'falseThe 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_portstring'XXXX' / 'XXXX:YYYY'falseThe 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_interfacestringi.e. 'eth0'falseThe 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_interfacestringi.e. 'eth0'falseThe 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"
    }
  ]
}