Troubleshooting
Fixing a VM remote PLC connection with a NAT adapter
Short answer
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.
On this page
- Why can't my VM reach a remote PLC while the host connection works?
- Should the remote-access key be installed on the host or in the guest?
- How do I set the guest adapter to NAT with DHCP?
- Why does a second bridged adapter break the connection?
- What if my local subnet matches the remote PLC subnet?
- How do I prove the path before writing to the PLC?
- When is the fault upstream of the guest?
- Questions asked
Open the guest's settings and set the virtual adapter's connection mode to NAT, then inside the guest open Control Panel > Network Connections, right-click the adapter, open Internet Protocol Version 4 (TCP/IPv4), and select obtain an IP address automatically and obtain DNS server address automatically. Disable every other guest adapter while you commission the path. A virtual machine reaches a remote PLC through the remote-access key installed on the host; the guest does not need its own key. The setup that fails most often leaves a bridged adapter enabled: it hands the guest a second route, the operating system sends the PLC traffic down that route, and the packets never enter the host's tunnel. If earlier experiments have left the virtual networks in an unknown state, reset them to their defaults and configure NAT last. This article gives the working adapter settings, the order of the tests, and the subnet-overlap check that explains the failures no adapter setting can repair.
Why can't my VM reach a remote PLC while the host connection works? #
The guest is sending its PLC traffic out an adapter whose route never enters the host's tunnel, and the fix is to make the NAT adapter the only enabled guest adapter, let DHCP configure it, and keep the tunnel on the host.
The tunnel terminates on the host, and NAT places the host's network stack between the guest and everything beyond it, so the guest's only job is to hand its traffic to the NAT adapter. A second enabled adapter, typically bridged to the physical LAN, gives the operating system two valid paths toward the same destination; vendor troubleshooting guidance for multi-adapter failures names asymmetric routing as the cause, meaning the system may choose a different interface than the one you expect, requests and replies leave by different paths, and stateful tunnels drop the session. The application never picks an adapter; the route table does, and the more specific or better-metric route wins.
If the guest runs but everything inside it is slow rather than unreachable, the fault is performance, not routing — fixing slow automation VMs on a Windows 11 host covers that case.
Should the remote-access key be installed on the host or in the guest? #
Keep the key on the host: with the guest adapter set to NAT, the host's tunnel already carries the guest's PLC traffic, and installing the key inside the guest would add a second tunnel and a second routing decision where only one is needed.
A soft key is software running on the host; a physical key left plugged into the host behaves the same at this layer. Either way the tunnel exists at host level, and the NAT adapter forwards guest traffic into it. The guest needs no key, no tunnel client and no plant-network addressing of its own.
Prove the host path before touching the VM:
- The host has a working connection to its own network.
- The remote-access connection shows connected in the key software.
- The PLC's configured IP address and subnet mask are written down from the project.
- From the host, a ping or status query to the PLC address succeeds.
If the last check fails, stop: fix the host path first, because no guest setting can repair a tunnel that is not carrying traffic.
How do I set the guest adapter to NAT with DHCP? #
Set the virtual adapter to NAT and let the guest operating system take its address by DHCP: DHCP then supplies the NAT subnet's address, mask and default gateway in one step, and the guest's default route points into the host.
- If earlier experiments have left the virtual networks unclear, reset them to their defaults in the platform's virtual network settings; note the old values first if other guests depend on custom networks.
- In the guest's settings, select NAT as the adapter's connection mode and connect the adapter.
- Inside the guest, open Control Panel > Network Connections, right-click the adapter, open Properties, then open Internet Protocol Version 4 (TCP/IPv4).
- Select obtain an IP address automatically and obtain DNS server address automatically, then close the dialogs.
- Run
ipconfig /alland confirm the adapter holds an address on the virtual NAT subnet with that subnet's gateway as the default gateway. - Repeat the PLC-address test from the guest.
An address beginning with 169.254 means DHCP never answered and the guest self-assigned a link-local fallback. Reset the virtual networks once more or restart the platform's NAT service; the walk-through of the DHCP bridged network failure fix for VMware Workstation Pro covers locating and restarting that service.
Do not type the plant's address range into the NAT adapter by hand: DHCP assigns a NAT-subnet address on purpose, and a copied plant address leaves the guest without a usable gateway.
Why does a second bridged adapter break the connection? #
A bridged adapter puts the guest directly on the physical LAN with its own gateway, so the route table now shows two ways toward the PLC network, and the operating system may pick the bridged one, which never enters the host's tunnel.
The route table, not the application, decides which adapter carries the packets. More-specific routes beat less-specific ones and the metric decides between equals, so a bridged adapter with an attractive route can pull PLC traffic away from a fully connected NAT path. Commission the tunnel with NAT alone:
- List every enabled adapter in the guest, including virtual adapters created by other networking software.
- Disable all of them except the NAT adapter.
- Check the selected route with
route print: the PLC address should follow the default route through the NAT gateway. - Repeat the PLC-address test.
- Re-enable other adapters one at a time, re-checking the route after each change, and leave anything you cannot justify disabled.
If a bridged adapter must stay up for other local work, pin the plant subnet to the NAT gateway with a specific route so the default route cannot pull that traffic away. A bridged guest that cannot reach anything by ping fails in its own documented pattern — troubleshooting a VMware bridged guest that cannot ping walks that case separately.
What if my local subnet matches the remote PLC subnet? #
The connection fails even though every setting above is right: when the PLC's address falls inside a subnet the host believes is directly attached, the operating system tries to deliver locally instead of sending packets into the tunnel, so matching ranges at both ends are fatal.
Record three ranges and compare them before changing anything else:
| Network | Record | Failure it produces |
|---|---|---|
| Host's physical LAN | host address and mask | host treats the plant subnet as on-link |
| Virtual NAT subnet | NAT range and guest address | guest treats the plant subnet as on-link |
| Plant network | PLC address and mask | the overlap itself, against either range above |
Worked example: an office host sits on 192.168.1.10 with mask 255.255.255.0 and the plant PLC is 192.168.1.20 with the same mask. The PLC's network address is 192.168.1.20 AND 255.255.255.0 — in the last octet, 20 AND 0 gives 0 — so the network is 192.168.1.0, usable addresses 192.168.1.1 through 192.168.1.254. The host's own interface computes to the same 192.168.1.0/24. The host therefore believes 192.168.1.20 is attached to the office switch, asks for it locally with ARP, and never hands the packet to the tunnel; any reply comes from whatever office device holds .20, or from nobody. The same trap applies one level down if the virtual NAT subnet is set to a range that matches the plant network.
Decision: change an address, because no adapter mode repairs matching subnets. Move the plant network to a range the office does not use; when only the NAT subnet overlaps, re-address the NAT network in the platform's virtual network settings instead. Keep the three ranges mutually exclusive.
How do I prove the path before writing to the PLC? #
Test upward through the path, host first, then guest, then software, and read before you write: a status query from the host, the same from the guest, the programming package online read-only, and only then a download, on a stopped machine.
- Host: ping the PLC address or open a status view to it, with the tunnel connected.
- Guest: repeat the same test from the guest on NAT.
- Software: connect the programming package to the PLC's configured address and open a read-only status view.
- Write: a download or mode change, only on a machine that is stopped.
Connect by address rather than a discovery list, because discovery traffic does not follow this path, so an empty discovery list is not evidence of a failed connection. A failed ping is not a verdict either: treat the read-only status query as the proof. One rule above all: never send a download or a mode change to a PLC that is running production — prove the path with reads, and write only to a stopped machine.
When is the fault upstream of the guest? #
When the host itself cannot reach the PLC with its tunnel connected, no guest setting will help: the plant-side gateway may be offline, the PLC powered down or re-addressed, or the tunnel never connected, so prove the path from the host before configuring anything in the VM.
Run the host test from the second section before any guest configuration for exactly this reason. If the host reaches the PLC but the guest still fails with NAT as the only enabled adapter, the remaining suspects are the route table and the subnet-overlap table above. If the host itself fails, work outward: the connection state in the key software, the plant-side gateway, the PLC's power and configured address. The remote-access gateway routes the plant's whole subnet, so once the host path passes, nothing at the plant needs per-device configuration for the guest.
The complete working arrangement, then: soft key connected on the host, guest adapter on NAT with DHCP, every other guest adapter disabled, no overlap between host LAN, NAT subnet and plant subnet, and the host path proven first. Each failure you will meet maps to exactly one of those five conditions.
Questions asked
Does a good ping prove the PLC programming connection works?
No. Ping proves only that the device answered ICMP. Some PLCs answer ping while blocking the programming service, and others drop ping by policy while serving it normally. After a successful ping, open the software's read-only status view to the PLC's configured address; that is the check that proves both the service port and the protocol path.
Can a physical USB key passed through to the guest replace the soft key on the host?
It can be made to work, but it buys nothing in this arrangement and restores the routing traps the NAT setup removes. A physical key left on the host behaves like the soft key: the NAT adapter already carries guest traffic through the host's tunnel. Passing the key into the guest moves the tunnel inside the machine and multiplies the route decisions that can go wrong.
Does anything need to change at the plant side?
No. The remote-access gateway at the plant routes its entire local subnet to an approved connection, so the guest needs no per-device configuration there. If the host reaches the PLC and the guest does not, the fault sits in your machine's routing — adapter mode, an extra adapter or an overlapping subnet — not at the plant.
Why does automatic discovery find nothing across the tunnel?
Discovery browsers send broadcast or multicast queries that stay on the local link, and a NAT boundary or tunnel does not carry them, so an empty list is normal and not a fault. Addressed traffic uses ordinary IP routing and crosses fine. Enter the PLC's IP address explicitly and ignore discovery whenever the path runs through NAT.
Do these settings transfer to other virtualization platforms?
The arrangement transfers even where the labels differ: every desktop platform offers a NAT-style network in which the host addresses and forwards for the guest. Choose the mode described as network address translation, keep exactly one adapter enabled, let DHCP configure the guest, and leave the tunnel on the host — the failure modes and fixes stay the same.