Collection of articles for working with Multitech devices in LoRaWAN networks.
Complete schema documentation for VPN tunnel resources in the mPower Device API: ipsecTunnels, greTunnels, and ovpnTunnels.
The mPower Device API supports three types of VPN tunnels:
IPsec tunnels provide secure site-to-site VPN connections using Internet Key Exchange (IKE) protocols. Supports both IKEv1 and IKEv2 with pre-shared keys or certificate-based authentication.
The ipsecTunnels resource is an array of tunnel configurations:
[
{
// IPsec tunnel configuration
}
]
| Property | Type | Required | Description |
|---|---|---|---|
enabled |
boolean | Yes | Enable/disable tunnel |
name |
string | Yes | Tunnel label (max 15 chars, alphanumeric) |
description |
string | Yes | Tunnel description (max 250 chars) |
remoteWanIp |
string | Yes | Remote peer public IP or hostname |
type |
string | Yes | IKE version: “IKE” (v1) or “IKEv2” |
allowAllTraffic |
boolean | Yes | Allow all traffic without subnet filtering |
localSubnets |
array | Yes | Local networks accessible through tunnel |
remoteSubnets |
array | Yes | Remote networks accessible through tunnel |
authMethod |
string | Yes | Authentication: “secret” (PSK) or “rsasig” (certificates) |
psk |
string | Conditional | Pre-shared key (required if authMethod = “secret”) |
caCert |
string | Conditional | CA certificate PEM (required if authMethod = “rsasig”) |
localCert |
string | Conditional | Local certificate PEM (required if authMethod = “rsasig”) |
localPrivKey |
string | Conditional | Local private key PEM (required if authMethod = “rsasig”) |
uid |
boolean | Yes | Use unique identifiers for authentication |
localId |
string | Yes | Local peer identifier |
remoteId |
string | Yes | Remote peer identifier |
encryptMethod |
string | Yes | Encryption: “3des”, “aes”, “aes128”, “aes192”, “aes256”, or “” |
phase1 |
string | No | Phase 1 algorithms (e.g., “aes128-sha1;modp1024”) |
phase2 |
string | No | Phase 2 algorithms (e.g., “aes128-sha1;modp1024”) |
ikelife |
integer | Yes | IKE SA lifetime in hours |
keylife |
integer | Yes | IPsec SA lifetime in hours |
retries |
integer | Yes | Connection retry attempts |
checkPeriod |
integer | No | Hostname resolution interval in minutes |
compression |
boolean | Yes | Enable IPComp compression |
aggressiveMode |
boolean | No | Enable aggressive mode (IKEv1 only, less secure) |
perfectForwardSecrecy |
boolean | Yes | Enable Perfect Forward Secrecy (PFS) |
natTraversal |
boolean | No | Enable NAT traversal (NAT-T) |
| Property | Type | Description |
|---|---|---|
ip |
string | Network IP address |
mask |
integer | Subnet mask (1-32) |
{
"enabled": true,
"name": "HQ-Branch",
"description": "VPN to headquarters",
"remoteWanIp": "203.0.113.50",
"type": "IKEv2",
"allowAllTraffic": false,
"localSubnets": [
{"ip": "192.168.1.0", "mask": 24}
],
"remoteSubnets": [
{"ip": "10.0.0.0", "mask": 16}
],
"authMethod": "secret",
"psk": "MySecurePreSharedKey123!",
"caCert": "",
"localCert": "",
"localPrivKey": "",
"uid": true,
"localId": "branch@example.com",
"remoteId": "hq@example.com",
"encryptMethod": "aes256",
"phase1": "",
"phase2": "",
"ikelife": 8,
"keylife": 1,
"retries": 3,
"checkPeriod": 0,
"compression": false,
"perfectForwardSecrecy": true,
"natTraversal": true
}
{
"enabled": true,
"name": "Partner-VPN",
"description": "VPN to partner network",
"remoteWanIp": "198.51.100.25",
"type": "IKE",
"allowAllTraffic": false,
"localSubnets": [
{"ip": "192.168.10.0", "mask": 24}
],
"remoteSubnets": [
{"ip": "172.16.0.0", "mask": 16}
],
"authMethod": "rsasig",
"psk": "",
"caCert": "-----BEGIN CERTIFICATE-----\nMIID...\n-----END CERTIFICATE-----",
"localCert": "-----BEGIN CERTIFICATE-----\nMIID...\n-----END CERTIFICATE-----",
"localPrivKey": "-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----",
"uid": true,
"localId": "C=US, O=MyCompany, CN=gateway1",
"remoteId": "C=US, O=Partner, CN=gateway2",
"encryptMethod": "aes128",
"phase1": "aes128-sha256;modp2048",
"phase2": "aes128-sha256;modp2048",
"ikelife": 24,
"keylife": 8,
"retries": 5,
"checkPeriod": 0,
"compression": false,
"aggressiveMode": false,
"perfectForwardSecrecy": true,
"natTraversal": false
}
GRE (Generic Routing Encapsulation) tunnels provide IP-in-IP tunneling for routing between networks. GRE tunnels are not encrypted by default but can be combined with IPsec for security.
The greTunnels resource is an array of tunnel configurations:
[
{
// GRE tunnel configuration
}
]
| Property | Type | Required | Description |
|---|---|---|---|
enabled |
boolean | Yes | Enable/disable tunnel |
name |
string | Yes | Tunnel name (max 15 chars, alphanumeric when enabled) |
description |
string | Yes | Tunnel description (max 250 chars) |
remoteIp |
string | Yes | Remote tunnel endpoint IP or hostname |
ttl |
integer | Yes | Time to live (0 = inherit, 1-255) |
checkPeriod |
integer | Yes | Hostname resolution interval in minutes (1-120) |
tunnelIp |
string | Yes | Local tunnel interface IP address |
tunnelMask |
string | Yes | Tunnel interface subnet mask |
routes |
array | Yes | Static routes through tunnel |
| Property | Type | Description |
|---|---|---|
ip |
string | Destination network IP |
mask |
integer/string | Subnet mask (CIDR or dotted decimal) |
{
"enabled": true,
"name": "gre-hq",
"description": "GRE tunnel to headquarters",
"remoteIp": "203.0.113.100",
"ttl": 64,
"checkPeriod": 5,
"tunnelIp": "10.255.255.1",
"tunnelMask": "255.255.255.252",
"routes": [
{"ip": "10.0.0.0", "mask": 16},
{"ip": "172.16.0.0", "mask": 12}
]
}
{
"enabled": true,
"name": "gre-remote",
"description": "GRE to remote site with DDNS",
"remoteIp": "remote.example.com",
"ttl": 0,
"checkPeriod": 10,
"tunnelIp": "10.255.255.5",
"tunnelMask": "255.255.255.252",
"routes": [
{"ip": "192.168.50.0", "mask": 24}
]
}
{
"enabled": true,
"name": "gre-p2p",
"description": "Point-to-point GRE tunnel",
"remoteIp": "198.51.100.75",
"ttl": 64,
"checkPeriod": 5,
"tunnelIp": "",
"tunnelMask": "",
"routes": [
{"ip": "172.20.0.0", "mask": "255.255.0.0"}
]
}
OpenVPN tunnels provide flexible SSL/TLS-based VPN connections. The device can act as an OpenVPN server, client, or use custom configurations.
The ovpnTunnels resource is an array of tunnel configurations:
[
{
// OpenVPN tunnel configuration
}
]
| Property | Type | Required | Description |
|---|---|---|---|
enabled |
boolean | Yes | Enable/disable tunnel |
name |
string | Yes | Tunnel instance name (no spaces, max 250 chars) |
description |
string | Yes | Tunnel description |
type |
string | Yes | Tunnel type: “SERVER”, “CLIENT”, or “CUSTOM” |
config |
string | Yes | OpenVPN configuration file content (max 60000 chars) |
| Type | Description | Use Case |
|---|---|---|
SERVER |
OpenVPN server mode | Accept incoming VPN connections |
CLIENT |
OpenVPN client mode | Connect to external OpenVPN server |
CUSTOM |
Custom configuration | Advanced/manual OpenVPN configuration |
{
"enabled": true,
"name": "ovpn-server",
"description": "OpenVPN server for remote access",
"type": "SERVER",
"config": "port 1194\nproto udp\ndev tun\nca ca.crt\ncert server.crt\nkey server.key\ndh dh2048.pem\nserver 10.8.0.0 255.255.255.0\npush \"route 192.168.1.0 255.255.255.0\"\nkeepalive 10 120\ncipher AES-256-CBC\nauth SHA256\ncomp-lzo\nuser nobody\ngroup nogroup\npersist-key\npersist-tun\nstatus /var/log/openvpn-status.log\nverb 3"
}
{
"enabled": true,
"name": "ovpn-client",
"description": "Connect to corporate VPN",
"type": "CLIENT",
"config": "client\ndev tun\nproto udp\nremote vpn.example.com 1194\nresolv-retry infinite\nnobind\npersist-key\npersist-tun\nca ca.crt\ncert client.crt\nkey client.key\nremote-cert-tls server\ncipher AES-256-CBC\nauth SHA256\ncomp-lzo\nverb 3"
}
{
"enabled": true,
"name": "ovpn-custom",
"description": "Custom OpenVPN with specific routing",
"type": "CUSTOM",
"config": "mode p2p\nremote 203.0.113.50\nport 1194\nproto udp\ndev tun\nifconfig 10.9.0.1 10.9.0.2\nsecret static.key\ncipher AES-256-CBC\nauth SHA512\ncomp-lzo\nkeepalive 10 60\nverb 3\nroute 10.0.0.0 255.255.0.0\nroute 172.16.0.0 255.240.0.0"
}
GET /api?fields=ipsecTunnels
POST /api/ipsecTunnels
Content-Type: application/json
{
"enabled": true,
"name": "tunnel1",
"description": "Site-to-site VPN",
"remoteWanIp": "203.0.113.50",
"type": "IKEv2",
"allowAllTraffic": false,
"localSubnets": [{"ip": "192.168.1.0", "mask": 24}],
"remoteSubnets": [{"ip": "10.0.0.0", "mask": 16}],
"authMethod": "secret",
"psk": "MySecretKey",
"uid": true,
"localId": "local@example.com",
"remoteId": "remote@example.com",
"encryptMethod": "aes256",
"ikelife": 8,
"keylife": 1,
"retries": 3,
"compression": false,
"perfectForwardSecrecy": true
}
PUT /api/ipsecTunnels/{index}
Content-Type: application/json
{
"enabled": true,
"description": "Updated description",
...
}
DELETE /api/ipsecTunnels/{index}
GET /api?fields=greTunnels
POST /api/greTunnels
Content-Type: application/json
{
"enabled": true,
"name": "gre1",
"description": "GRE to HQ",
"remoteIp": "203.0.113.100",
"ttl": 64,
"checkPeriod": 5,
"tunnelIp": "10.255.255.1",
"tunnelMask": "255.255.255.252",
"routes": [
{"ip": "10.0.0.0", "mask": 16}
]
}
PUT /api/greTunnels/{index}
DELETE /api/greTunnels/{index}
GET /api?fields=ovpnTunnels
POST /api/ovpnTunnels
Content-Type: application/json
{
"enabled": true,
"name": "ovpn1",
"description": "OpenVPN client",
"type": "CLIENT",
"config": "client\ndev tun\nproto udp\n..."
}
PUT /api/ovpnTunnels/{index}
DELETE /api/ovpnTunnels/{index}
# 1. Login
curl -X POST http://192.168.2.1/api/login \
-d '{"username":"admin","password":"admin"}' -c cookies.txt
# 2. Create IPsec tunnel
curl -X POST http://192.168.2.1/api/ipsecTunnels \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"enabled": true,
"name": "site-vpn",
"description": "Site-to-site VPN",
"remoteWanIp": "203.0.113.50",
"type": "IKEv2",
"allowAllTraffic": false,
"localSubnets": [{"ip": "192.168.1.0", "mask": 24}],
"remoteSubnets": [{"ip": "10.0.0.0", "mask": 16}],
"authMethod": "secret",
"psk": "StrongPreSharedKey123!",
"uid": true,
"localId": "local@example.com",
"remoteId": "remote@example.com",
"encryptMethod": "aes256",
"ikelife": 8,
"keylife": 1,
"retries": 3,
"compression": false,
"perfectForwardSecrecy": true,
"natTraversal": true
}'
# 3. Save
curl -X POST http://192.168.2.1/api/command/save -b cookies.txt
# Create GRE tunnel
curl -X POST http://192.168.2.1/api/greTunnels \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"enabled": true,
"name": "gre-hq",
"description": "GRE tunnel to HQ",
"remoteIp": "203.0.113.100",
"ttl": 64,
"checkPeriod": 5,
"tunnelIp": "10.255.255.1",
"tunnelMask": "255.255.255.252",
"routes": [
{"ip": "10.0.0.0", "mask": 16}
]
}'
# Save
curl -X POST http://192.168.2.1/api/command/save -b cookies.txt
# Create OpenVPN client tunnel
curl -X POST http://192.168.2.1/api/ovpnTunnels \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"enabled": true,
"name": "corporate-vpn",
"description": "Corporate VPN access",
"type": "CLIENT",
"config": "client\ndev tun\nproto udp\nremote vpn.company.com 1194\nresolv-retry infinite\nnobind\npersist-key\npersist-tun\nca ca.crt\ncert client.crt\nkey client.key\nremote-cert-tls server\ncipher AES-256-CBC\nauth SHA256\nverb 3"
}'
# Save
curl -X POST http://192.168.2.1/api/command/save -b cookies.txt
Format: cipher-hash;group
Common combinations:
aes128-sha1;modp1024 - Basic securityaes256-sha256;modp2048 - Strong securityaes256-sha512;modp4096 - Maximum securityallowAllTraffic: true to bypass subnet filteringuser@domain.comC=US, O=Company, CN=gateway192.168.1.1"") for point-to-point without addressingtunnelIp and tunnelMask must be providedcheckPeriod to periodically resolve hostname\n) to separate directivesServer mode:
port 1194
proto udp
dev tun
server 10.8.0.0 255.255.255.0
push "route 192.168.1.0 255.255.255.0"
Client mode:
client
remote vpn.example.com 1194
dev tun
proto udp
Security:
cipher AES-256-CBC
auth SHA256
tls-auth ta.key 0
Connect two office locations securely:
Combine GRE and IPsec for secure routing:
allowAllTraffic: trueProvide VPN access for remote users:
Connect device to cloud provider VPN:
Use VPN as backup WAN:
Check:
Debug:
# Check IPsec status
GET /api?fields=stats/ipsec
# View logs
GET /api?fields=eventlog
Check:
Check:
allowAllTraffic setting if using custom firewall rulesCheck:
Check:
checkPeriod is set appropriatelyCheck:
Check:
Validate config:
# Test OpenVPN config locally
openvpn --config /path/to/config --verb 3
Check:
Check:
allowAllTraffic: true when possibletls-auth directiveuser nobody and group nogroupLast Updated: December 17, 2025
Schema Versions: ipsecTunnels (1), greTunnels (1), ovpnTunnels (1)