Configuring S7-300 CP 343-1 Advanced for Remote Internet Access

David Krause19 min read
S7-300SiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Remote access to a SIMATIC S7-300 station that sits behind a consumer-grade DSL connection is a recurring requirement in service, retrofit, and field-engineering scenarios. A CP 343-1 Advanced IT attached to a CPU 315-2 DP exposes a full PROFINET stack on the LAN side, but the WAN side is typically nothing more than a single dynamic public IP address. This reference walks through the two production-grade options for reaching a remote S7-300 over the public Internet — an IPsec/OpenVPN tunnel and a port-forwarded DSL router — and the exact STEP 7 V5.x parameter set required on the CP 343-1 Advanced to make S7 communication, PG routing, and DB read/write work in both topologies. The official Siemens procedure is documented in Siemens Support Entry 26662448.

Problem Definition

When a STEP 7 project runs in the office, the engineer selects "Accessible Nodes", opens a Variable Table (VAT), or uses "Online → Monitor/Modify", and the SIMATIC programming device uses the local subnet (e.g., 192.168.100.0/24) to reach the CP 343-1 Advanced and through it the CPU 315-2 DP. Once the station is deployed at a remote site that only has an Internet connection with a dynamic public IP, the same workflow fails: the local IP of the CP (192.168.100.x) is not routable from the office, and the public address of the DSL router (e.g., 90.45.5.34) is not what STEP 7 expects in the project file.

Two distinct operations need to be solved, both carried over the same S7 protocol on TCP/102:

  1. Read/write data blocks remotely for diagnostics, setpoint adjustment, and ad-hoc commissioning support.
  2. Download a STEP 7 project to the CPU when the field is unreachable physically.

The CP 343-1 Advanced terminates TCP/102 on its PROFINET port and forwards S7 PDUs to the backplane bus toward the CPU 315-2 DP. The challenge is therefore to make TCP/102 between the office STEP 7 PC and the remote CP 343-1 actually traverse the Internet.

Prerequisites

Item Specification Notes
CPU SIMATIC S7-300 CPU 315-2 DP (e.g., 6ES7315-2AH14-0AB0) Backplane communication between CPU and CP via S7 connection
Communication Processor SIMATIC NET CP 343-1 Advanced IT (6GK7343-1GX11-0XE0 or 6GK7343-1GX30-0XE0) IT variant provides web/FTP/e-mail; both support S7 communication and "Use Router" feature
Engineering tool STEP 7 V5.5 SP4 / V5.6 with NCM S7 Industrial Ethernet TIA Portal works against S7-300 via a non-integrated project, but PG routing is configured in HW Config the same way
Remote site router DSL/cable router with VPN server (IPsec or OpenVPN) or port-forwarding capability Must support NAT loopback if office and site share the same public IP range
Public addressing Static public IP or DynDNS / No-IP / similar dynamic DNS service CP 343-1 itself does not need DynDNS — only the office STEP 7 PC needs to resolve the public IP
Firewall / security Dedicated hardware firewall strongly recommended when using port forwarding See Siemens Support Entry 26662448
S7 firmware match CPU 315-2 DP firmware ≥ V2.6 recommended; CP 343-1 Advanced firmware ≥ V3.x recommended Older firmware variants lack S7 routing improvements and some keep-alive options

Network Architecture

The reference topology has two private LAN segments separated by the public Internet. On the site side the CP 343-1 Advanced holds the only routable target, and the DSL router performs the WAN-to-LAN translation. On the office side, the STEP 7 PC is the only initiator of S7 traffic.

Office LAN — 192.168.0.0/24 STEP 7 V5.6 .0.50 / TCP/102 Office Router VPN client / GW PG routing path (Option A — VPN) 1. STEP 7 → TCP/102 → Office Router 2. Encapsulated in IPsec/OpenVPN 3. Tunnel terminates at site DSL router 4. Decapsulated to 192.168.100.10:102 INTERNET + DynDNS Site LAN — 192.168.100.0/24 DSL Router Public: 90.45.5.34 CP 343-1 .100.10:102 CPU 315-2 DP .100.20 (rack 0 / slot 2)

