Call Us Today! 1.780.784.4444

Why OPC Connections Fail: DCOM, Firewalls, and Authentication

Why OPC Connections Fail: The Complete Guide to DCOM Errors, Firewall Blocks, and Authentication Issues

OPC Classic connections fail for three core reasons: DCOM is misconfigured, a firewall is blocking the required ports, or authentication between the client and server machine is rejected. Understanding which of these three root causes is responsible for a specific failure is the first and most important step, because the fixes for each are entirely different and applying the wrong fix wastes hours. This guide walks through all three failure categories in depth, explains the underlying mechanisms, and gives you a systematic diagnostic path from symptom to resolution.


Why OPC Classic Connections Are Fragile by Design

OPC Classic, which covers OPC Data Access (DA), OPC Historical Data Access (HDA), and OPC Alarms and Events (A&E), was built on Microsoft’s Distributed Component Object Model, commonly known as DCOM. DCOM was designed in the mid-1990s for enterprise Windows networks and was never intended for the long-term, machine-to-machine industrial communication patterns that became standard in manufacturing environments.

When an OPC client connects to an OPC server on a remote machine, it does not make a simple TCP connection to a fixed port. Instead, DCOM uses an endpoint mapper on port 135 to negotiate a dynamic high port, typically somewhere in the 49152 to 65535 range on modern Windows, and then establishes the actual connection on that dynamically assigned port. This dynamic port behavior is the single most common source of firewall-related OPC failures, because most network administrators configure firewalls based on known, fixed ports and have no visibility into what DCOM is negotiating.

On top of the networking complexity, DCOM enforces its own authentication and authorization layer using Windows security. Every remote DCOM call carries the credentials of the calling process, and the server machine decides whether those credentials are permitted to access the OPC server component. When the credentials are mismatched, expired, or absent, the connection is rejected with a security-related error code rather than a network error, which causes engineers to look in the wrong place.

Understanding these two layers, network and security, as distinct systems is essential before you start troubleshooting.


DCOM Errors: What They Mean and Where They Come From

DCOM errors are reported as hexadecimal error codes in Windows. They appear in the OPC client’s error output, in the Windows Event Log under System and Application sources, and in DCOM-specific entries under the DCOM configuration logs. The most commonly encountered codes in OPC environments are the following.

0x800706BA: The RPC server is unavailable. This is the most frequent OPC connection failure message. It means the client could not reach the DCOM endpoint mapper on port 135 of the target machine, or the OPC server’s registered DCOM component could not be instantiated. This is almost always a network or firewall issue, not a software fault. Start by verifying basic TCP/IP connectivity to port 135 on the server machine before changing any DCOM settings.

0x80070005: Access is denied. This error means the connection reached the target machine but was rejected at the security layer. The client’s credentials were either not recognized, or the DCOM application permissions on the server do not grant the calling user or group the right to launch or access the OPC server component. This is an authentication and authorization issue, not a network issue.

0x800706D9: There are no more endpoints available from the endpoint mapper. The DCOM endpoint mapper on port 135 was reached, but no available dynamic port could be assigned. This can indicate that the dynamic port range is too narrow, that all available ports are in use, or that the dynamic port range assigned in Windows does not match what the firewall permits through.

0x80040154: Class not registered. The OPC server’s COM component is not registered on the target machine. This can happen after an incomplete installation, after a registry cleanup, or after a Windows update that removed a dependent component. Re-registering the OPC server or reinstalling it is the appropriate response.

0x8000FFFF: Catastrophic failure. Rare but occasionally reported in DCOM contexts. Usually indicates a deeper system-level problem, such as insufficient memory, a corrupt COM registration database, or a security configuration that is preventing COM from functioning at all.

Practical step: Before modifying any DCOM settings through the Component Services console (dcomcnfg), check the Windows Event Viewer on the server machine. DCOM logs access denials and launch failures under the System log with source “DCOM.” These event entries often name the specific application ID (AppID) that failed and the user account that was denied, which tells you exactly what to fix.


How DCOM Configuration Errors Block OPC Communication

The Windows Component Services console exposes DCOM configuration through three levels: machine-wide default settings, application-specific settings for each registered COM server, and identity settings that control which Windows account the COM server runs under.

The most common DCOM configuration mistakes that break OPC communication are the following.

Authentication level set too high at the machine or application level. If the client machine and server machine are set to different DCOM authentication levels, the connection will fail with an access denied error even if the credentials are valid. Both machines must agree on a compatible authentication level. The setting is found under Default Properties in the Component Services console. For OPC environments, “Connect” is typically the minimum required setting.

