IMD SolutionComputing LibraryShop main store

How-to

Routing remote VPN traffic behind a ctrlX CORE gateway

Remote access and virtualization Published 8 min read By IMD Solution engineering team

Short answer

Connecting the VPN lands your traffic on the ctrlX CORE's tap0 interface; everything past that is routing. Register each machine subnet in the remote-access LAN settings, enable IP forwarding between tap0 and the machine-facing interfaces, and give every target a return path through a device gateway or source NAT in the Firewall app. Then test both directions before trusting the session.

On this page
  1. Why does the VPN connect but the machine device stay unreachable?
  2. Which machine subnets go into the remote-access LAN settings?
  3. How do you enable forwarding between tap0 and the machine interfaces?
  4. How does each device send its reply back through the gateway?
  5. When should you use source NAT instead of changing device gateways?
  6. Can device web pages be published without opening the VPN?
  7. What tests prove the path end to end?
  8. Questions asked

Connecting the remote VPN is the first half of the path, not the whole path. The tunnel terminates on the ctrlX CORE's tap0 interface: requests addressed to the ctrlX CORE itself are answered locally, while requests to a controller, drive or camera beyond it must be forwarded through the device and answered on a route that leads back. In the documented IXON setup that takes three settings: each machine subnet registered in the remote-access LAN configuration, IP forwarding enabled between tap0 and the machine-facing interfaces — from the 3.6 update, through the basic Firewall app R911430062 — and a return path for every target, by device gateway or source NAT. This article walks through each setting, the two release branches, and the tests that prove the path end to end.

Why does the VPN connect but the machine device stay unreachable? #

Because the tunnel ends on the ctrlX CORE's tap0 interface rather than on the device: a request addressed to the ctrlX CORE is answered locally, while a request for a controller past it needs forwarding out of tap0 and a reply path that leads back. That split produces the classic symptom: the ctrlX CORE's web page opens over the tunnel while a PLC two switches away times out. Two independent settings are missing, outbound forwarding and an inbound return route, and either one alone leaves the session dead. The failure has a site-to-site twin as well: the walkthrough on why a site-to-site VPN comes up but the remote PLC stays unreachable treats the SCADA-side version of the same gap.

Which machine subnets go into the remote-access LAN settings? #

Register the ctrlX CORE's address on the primary router network as the router LAN IP, then add each further network once as an additional subnet; the documented example carries three beyond the router LAN: 192.168.2.0, the EtherCAT EoE network 192.168.40.0 and the Sercos drive network 172.31.254.0.

In Fleet Manager, open the onboarded device's LAN page and make both entries. Listing a network tells the remote client where to send traffic; it does not create the machine-side link, so confirm each attachment locally first. A network address entered alone does not carry its mask: read the mask from the running interface or device configuration and enter the complete range. Then compare the remote PC's own local ranges with the machine ranges; an overlap sends requests for that range to the PC's local interface instead of the tunnel, which the walkthrough for PLC communication across the 192.168.1.x and 192.168.2.x subnets works through in detail.

Network Where it attaches Verify locally before listing it
192.168.1.0 Primary router network, the ctrlX CORE's own LAN Not listed separately; covered by the router LAN IP
192.168.2.0 Secondary machine network, the XM21's segment ctrlX CORE and XM21 both answer on this segment
192.168.40.0 EtherCAT EoE network on the ctrlX CORE The EoE path reaches the intended device locally
172.31.254.0 Sercos drive network behind the XM21 The XM21 provides IP access to the drive network

How do you enable forwarding between tap0 and the machine interfaces? #

Turn on IP forwarding for tap0 and for every machine-facing interface that must carry remote traffic; on the 2.6 release that option plus per-device gateways completes the path, while from the 3.6 update the routing runs through the basic Firewall app.

tap0 is the tunnel interface the remote-access service creates on the ctrlX CORE, so a request for anything other than the ctrlX CORE itself has to leave through a machine-facing interface. The controller acting as the gateway into the machine LAN is the pattern described in the article on how a VPN gateway on a controller routes you to the machine LAN. Which mechanism performs the forwarding follows the installed release: identify which release your components carry before choosing the procedure, because the 2.6 branch and the 3.6 branch are configured differently. From the 3.6 update the routing is implemented with the basic Firewall app, license designation SWL-XC*-FRW-FIREWALL*****-BANN, an industrial firewall for ctrlX OS that checks traffic between networks against predefined criteria; install it through the manufacturer's documented software channels.

  1. Record the installed release and the apps already present on the device.
  2. Enable IP forwarding on tap0 and on each machine-facing interface that must carry remote traffic.
  3. On an installation at or above the 3.6 update, install the basic Firewall app R911430062 and apply its routing configuration.
  4. Permit only the required destinations and services in the firewall policy and leave the rest dropped.
  5. Check the routing table for a usable next hop to every registered network.
  6. Where counters or a capture are available, confirm that a request entering tap0 leaves through the interface that serves the target.

How does each device send its reply back through the gateway? #

A forwarded request is only half a session: the target compares your VPN source address with its own subnet, finds it foreign, and hands the reply to its default gateway, so that gateway must lead back to the ctrlX CORE or the reply dies as a timeout on your side.

With plain routed forwarding there is no translation, so the target sees the VPN client's address as the source. Decide by arithmetic. Take a Sercos drive at 172.31.254.10 with mask 255.255.255.0: the mask fixes the first three octets and varies the last, so the drive's local range is 172.31.254.0 through 172.31.254.255, 256 addresses. A remote client arriving with source address 100.107.2.14, an illustrative tunnel address, falls outside that range at the first octet; the drive classifies the request as foreign and hands the reply to its default gateway. If that gateway is unset or points away from the tunnel, the request still arrives but the session times out, which is the pattern behind the note on intermittent PLC programming access over VPN when ping works.