Figure 1 — S7-300 remote access topology. The DSL router's external interface holds the public IP (resolved via DynDNS from the office); the CP 343-1 sits on the private site LAN with a fixed IP. The optional VPN tunnel terminates at the DSL router and bridges both LANs.

Security Considerations

WARNING — Direct port forwarding to TCP/102 exposes the S7-300 to Internet-wide scanning. Public services such as Shodan, Censys, and dedicated ICS scanners actively probe TCP/102 across the entire IPv4 address space. A CP 343-1 Advanced with the "Use Router" option and an open port-forward to TCP/102 can be discovered, fingerprinted, and subjected to TIA-portal-style replay or stop-CPU attacks. Siemens Support Entry 26662448 explicitly recommends a VPN tunnel or, at minimum, a separate hardware firewall in front of the DSL router.

Choose the access method using the decision matrix below.

Criterion VPN Tunnel (IPsec / OpenVPN) DSL Port Forwarding + DynDNS
Security Strong — traffic is encrypted and authenticated; PLC is invisible to the public Internet Weak — TCP/102 is exposed; requires separate firewall with strict source-IP filtering
Setup complexity Higher — certificates or pre-shared keys, NAT traversal, sometimes DDNS at the router Lowest — a single port-forward rule on the DSL router
Scalability Full — multiple CPs and PROFINET devices reachable across the same tunnel Limited — one S7 station per public IP per forward; additional stations need either extra ports or a 1:1 NAT (often unavailable on consumer DSL)
Bandwidth overhead Modest — IPsec adds ~10–15 % overhead; OpenVPN roughly double None
Recommended use Project download, FB upload, persistent remote maintenance Read-only DB monitoring, occasional parameter tweaks, lab/demo

CP 343-1 Advanced IT — Relevant Capabilities

The CP 343-1 Advanced IT (6GK7343-1GX11-0XE0 / -1GX30-0XE0) is the top-of-line S7-300 communications processor. The "IT" suffix denotes features beyond plain S7 communication that are relevant to remote maintenance scenarios.

Feature Use for Remote Access Configuration Path
S7 communication (PUT/GET, USEND/URCV, BSEND/BRCV) Direct DB read/write from another S7 station or OPC server CP properties → S7 connection list
PG / OP communication Allows STEP 7 to download programs and access the CPU CP properties → Access → PG/OP
S7 routing (PROFINET ↔ backplane) Lets a STEP 7 PC reach the CPU through the CP even when only the CP's IP is routable CP properties → "S7 routing" = enabled
Integrated 2-port switch (variants with 2 RJ45) Daisy-chaining a second CP or an HMI panel without extra hardware Hardware; no parameter required
Web server + custom AWP HTML pages Read/write DBs from a browser without STEP 7 CP properties → Web; AWP tag syntax in HTML
FTP server / client Upload firmware, download log files, push AWP pages to the CP CP properties → FTP
SMTP e-mail client Alarms / diagnostic buffer events sent to a mailbox CP properties → E-mail
NTP / SIMATIC time-of-day synchronization Maintain a consistent timestamp on the CPU for diagnostic correlation CP properties → Time synchronization
IP access list (firewall on the CP) Restrict which source IPs may open S7 connections CP properties → Security → IP access list
SNMP / PROFINET diagnostics Network management integration CP properties → SNMP

For remote-maintenance scenarios the IP access list is the most under-used feature. It lives on the CP itself and can be configured to accept S7 connections only from a specific office public IP, even when the DSL router's port forward is open. Combine it with the DSL router's source-IP filter for defence in depth.

Option A — VPN Tunnel (Recommended)