Launch and activation permissions do not include the connecting user. DCOM requires explicit permission to launch a COM server remotely and to activate it after launch. These are separate permissions. If the account running the OPC client is not listed in the Launch and Activation Permissions of the OPC server’s AppID, the connection will fail at startup. This setting is configured per application in Component Services.

Access permissions are too restrictive. Even after a successful launch and activation, the client must have Access Permission to call into the running COM server. Missing access permission produces an 0x80070005 error after what appears to be a partially successful connection.

The OPC server runs under a restricted identity. If the OPC server’s DCOM identity is set to “The interactive user,” it will fail to start when no user is logged into the server machine, which is the normal state for an industrial PC running unattended. Set the identity to a specific named account or to “The launching user” with appropriate permissions.

Practical step: Use the OPCEnum service as a diagnostic check. If you can browse OPC servers on the remote machine using OPCEnum and an OPC client’s browse dialog, DCOM connectivity and basic authentication are functioning. If OPCEnum itself fails, the problem is at the DCOM infrastructure level, not at the specific OPC server.


Firewall Blocks: The Most Misdiagnosed Category of OPC Failures

Firewall-related OPC failures are the most commonly misdiagnosed category because the error messages they produce look identical to DCOM configuration errors. An 0x800706BA error caused by a blocked firewall looks the same as one caused by a stopped service or an unreachable machine.

The reason firewalls block OPC Classic communication so reliably is the dynamic port behavior described earlier. DCOM first contacts port 135 to register the session with the endpoint mapper, then negotiates a randomly assigned high port for the actual data transfer. Most enterprise firewalls pass port 135 but block all or most of the dynamic port range, which means the initial handshake appears to succeed but the data channel never opens.

Restricting the dynamic port range. The standard fix for firewall-blocked OPC Classic traffic is to restrict the DCOM dynamic port range to a defined subset and then open only that subset in the firewall. On Windows Vista and later, this is done with the netsh command:

netsh int ipv4 set dynamicport tcp start=49320 num=200
netsh int ipv4 set dynamicport udp start=49320 num=200

This example restricts dynamic ports to the range 49320 to 49519. The firewall then needs rules to pass TCP and UDP traffic on this range between the client and server machines. After making this change, reboot the machine and verify the range is applied before testing OPC connectivity.

Windows Firewall versus network firewall. Both can block OPC traffic independently. A common scenario is that the Windows Firewall on the server machine is correctly configured but a network switch or perimeter firewall between the client and server is not. Test from the same machine as the OPC server first to rule out network infrastructure, then test across the network boundary.

Port 135 being blocked. If port 135 itself is blocked, no DCOM communication is possible. Verify port 135 is reachable using PowerShell’s Test-NetConnection command:

Test-NetConnection -ComputerName <server_ip> -Port 135

If this fails, the blocking is at the network layer, not in DCOM configuration.

OPC UA as the alternative. OPC UA was specifically designed to eliminate this firewall problem. OPC UA uses a single, configurable TCP port, typically 4840 by default, and does not use DCOM at all. Organizations with strict network segmentation between IT and OT often find that switching to OPC UA or tunneling OPC Classic over OPC UA eliminates the entire category of firewall-related failures.

OPC Expert’s OPC Tunneler addresses this directly by wrapping OPC Classic communication inside an OPC UA transport, eliminating DCOM entirely and reducing the firewall requirement to a single port. This is particularly useful in environments where DCOM ports cannot be opened due to security policy or where the network team does not have bandwidth to implement dynamic port rules.


Authentication and Authorization Failures in OPC Classic

Authentication failures in OPC environments almost always trace to one of three sources: mismatched Windows accounts, Kerberos vs. NTLM negotiation problems, or domain trust issues between the client and server machines.

Workgroup machines and the null session problem. When an OPC client and OPC server are both in Windows workgroups rather than in a domain, DCOM cannot rely on Active Directory to validate credentials. Instead, matching local accounts with identical usernames and passwords must exist on both machines. If the passwords drift or the accounts do not exist, DCOM falls back to a null session, which is rejected on modern Windows versions by default. Create matching local accounts on both machines and ensure the OPC server’s DCOM permissions explicitly grant access to that account.

Domain machines with one-way trust or no trust. If the client machine and server machine are in different Active Directory domains without a bidirectional trust relationship, Kerberos authentication will fail and DCOM will attempt NTLM fallback. NTLM is disabled on some hardened Windows configurations. Verify that the domain trust covers both directions, or configure the DCOM authentication level to use a specific account that exists in both domains.

The DCOM impersonation level. DCOM clients pass credentials to servers using an impersonation token. If the impersonation level is set to “Anonymous,” the server receives no credentials and will deny access. OPC clients typically need “Identify” or “Impersonate” level. This is configured on the client side in Component Services under the Default COM Security properties.

