OpenVPN MQTT API Reference
OpenVPN MQTT API Reference
The OpenVPN feature is controlled via MQTT tags that are published when the RediGate initially connects to a broker. This document explains the OpenVPN MQTT tags and how to use them.
Assuming that your RediGate has the following parameters:
- System → Unit Name ($GATEWAY): RG120e-VPN
- Clients → MQTT Client → JSON RBE → Topic Rules → Device Subscription → Topic String: RG/${GATEWAY}/${CHAN}_${DEV}/CMD
This document assumes that the the OpenVPN configuration was copied/pasted from the demo configuration (available here) into the RediGate configuration.
It assumes that the VPN logic resides in Channel 14 (named Ch14-VPN):
And the MQTT tags for configuration and control reside in RTU 3 (named VPN-RTU):
Using the above assumptions, all of the commands below are published on the "RG/RG120e-VPN/Ch14-VPN_VPN-RTU/CMD" topic:
- VPN.Start (R/W, Bool)
- Description: Starts the connection to the VPN server
- Message: {"d": {"VPN.Start": 1}}
- VPN.Stop (R/W, Bool)
- Description: Stops the connection to the VPN server
- Message: {"d": {"VPN.Stop": 1}}
- NAT.Restart (R/W, Bool)
- Description: Sends the latest NAT settings (NAT.IP_Port, NAT.PLC_IP) and refreshes current values
- Message: {"d": {"NAT.Restart": 1}}
- NAT.IP_Port (R/W, Int)
- Description: Port for which all traffic will forwarded to. For a list of common ports used for industrial communications protocols, see: Port Forwarding for Common PLC's
- Message: {"d": {"NAT.IP_Port": 44818}}
- NAT.PLC_IP (R/W, String)
- Description: IP address of the end device to which all IP traffic over the NAT.IP_Port will be forwarded
- Message: {"d": {"NAT.PLC_IP": "192.168.1.110"}}
- NAT.TUN0_IP (R, String)
- Description: IP address assigned by the VPN tunnel
- Message: READ-ONLY
- VPN.ConfName (R, String)
- Description: Name of the uploaded configuration file to look for in the home/director or home/Dirupld folders. All VPN configurations uploaded to the RediGate should be named OpenVPN_CONF.txt, or whatever value is set in the "PreInit Values" section of your VPN configuration:
- Message: READ-ONLY – values written to this tag will be overwritten on boot-up by the "PreInit Values" configuration on the RediGate
- Description: Name of the uploaded configuration file to look for in the home/director or home/Dirupld folders. All VPN configurations uploaded to the RediGate should be named OpenVPN_CONF.txt, or whatever value is set in the "PreInit Values" section of your VPN configuration:
- Nat.Eth1_IP (R, String)
- Description: IP address of the Eth1 port on the RediGate
- Message: READ-ONLY
- VPN.AuthName
- Description: Username credential for connecting to VPN server
- Message: {"d": {"VPN.AuthName": "Your_Username"}}
- VPN.AuthPass
- Description: Username credential for connecting to VPN server
- Message: {"d": {"VPN.AuthPass": "Your_Password"}}
, multiple selections available,
Related content
MQTT Troubleshooting Techniques
MQTT Troubleshooting Techniques
More like this
OpenVPN Configuration
OpenVPN Configuration
More like this
TLS Connection to MQTT Broker
TLS Connection to MQTT Broker
More like this
RediGate to Generic MQTT
RediGate to Generic MQTT
More like this
RediGate P2P Configuration Guide - Point to Point using MQTT
RediGate P2P Configuration Guide - Point to Point using MQTT
More like this
OpenVPN Troubleshooting
OpenVPN Troubleshooting
More like this