The fix on the routed branch is to point each target's segment back at the ctrlX CORE. In the documented setup the XM21 on the secondary machine network receives the ctrlX CORE's address on that network, 192.168.2.1, as its gateway, and the drive network behind the XM21 then reaches the tunnel through the XM21. Before changing any default gateway, note which existing machine-side communications depend on it. The same return-route rule is what the note on Omron CP1L UDP replies that need a valid IP return route demonstrates for UDP devices: a reply with no valid route is dropped no matter how cleanly the request arrived.

When should you use source NAT instead of changing device gateways? #

Use the Firewall app's source NAT when you cannot or should not touch device gateways: translation presents the traffic with a machine-side source address, so every target replies to the ctrlX CORE without any configuration change on the device.

Routed access keeps the target's view of the source address intact, which matters when device-side access lists or logs depend on real client addresses. Source NAT hides the remote client behind a machine-side address and removes the per-device gateway work, usually the choice when a production line cannot be re-gatewayed during a shift. Keep the two functions separate: source NAT repairs the reply path, while destination NAT or port forwarding selects an internal target for a published port. A forwarding rule by itself does not repair return routing, so check the actual translation rules instead of treating every NAT entry as interchangeable. On this setup both functions live in the same basic Firewall app, so the choice is configuration, not additional hardware.

Can device web pages be published without opening the VPN? #

Yes: forward each device's service port to a port on the ctrlX CORE and publish it as a service page, as the documented example does when it maps the XM21's web page on TCP 80 to ctrlX CORE port 8234 and an IP camera at 192.168.1.55 to port 8567.

The mapping is destination forwarding inside the same firewall: the ctrlX CORE listens on the chosen port and carries the session to the device's service port on its own segment. From the service list in the remote-access setup, the XM21 web portal and the camera page then open directly, with no tunnel connected. Choose ctrlX CORE ports that its own services do not already use, and read each device's live address, as the forwarding example does for the XM21's web port at 192.168.2.25, rather than one from a stale configuration view. One caution: every published port is reachable from the portal by whoever holds access to it, so keep the firewall policy limited to the devices and ports the remote team actually services.

What tests prove the path end to end? #

Test from the remote PC only after each target answers on its own segment: reach the device locally first, connect the VPN, repeat the identical request remotely, and confirm the reply arrives rather than just the request.

  1. Confirm local reachability on each segment: ping or open the target from its own machine-side network.
  2. Connect the VPN and repeat the identical request from the remote PC.
  3. If the request never arrives, recheck forwarding on tap0, the registered subnets and the firewall policy.
  4. If the request arrives but the session stalls, the reply path is broken: verify the target's gateway setting or the source NAT rule.
  5. Where counters or a capture exist, compare traffic leaving tap0 with traffic on the machine-facing interface to see which half of the path drops.

The decision, branch by branch: a target that answers locally but not remotely is missing forwarding, a registered subnet or a return path, in that order; a session that still stalls after all three are correct points at the translation rules, not at the VPN.

Questions asked

Can the remote session work from a corporate network behind a proxy?

On the client side, yes. Enter the proxy options in the VPN client's details under the fleet management tools, using the same proxy configuration that lets a ctrlX CORE virtual controller reach the internet, and start the proxy client before you connect. Test that proxy path first; if it works there, the corporate client works with it too.

What if one device shows two different addresses in the configuration?

Trust the address the device actually answers on. In the documented setup the XM21 appeared as 192.168.1.25 in one configuration view and as 192.168.2.25 in the port-forwarding view; the gateway setting and the forwarding rule must both use the live address on the segment they serve. Read it from the running device before writing either setting.

Do the default service pages need the VPN tunnel?

No. The landing page can point to the ctrlX Automation front page, a Node-RED dashboard or any device web page you register as a service. Those pages open through the published ports from the service list alone; the full LAN tunnel is needed only for programming, for browsing whole subnets or for devices that are not registered.

What gets restored on the devices if remote access is decommissioned?

Any gateway you changed. Devices left pointing at the ctrlX CORE keep sending their non-local traffic there after the remote service is gone, which can strand machine-side traffic that used to follow the original router. Record each original gateway before you change it and restore it when the remote-access setup is removed.

Keep reading

  • Explainer

    How a VPN gateway on a controller routes you to the machine LAN

    A VPN client on the machine-side gateway becomes a router to the machine LAN only when IP forwarding is enabled on both the tunnel and LAN interfaces, the server advertises the machine subnet and binds it to that client with iroute, and replies find a way back through the device gateway or an SNAT rule on the gateway. A worked packet example shows both directions.

    Remote access and virtualization

  • Explainer

    Device portal remote access versus VPN on a controller

    Device Portal remote access on a ctrlX controller reaches the controller web interface only, by design. Engineering tools that need direct access to devices on the machine subnet require a configured VPN: an OpenVPN routed tunnel with client-subnet routes, controller forwarding and a return path. Verify the route in layers before trusting the tool.

    Remote access and virtualization

  • Troubleshooting

    Fixing a VM remote PLC connection with a NAT adapter

    Set the guest's virtual adapter to NAT with DHCP, disable every other guest adapter, and keep the remote-access soft key on the host. The failure that repeats is a second bridged adapter pulling the PLC route away from the NAT path. Test the host path first, then the guest, and check that no local subnet matches the plant network.

    Remote access and virtualization