A VPN makes the remote site appear as another subnet on the office LAN. STEP 7 then uses the CP's private IP (192.168.100.10) just as it would locally, and the public address is never referenced in the project.

  1. Choose the VPN technology. Most enterprise firewalls (Cisco ASA, Fortigate, Sophos, pfSense) and prosumer routers (Mikrotik, Ubiquiti) support IPsec IKEv2 with PSK or X.509 certificates. OpenVPN on a small Linux box or a Mikrotik is also common.
  2. Configure the site DSL router as the VPN endpoint. Define a virtual IP pool (e.g., 10.10.10.0/24) for the office clients and add a static route for 192.168.100.0/24 via the tunnel.
  3. Configure the office router/PC as the VPN client. After the tunnel comes up, ping the CP 343-1 at 192.168.100.10 — the response confirms bidirectional routing.
  4. Open STEP 7 → Options → Set PG/PC Interface and select the TCP/IP <network adapter> access point bound to the S7ONLINE application. The VPN's virtual TAP/Win driver is selected automatically if it is the default route.
  5. Open the STEP 7 project, PLC → Accessible Nodes. The CP 343-1 and CPU 315-2 DP appear with their private IP 192.168.100.x. Proceed to "Monitor/Modify", open a VAT, or "Download" as if on site.

No change to the CP 343-1 IP configuration is required. The "Use Router" field is not strictly needed for VPN-based access because every packet the office PC sends to 192.168.100.10 is delivered to the CP via the tunnel endpoint, which is itself in the same 192.168.100.0/24 subnet or has a direct route to it. Leave it set defensively in case the CP needs to call out to an NTP server or an e-mail receiver on the office side.

Option B — DSL Port Forwarding with DynDNS

When VPN is not available, a single S7 station can be reached by forwarding one TCP port on the DSL router to the CP 343-1. The CP must know the address of the DSL router as its default gateway so that any S7 reply packet to the office PC is sent out through the router's WAN interface.

  1. Set up DynDNS on the DSL router (e.g., myplant.dyndns.org → current public IP 90.45.5.34). The CP 343-1 itself does not need a DynDNS client — the router updates the hostname. Most consumer routers integrate with No-IP, DynDNS, or a generic custom provider; configure update interval ≤ 60 s.
  2. Create a port-forward rule on the DSL router: WAN: TCP/102 → 192.168.100.10:102. Disable any "SPI" or "WAN ping" features that are not strictly required, and do not forward UDP/102 — S7 over ISO-on-TCP uses TCP only.
  3. Configure a firewall rule that allows TCP/102 from the office public IP only. Do not leave TCP/102 open to 0.0.0.0/0. If the office has a dynamic public IP, whitelist the upstream ISP range (CIDR block) and refresh quarterly.
  4. Configure the CP 343-1 with the "Use Router" option pointing to 192.168.100.1, the DSL router's LAN-side address. The full parameter set is in the next section.
  5. Enable S7 routing on the CP 343-1 (HW Config → CP properties → "S7 routing" checkbox). This is what allows STEP 7 to reach the CPU 315-2 DP behind the CP.
  6. In STEP 7, point the S7ONLINE access point at the DynDNS hostname: myplant.dyndns.org as the target address. Do not change the CP's IP in HW Config — the CP itself keeps 192.168.100.10 in the project.
  7. Run PLC → Accessible Nodes. STEP 7 issues an S7 connection attempt to myplant.dyndns.org:102; the DSL router translates the destination to 192.168.100.10:102, the CP answers, and the connection establishes.
Limitation. Port forwarding to TCP/102 only allows one CP per public IP. Adding a second CP requires either a second public IP (rare on DSL), a 1:1 NAT (typically not supported on consumer hardware), or a second forwarded port (e.g., 102 → CP1, 1102 → CP2) combined with address translation on the router. With a 1:1 NAT you can put the entire 192.168.100.0/24 behind a single public IP, but most DSL routers do not support that. Use a VPN instead.

CP 343-1 Advanced Configuration in STEP 7

