Troubleshooting
Ping works but PLC program download fails over remote access
Short answer
ICMP success proves only the routed IP path, not the programming session. A download opens separate query and download connections on documented TCP and UDP ports, and broadcast discovery does not cross a routed VPN. Point the controller's default gateway at the remote-access router LAN address, permit both programming ports to the controller LAN IP, and add the controller manually by IP.
On this page
- Why does ping work when the program download fails?
- Which ports does a PLC programming session open?
- Should the controller's gateway point at the remote-access router?
- Why does the network scan find nothing over the VPN?
- How do I test the programming ports from my PC?
- What do I change to make the download go through?
- How do I confirm the fix before the real download?
- Questions asked
A controller that answers ping but refuses a program download across a remote-access router has a working IP path and a broken programming session. ICMP echo proves reachability and nothing more. The download opens separate query and download connections on documented TCP or UDP ports and needs a return route from the controller to your VPN subnet, and a network scan needs broadcasts that a routed tunnel never carries. Fix it in three moves: set the controller's default gateway to the remote-access router's LAN address, permit the documented programming ports to the controller's LAN IP, and add the controller manually by IP instead of scanning. Work the checks in the order below and stop at the first branch that fails.
Why does ping work when the program download fails? #
Ping uses ICMP echo, which needs no listening service on the controller; a program download opens separate query and download connections on documented TCP or UDP ports, so a path that forwards ICMP but blocks those ports passes every ping and drops every download.
ICMP echo is a network-layer exchange: an address that routes and a reply that finds its way back. A programming session is application-layer: the engineering software opens its own connections to the runtime, each on a port the controller vendor documents. A remote-access router that forwards ICMP but not those ports produces exactly this symptom: every ping replies, every login or download times out.
Three independent causes give the same picture, so check them in this order:
- Read the controller's IP address, subnet mask and default gateway, and the router's LAN address and mask.
- Fix the return path: set the controller's gateway to the router's LAN IP unless the router source-NATs your session.
- Read the vendor's documented port list for your controller and firmware release, and open both the query and the download port to the controller's LAN address.
- Test every TCP port from the engineering PC over the tunnel.
- Enter the controller manually by IP in the programming software; do not scan.
Ping also misleads in both directions. Some display terminals ignore ping entirely until their ICMP responder is enabled, so a silent device is not always a dead device — the fix is documented for a terminal that ignores ping until its ICMP responder is enabled. And a peer that passes ICMP can still be unreachable for its real protocol, which is why peer checks belong beyond echo: checking a peer with more than an ICMP ping.
Which ports does a PLC programming session open? #
A programming session opens its own connections on documented ports on top of ping — Siemens S7-class programming uses TCP 102, EtherNet/IP runtime uses TCP 44818 with UDP 2222 and UDP 44818, and a C-more project transfer uses TCP 9999 — so open the exact set your vendor documents, query and download alike.
Vendors publish these splits because every firewall between you and the machine needs them. The table collects documented examples; the list for your controller and firmware release is the one to apply.
| Controller family | Service | Documented ports |
|---|---|---|
| Siemens S7-class | Programming communication (vendor manual) | TCP 102, inbound and outbound |
| EtherNet/IP | Runtime messaging (vendor static port reference) | TCP 44818, UDP 2222, UDP 44818 |
| AutomationDirect C-more | Project transfer, programming over Ethernet (vendor help) | TCP 9999 |
| B&R Automation Studio | Engineering connection (user-collected list, verify against your release) | TCP 11169 |
Where the list splits identification and transfer onto separate ports, both must be open. A rule that passes only the query port lets the software find and identify the controller, then stalls the transfer — a half-working session that looks exactly like a dead one. If the list names UDP ports beside the TCP ones, the UDP entries need the same treatment: a firewall that forwards TCP 44818 but drops UDP 2222 passes every TCP test and still fails an EtherNet/IP session.
Read the numbers from the vendor's reference for your firmware, not from memory; the split between a query port and a download port is vendor- and release-specific.
Should the controller's gateway point at the remote-access router? #
Yes — unless the remote-access router source-NATs traffic to its own LAN address, the controller's default gateway must be the router's LAN IP (192.168.1.1 in the example below); set it even when NAT makes the link work, because the explicit route removes the NAT dependency.
The gateway is the controller's return path. When your engineering PC sits on a VPN subnet, the controller must hand its replies to a router, and the only router it knows is the default gateway field.
Worked example. The controller sits at 192.168.1.50 with mask 255.255.255.0, the remote-access router's LAN address is 192.168.1.1, and your engineering PC holds 10.10.10.25 over the tunnel. The controller tests your address against its mask: 192.168.1.50 AND 255.255.255.0 = 192.168.1.0, and 10.10.10.25 AND 255.255.255.0 = 10.10.10.0. The network parts differ, so your traffic is not local and every reply must go to the default gateway. With that field empty, the controller has no route to 10.10.10.0 and drops the reply.
Ping can still succeed in that state, but only because the router source-NATs your session to its own LAN address, which makes the source look local. That NAT success proves nothing about the return path: the moment NAT mode changes, the link dies with it. Set the gateway to 192.168.1.1 regardless; the explicit route removes the dependency.
The same return-path rule decides VM-based tunnels, where a NAT-mode adapter on the hypervisor masquerades the guest exactly as a site router does — see Fixing a VM remote PLC connection with a NAT adapter.
Why does the network scan find nothing over the VPN? #
Discovery is broadcast traffic, and a routed VPN tunnel does not carry broadcasts — an empty scan over the link is the expected result, not proof the controller is down, so enter the controller's LAN IP manually in the programming software's gateway configuration.
Some tools can never work over this link at all: they reach their devices by local broadcast only, so no amount of port forwarding makes them usable across a router — the limit documented for broadcast-only configuration tools that never cross a router.
The working method is manual entry:
- In the programming software's gateway or path configuration, add the controller by its LAN IP address (192.168.1.50 in this article's example).
- Connect and confirm the device reports online with its node name before attempting login or download.
- If the manual entry fails while every TCP port passed the tests below, check that the query and download connections target the same IP — a second translated address in the middle breaks the session — and that the list's UDP ports are permitted.
How do I test the programming ports from my PC? #
With the tunnel up, run Test-NetConnection 192.168.1.50 -Port 102 from the engineering PC and repeat it for every TCP port on the vendor list; TcpTestSucceeded : True on each proves the TCP path end to end.
Test-NetConnection is built into Windows PowerShell and reports one TCP port per call:
Test-NetConnection 192.168.1.50 -Port 102
Read the TcpTestSucceeded value from the output:
- True on every listed TCP port: the TCP path is open end to end; move on to UDP verification.
- False on one port: that port is blocked or not forwarded on the router, or the controller-side service is disabled; fix the rule and retest before moving on.
- False on all ports while ping replies: the router is passing ICMP only; review its forwarding and firewall rules for the controller LAN device.
Test-NetConnection covers TCP only. Verify a UDP port with a packet capture on the PC's VPN adapter — the unanswered query frame names the blocked port — or by the download attempt itself. A full TCP pass is not proof of a UDP-dependent session.
What do I change to make the download go through? #
Apply three settings in order: the controller's default gateway to 192.168.1.1, router rules that pass the documented query and download ports to 192.168.1.50, and a manual controller entry at 192.168.1.50 — then reconnect the tunnel and retest every TCP port before logging in.
In steps:
- Set the controller's default gateway to the router's LAN IP, write the network configuration to the controller, and read it back to confirm the new value.
- On the router, define the controller's LAN address as a reachable device and permit the documented query and download ports to it — forwarding or firewall rule, TCP and UDP exactly as the list states — then save and apply the configuration.
- Reconnect the tunnel and repeat the TCP tests until every port returns True.
- Add the controller manually by IP in the programming software and confirm the online state.
- Log in and transfer a small test change first.
Make these changes only after the checks above name the failing branch: forwarding ports cannot rescue a missing return route, and a gateway change cannot open a blocked port.
How do I confirm the fix before the real download? #
Acceptance is four readings: ping to both 192.168.1.1 and 192.168.1.50 replies over the tunnel, every documented TCP port returns True, the manually entered controller reports online without a timeout, and a small test project transfers and reads back.
- Ping the router LAN address and the controller address from the engineering PC over the tunnel; both reply.
- Every TCP port on the vendor list returns True.
- The manually entered controller comes online without a communication timeout.
- A small test project transfers, and the online view reads back the new application.
Only after all four readings pass, transfer the production program. A download replaces the code the machine is running — schedule it for a planned stop, not a live process.
Close the openings when the session ends: bind the port rules to the tunnel's lifetime and restrict their source to the VPN address range, and keep the layered controls on the path in place — the standing case for why layered OT security controls protect a network path.
Questions asked
Why did ping work for months with an empty gateway field?
Because the router source-NATs your session: the controller sees the router's own LAN address as the source, treats the traffic as local, and replies without consulting a gateway. The link keeps working until NAT is disabled, the router is replaced, or a second routed subnet appears, and then the missing return path surfaces as a dead download.
Can a duplicate IP address cause download failures that pass every port test?
Yes. Two devices sharing the controller's address answer ping intermittently as ARP entries flip between them, and the session then opens against the wrong one and stalls. Check the ARP table on the router, disconnect one suspect device at a time, and make sure every device on the controller LAN holds a unique address.
Should the programming ports stay forwarded between remote sessions?
No. Forward them for the session only, restrict the source to the VPN address range, and remove or disable the rules when the window closes. A runtime port that answers the public internet around the clock is a standing path into the controller, and automated scans against well-known ports never stop.
Do I open the ports on the router, on the controller, or both?
Wherever the block sits. A False on one TCP port means something between the PC and the runtime refuses that port: the router's forwarding, a controller-side firewall, or a disabled service. Open it where you can verify the result, usually the router first, then retest; a False that survives a correct router rule points to the controller side.