Service account running the OPC client. In SCADA environments, the OPC client is often a service running under a local system account or a specific service account. Local system accounts on different machines are not the same identity, so a client service running as “Local System” on machine A is entirely unrecognized by machine B. Use a named domain service account that has been explicitly granted DCOM launch, activation, and access permissions on the server.

Practical step: Enable DCOM audit logging on the server machine to capture failed authentication attempts. In the Local Security Policy, enable “Audit object access” and “Audit logon events.” This produces log entries that identify the specific account that was rejected and the reason, which is far more useful than the generic error codes returned to the client.


Edge Cases That Catch Experienced Engineers Off Guard

Even with correct DCOM settings and open firewalls, several edge cases produce OPC connection failures that are difficult to attribute.

Third-party antivirus and endpoint protection. Security software running on the server machine frequently intercepts DCOM traffic, COM instantiation requests, or network connections on dynamic ports. The behavior is indistinguishable from a firewall block. If connectivity works when endpoint protection is temporarily disabled, add explicit exclusions for the OPC server executable, the DCOM port range, and port 135 to the security software policy before re-enabling it.

Windows updates resetting DCOM permissions. Some cumulative Windows updates, particularly those addressing DCOM hardening vulnerabilities, reset machine-wide DCOM authentication settings or tighten COM security defaults. Microsoft released a series of DCOM hardening updates in 2021 and 2022 specifically related to DCOM authentication enforcement (CVE-2021-26414). If OPC connections that were working break after a patch cycle, check the Windows Update history and review any DCOM-related registry changes the update may have applied.

OPC server not registered as a 32-bit or 64-bit COM component correctly. On 64-bit Windows, 32-bit OPC servers must be registered in the 32-bit COM registry hive (HKLM\Software\WOW6432Node). If a 32-bit OPC server is registered in the 64-bit hive, remote clients cannot find it. Use the correct version of regsvr32, the 32-bit version located in C:\Windows\SysWOW64, to register 32-bit COM components.

MTU and packet fragmentation on industrial networks. Some industrial network switches and VLAN configurations have MTU settings lower than the default 1500 bytes. DCOM packets that exceed the MTU are fragmented, and some switch configurations drop fragmented packets. This produces intermittent OPC failures that appear as connection drops rather than initial connection failures. OPC Expert’s Network Monitoring tool diagnoses this by testing UDP packet delivery at varying sizes, identifying the exact threshold at which packets begin to fail.

Time synchronization drift. Kerberos authentication, which is the default on Windows domain networks, requires that the client and server system clocks agree within five minutes. If an industrial PC’s clock drifts due to a dead CMOS battery or misconfigured NTP, Kerberos tickets are rejected and DCOM falls back to NTLM or fails entirely. On domain machines, verify time synchronization is functioning with the following command:

w32tm /query /status

Using OPC Expert to Accelerate the Diagnosis

OPC Expert’s Troubleshooting OPC and DCOM module addresses each of these failure categories directly. Rather than returning raw Windows error codes, it translates DCOM error responses into plain-language descriptions of the probable cause and a numbered sequence of steps to resolve it. It includes specific knowledge of error patterns from major OPC server vendors including Rockwell and Siemens, so the guidance is tailored to the actual server in use rather than generic.

The OPC Snapshot feature captures all relevant system settings, DCOM configuration, OPC server registrations, and network state into a single report, which eliminates the manual documentation step when escalating to a vendor or consultant. The Watchdog function can monitor a specific OPC connection and automatically trigger a script, send an email, or reconnect when a drop is detected, providing a bridge between diagnosis and operational continuity while a permanent fix is implemented.

For environments where DCOM complexity is simply too high to manage reliably, particularly across IT/OT network boundaries, OPC Expert’s OPC Tunneler replaces the entire DCOM communication channel with a single-port OPC UA transport, eliminating the firewall and dynamic port problem entirely.


Summary

  • OPC Classic connection failures trace to three distinct root causes: DCOM misconfiguration, firewall blocks on dynamic ports, and authentication or authorization rejection. Identify which category applies before making any changes.
  • Error code 0x800706BA almost always indicates a network or firewall problem. Error code 0x80070005 almost always indicates an authentication or permissions problem.
  • DCOM uses a dynamic high port range negotiated through port 135. Restricting this range with netsh and opening only that range in the firewall is the standard fix for firewall-blocked OPC traffic.
  • Workgroup machines require matching local accounts with identical passwords on both client and server. Domain machines require bidirectional trust and a service account with explicit DCOM permissions.
  • Windows updates, antivirus software, MTU mismatches, and clock drift are the edge cases most likely to break connections that were previously working.
  • OPC UA eliminates DCOM entirely and reduces the firewall requirement to a single port, making it the long-term architectural solution for environments where DCOM complexity is unmanageable.