Open the STEP 7 project, expand the S7-300 station in SIMATIC Manager, and double-click the CP 343-1 in HW Config. The parameters below must be set in Properties → Interface → Ethernet. Apply the same values via NCM S7 Industrial Ethernet / "Ethernet (CP 343-1 IT)" if the project uses a separate PC station.

Parameter Port-Forwarding Topology VPN Topology Comment
IP address 192.168.100.10 192.168.100.10 Always private. Never overwrite with the public IP.
Subnet mask 255.255.255.0 255.255.255.0 Matches the site LAN.
"Use IP router" / "Use Router" ✓ enabled ✓ enabled (defensive) Tells the CP that addresses outside 192.168.100.0/24 are reached via the router.
Router address 192.168.100.1 192.168.100.1 DSL router's LAN IP. Leave blank only if the CP will never originate traffic to other subnets.
Activate S7 communication ✓ ✓ Required for S7 functions: PUT/GET, USEND/URCV, BSEND/BRCV.
PG communication (PG mode) ✓ "All" ✓ "All" Restrict to specific PG MAC if multiple engineers will be online simultaneously.
OP communication ✓ if HMI panels also talk to this CP ✓ Not required for pure DB read/write from STEP 7.
PUT/GET access ✓ enabled for remote DB access ✓ Without this, FC/FB PUT/GET from another S7 station or OPC server is denied.
S7 routing ✓ enabled ✓ enabled Routes S7 PDUs between PROFINET and the backplane so STEP 7 can reach the CPU through the CP.
Web server optional — useful for read-only diagnostics optional Bind a custom HTML page to a DB for browser-based DB read-only access.
Access protection (password list) Configure a separate user with PG right Configure a separate user with PG right Empty password is acceptable only on isolated VPN segments.
IP access list (Security) Allow only the office public IP Allow the office VPN virtual IP range CP-level firewall that blocks S7 connection attempts from any other source.

For Option B, the "Use Router" field is what makes the difference: when the office PC sends an S7 PDU to 90.45.5.34:102, the packet reaches the CP 343-1 with a destination IP of 192.168.100.10 after the DSL router's NAT. The S7 PDU from the CP back to the office PC must be sent to a source IP that will be accepted by the DSL router's NAT, which means the CP must reply to the office public IP. Since that IP is not in 192.168.100.0/24, the CP uses the configured router (192.168.100.1) as the next hop. If "Use Router" is empty, the CP drops the reply or sends it with no L3 next hop and the connection times out at the STEP 7 side — exactly the symptom described in the original post.

STEP 7 V5.x — Remote Project Download

The same S7 connection carries both online DB access and full project download. The download path is identical for VPN and port forwarding.

  1. Set the PG/PC interface: Options → Set PG/PC Interface → Access Point of the Application: S7ONLINE (STEP 7) → Interface Parameter Assignment Used: TCP/IP <your LAN adapter>. For VPN, the adapter is the virtual TAP/Win driver; for port forwarding, the physical Ethernet or Wi-Fi adapter.
  2. Open the project and select the S7-300 station. Right-click the CPU 315-2 DP → Download.
  3. Enter the target address:
    • VPN topology: target address = 192.168.100.20 (CPU's PROFINET address) or 192.168.100.10 (CP) — STEP 7 performs PG routing through the CP to the CPU on the backplane.
    • Port-forwarding topology: target address = myplant.dyndns.org or the static public IP. STEP 7 first connects to the CP, which then forwards the download to the CPU via S7 routing.
  4. Confirm the "Download to Target System" dialog. For the CPU 315-2 DP, the tool offers to STOP the CPU before download — accept only if a stop is operationally acceptable. To download blocks without stopping, choose "Download user program to target — entire program".
  5. Verify online: PLC → Accessible Nodes should show the CPU with its actual station name, module order number (e.g., 6ES7 315-2AH14-0AB0 V2.6), and rack/slot 0/2.

For TIA Portal, the procedure is similar under Online → Accessible Devices, with the target address entered in the same dialog. The "PG/PC interface" settings for S7ONLINE must match the VPN adapter (TAP-Windows) for tunneled access or the physical adapter for port-forwarded access.

Reading and Writing Data Blocks Remotely

Once an S7 connection is up, three practical paths exist for inspecting and modifying DB contents without downloading a project.

Path 1 — STEP 7 Online Monitoring

  1. Open the project, expand "Blocks" in the S7-300 station.
  2. Double-click the target DB (e.g., DB100) or open a Variable Table (VAT) such as VAT_1. The VAT opens in offline view by default.
  3. Switch to Online → Monitor (or press Ctrl+F7). The current values are polled cyclically at the configured refresh rate.
  4. To write a value, click the cell in the "Modify value" column, type the new value, and press Enter. STEP 7 sends a single S7 write PDU; the CP forwards it to the CPU which writes to the DB.

This method requires the STEP 7 project to match the CPU's offline/online block consistency. If the CPU's online program differs from the project (e.g., a download happened at site), use "PLC → Upload to PG" first to refresh the offline view.

Path 2 — Custom HTML Pages on the CP 343-1 Advanced

The CP 343-1 Advanced IT variant can host user-defined HTML pages that read and write DBs directly. The pages are stored on the CP's file system (FTP accessible at ftp://192.168.100.10) and use Siemens' HTML scripting syntax. This is the only way to expose a DB view to a regular browser without STEP 7 installed on the client.

  1. Enable the web server in CP properties → Web. Assign an HTML user with read-only or read/write rights.
  2. Author HTML pages with <!-- AWP_ ... --> tags binding variables to DB addresses, e.g., <!-- AWP_Out_Variable Name='"DB100.DBD0"' --> for a DWORD read, or <!-- AWP_In_Variable Name='"DB100.DBX4.0"' --> for a BOOL input.
  3. Upload via FTP to the CP, then browse to http://myplant.dyndns.org/awp/<page>.html (port-forwarding case) or directly via the private IP on VPN.

For the public-internet case, expose the CP's HTTP port (default 80, configurable) on the DSL router with the same source-IP filtering rules used for TCP/102. HTML user pages are read/write-capable but do not authenticate against STEP 7 user lists; use the CP's per-page password protection.

Path 3 — S7 PUT/GET from a Second Station or OPC

If the office already runs SIMATIC NET OPC server or a WinCC station, define a S7 connection from that PC to the CP 343-1 with the public IP as target (port-forwarding) or the private IP (VPN). Expose the DB items in the OPC namespace and read/write them from any OPC client. This path also requires PUT/GET to be enabled on the CP (see parameter table above).

Verification and Diagnostics

After commissioning, run the following checks in order. Each one isolates a layer of the stack.

  1. L3 reachability (VPN only): from the office PC, ping 192.168.100.10. A reply confirms the IPsec tunnel and routing.
  2. TCP reachability: Test-NetConnection myplant.dyndns.org -Port 102 (PowerShell) or nc -vz myplant.dyndns.org 102 (Linux). A successful SYN/ACK confirms port forwarding and any firewall rule.
  3. S7 connection: STEP 7 → PLC → Accessible Nodes. The CP 343-1 and CPU 315-2 DP must appear. Double-clicking the CPU opens the online view of the station.
  4. DB read test: open a known DB (e.g., DB100) or a VAT, switch to Monitor, confirm that a value known to be running at site (e.g., a process variable) updates.
  5. DB write test: write a test bit, read it back, then clear it. Watch the PLC's diagnostic buffer for "Status of operating mode change" or "Write request from PG" entries — these confirm the CP saw and forwarded the S7 PDU.
  6. CP diagnostic buffer: in STEP 7, PLC → Diagnostics → Module Information on the CP 343-1. Look for "Connection established" / "Connection terminated" events with the office IP as the partner.

Troubleshooting Matrix

Symptom Likely Layer Root Cause Corrective Action
Accessible Nodes shows nothing, ping works on VPN STEP 7 / S7 Wrong access point (e.g., ISO on TCP not selected) Set PG/PC interface to TCP/IP → S7ONLINE
nc -vz public_ip 102 times out Network / Firewall Port forward missing or pointed to wrong CP IP Re-check DSL router forwarding rule; verify CP is up with arp -a on a local laptop
nc -vz public_ip 102 succeeds, STEP 7 still fails CP 343-1 "Use Router" blank → CP cannot reply to non-private source Enable "Use Router", set router address to DSL router LAN IP, download HW Config to the CP
STEP 7 connects, but online blocks are empty STEP 7 / project Online program differs from project (different FC/FB version) PLC → Upload to PG, re-save, retry
DB write returns "Function not permitted" CP 343-1 PUT/GET access disabled on CP CP properties → Access → PUT/GET = enabled, download HW Config to CP
Works once, then no more S7 connections CP 343-1 Max S7 connections exhausted (CP 343-1 Advanced IT supports up to 64 S7 connections, of which some are reserved) Reduce active connections; check partner list in CP diagnostics buffer
Connection drops every few minutes on consumer DSL WAN ISP enforces short TCP idle timeouts (~5 min) Enable TCP keep-alive in DSL router; lower S7 keep-alive in CP properties (Timestamps, "Send keep-alive") to 30 s
"Internal system error" in STEP 7 download PG routing / S7 routing CP 343-1 routing not active in HW Config CP properties → "S7 routing" = enabled; for port forwarding, also check "Use IP router"
STEP 7 times out, CP diagnostic buffer shows "Connection aborted — partner not reachable" Network / firewall Office PC's outbound IP is blocked by site firewall, or ISP is performing CGNAT Verify outbound IP via curl; ask ISP for a public IP; add IP to CP IP access list
First connection succeeds; second one immediately gets "Resource shortage" CP 343-1 CP firmware bug in V2.x with high partner turnover Upgrade CP firmware to latest V3.x release for the 6GK7343-1GX30-0XE0 variant

Frequently Asked Questions

Should the CP 343-1 IP in the STEP 7 project be the public IP for remote access?

No. The CP's IP in HW Config must always remain the private site IP (for example 192.168.100.10). Only the STEP 7 PC's download target address is the public IP or DynDNS hostname; the CP never learns the public address.

Why does the CP need the "Use Router" option set when port forwarding is used?

When a remote S7 PDU arrives at the CP, the source IP is the office public address. The CP's reply must be routed through the DSL router for NAT. The "Use Router" field tells the CP that any destination outside its local subnet is reached via the configured router address (192.168.100.1).

Can two CPs be reached from one public IP via port forwarding?

Only if the DSL router supports 1:1 NAT for the site subnet, or you forward different external ports to different CPs and use the CP's port configuration. Most consumer DSL routers cannot do either reliably. Use a VPN instead.

Does the CP 343-1 Advanced IT need a DynDNS client?

No. DynDNS is configured on the DSL router, not on the CP. The CP is only addressed by its private IP; the office PC resolves the DynDNS hostname to the public IP, which the DSL router then translates to the CP's private IP.

What TCP port does STEP 7 use for S7 communication with the CP 343-1?

TCP/102 (ISO-on-TCP / ISO Transport, port 102 by IANA assignment for ISO-TSAP). The CP 343-1 Advanced listens on this port for incoming S7 connections; the DSL router must forward TCP/102 to the CP's private IP.

Is S7 routing required on the CP for STEP 7 to reach the CPU 315-2 DP?

Yes. S7 routing on the CP 343-1 must be enabled in HW Config so that an S7 connection targeting the CPU's IP is forwarded across the backplane to the CPU. Without it, only the CP itself is reachable, not the CPU behind it.

Back to blog