Remote Programming S7-1200 Over Internet: SCALANCE S623 VPN Setup
Remote engineering of an S7-1200 PLC (in this case CPU 1214C) over a public network requires a deliberate VPN architecture, correctly selected Siemens security modules, and proper TIA Portal V13 configuration. This reference walks through hardware selection, IP addressing, IPsec/OpenVPN tunneling, and verification using the SCALANCE S623 and the CP 1243-1 communications processor (often referenced in Siemens documentation as the "M873" module on the S7-1200 side).
1. Application Overview and Threat Model
A remote S7-1200 site is typically exposed to three risks: (a) unauthorized download/upload of the TIA Portal project, (b) interception of automation traffic (PROFINET, S7 communication), and (c) direct manipulation of I/O via the engineering channel. A point-to-point IPsec VPN between two SCALANCE S623 routers mitigates (a) and (b) because every TIA Portal packet is wrapped in ESP/AH and encrypted with AES-128/256.
Siemens explicitly recommends a SCALANCE S-class security appliance on both ends of the link for permanent remote-maintenance tunnels. This is documented in the application example SIEMENS Support Entry 99681360 - "SCALANCE S VPN: Configuration of secure connections". Ad-hoc solutions such as TeamViewer, while functional for desktop sharing, do not satisfy industrial-grade firewalling and segmentation; treat them only as a temporary fallback.
2. Hardware Bill of Materials
| Item | Siemens Part Number | Function |
|---|---|---|
| CPU 1214C DC/DC/DC or DC/DC/Rly | 6ES7214-1xx30-0xB0 | Target PLC; supports PROFINET and add-on CPs |
| CP 1243-1 (M873) | 6GK7243-1BX30-0XE0 | WAN-side Ethernet CP for S7-1200; IPsec/VPN capable; provides security firewall |
| SCALANCE S623 V3 (site A - PLC) | 6GK5623-0BA10-2AA3 | Industrial security appliance, IPsec/OpenVPN, DIN-rail mount, -40 to +70 °C |
| SCALANCE S623 V3 (site B - Engineering) | 6GK5623-0BA10-2AA3 | Peer appliance terminating the tunnel |
| Security Configuration Tool (SCT) | Download from SIEMENS support (free) | PC tool to generate IPsec configuration and import on both S623 |
| TIA Portal V13 SP1 / Update 9 (or later V13.x) | 6AV2100-0AA03-0AA5 (DVD) / 6AV2100-0AA13-0AA7 (download) | Engineering software |
| STEP 7 Basic V13 | Included in TIA Portal V13 | PLC programming environment |
3. Network Architecture
The recommended topology is two isolated industrial LANs joined by an IPsec tunnel. Each SCALANCE S623 sits between the local DSL/cable/4G router and the PLC LAN. The PLC LAN (192.168.10.0/24 say) is never exposed on the WAN.
The TIA Portal PC sees the remote CPU as if it were on the local subnet 192.168.10.0/24 thanks to the routed tunnel.
4. IP Address Planning
| Device | Interface | IP Address | Subnet Mask | Default Gateway |
|---|---|---|---|---|
| TIA Portal PC | Ethernet | 192.168.20.50 | 255.255.255.0 | 192.168.20.1 |
| SCALANCE S623 (engineering) | LAN / WAN | 192.168.20.1 / 203.0.113.10 | /24 / /29 | ISP-provided |
| SCALANCE S623 (remote) | LAN / WAN | 192.168.10.1 / 198.51.100.5 | /24 / /29 | ISP-provided |
| CP 1243-1 (M873) | WAN to S623 | 192.168.10.20 | 255.255.255.0 | 192.168.10.1 |
| CPU 1214C PROFINET port | LAN | 192.168.10.10 | 255.255.255.0 | 192.168.10.1 |
Static vs Dynamic IP on the WAN side: A persistent IPsec tunnel requires that at least one endpoint have a stable public address. If the engineering site has a fixed public IP (recommended for the "server" side), the remote S623 can use a dynamic DNS name. If both ends are dynamic, switch to SINEMA Remote Connect (Siemens management server) or use a 4G router with a static APN.
5. SCALANCE S623 V3 Hardware Facts
| Parameter | Specification |
|---|---|
| Article number (V3) | 6GK5623-0BA10-2AA3 |
| Firewall throughput | Up to 200 Mbps |
| IPsec throughput (AES-256) | ~130 Mbps |
| VPN tunnels supported | Up to 20 (firmware V3.x) |
| Encryption | AES-128/192/256, 3DES, DES (deprecated) |
| IKE version | IKEv1 and IKEv2 |
| Power supply | 24 V DC, redundant inputs |
| Operating temperature | -40 °C to +70 °C |
| Mounting | DIN rail or wall |
| Configuration interfaces | Web UI (HTTPS), SCT, CLI, SINEC NMS |
Two identical SCALANCE S623 V3 units are sufficient for the architecture; they do not need to match firmware exactly, but a firmware mismatch can reduce the strongest available cipher. Update both to firmware V3.0 or later via the Siemens support downloads.
6. CP 1243-1 (M873) Configuration in TIA Portal V13
- Open TIA Portal V13 with the project that targets the remote 1214C.
- In the device tree, drag "CP 1243-1" onto the S7-1200 rack; the module occupies slot 1.
- Open CP 1243-1 Properties → Ethernet addresses. Assign IP
192.168.10.20/255.255.255.0; the router field is left blank because the SCALANCE S623 at192.168.10.1does not route off-subnet. - Enable "Use router" only if the SCALANCE is on a different subnet. In the design above it is on the same subnet, so the CP's default gateway remains 192.168.10.1.
- Activate "Security" → "Activate IPsec VPN". Choose "Connection to a SCALANCE S" and enter the remote S623's tunnel endpoint IP (e.g.,
203.0.113.10). - Select authentication: Pre-Shared Key (PSK) is the simplest; for higher security use X.509 certificates loaded from the project tree.
- Compile and download the configuration to the PLC locally before remote commissioning. Do not download over the WAN on first commissioning - the download service is open by default, which is an attack surface.
7. SCALANCE S623 VPN Configuration with Security Configuration Tool
The SCT (Security Configuration Tool) is the official Siemens method to define IPsec tunnels and push them to both S623 devices.
- Install SCT from the Siemens support page on the engineering PC. Minimum version for SCALANCE S V3 is SCT V4.4 HF2 or newer.
- Launch SCT and create a new project. Add both S623 appliances by their MAC address and IP.
- Define the VPN connection: Mode = "Tunnel", Local = WAN IP of site B, Remote = WAN IP of site A, IKEv2, AES-256-CBC, SHA-256, DH group 14, lifetime 28800 s (8 h).
- Generate a Pre-Shared Key of at least 32 random characters. Siemens recommends a passphrase >= 20 chars for AES-256.
- Save the project. Use the "Import into device" wizard; the SCT packages both appliances' configuration files which must be loaded manually onto each S623 via its Web UI.
- On each S623, log in via HTTPS (default credentials: admin / admin - change immediately), navigate to System → Load & Save → HTTP, and upload the .tgz generated by SCT.
8. Handling Dynamic IP Addresses
When the engineering site (which acts as the "hub") has a stable public IP, the remote S623 simply dials that IP. If the remote site is dynamic, the options are:
| Mechanism | How it works | Limitations |
|---|---|---|
| Dynamic DNS on remote S623 | SCALANCE S V3 supports dyndns.org and No-IP client; SCT can configure provider and credentials. | Provider outage breaks tunnel; PSK remains exposed if domain is hijacked. |
| SINEMA Remote Connect (SRC) | Central Siemens management server; each S623 registers outbound, TIA Portal connects to SRC, SRC brokers the tunnel. | Requires SRC server, subscription, public certificate. Not supported in TIA V13 for S623 directly; requires CP 1243-1 with newer firmware or SRC relay. |
| Cellular 4G with static APN | Some M2M SIM providers (e.g., 1NCE, EMnify, Vodafone M2M) issue a fixed public IP per SIM. | Latency 30-80 ms; data cost. |
For a first deployment with limited budget, configure dynamic DNS on the remote S623, set short IKE lifetime (e.g., 1 h) so re-key tolerates IP changes, and pair with a watchdog timer that triggers the SCT to re-resolve the FQDN if the SA fails.
9. TIA Portal V13 Configuration for Remote Programming
- Open the project. In "Online → Accessible nodes", wait up to 10 s; the remote CPU 1214C should appear with its LAN IP
192.168.10.10. - If the CPU does not appear, manually add the IP via "Online → Target device IP address" and click "Flash LED" to identify it.
- Use "Project → Download to device" (Ctrl+B). TIA Portal will issue the AR (Application Relationship) establishment over the tunnel.
- For first-time remote download, check the box "Online & diagnostics → Online access → Activate online functions for remote commissioning".
- After download, force the CPU to RUN by setting "Operating mode switch → Start (Run)".
10. Security Hardening Checklist
- Change default passwords on both SCALANCE S623 devices (admin / admin). Use 12+ chars.
- Disable HTTPS if not used; otherwise limit to TLS 1.2/1.3 only.
- Set the SCALANCE firewall to "Stateful Inspection" and define explicit allow rules for TIA Portal (TCP 102) from the engineering subnet only.
- Enable syslog to a remote server (UDP 514 or TCP/SSL). The S623 supports TLS syslog.
- Enable NTP on both S623 devices; Siemens recommends
time.siemens.comor a local NTP server. - Use certificate-based IKEv2 instead of PSK if you operate more than three sites.
- Physically lock cabinets containing the SCALANCE devices - they expose management access.
- Set "Tunnel hold-down time" = 0 so re-key is immediate; "DPD" (Dead Peer Detection) = 30 s.
11. Verification Procedure
- From the TIA Portal PC, ping
192.168.10.10(CPU) and192.168.10.20(CP). Both should reply with sub-100 ms latency. - Open the S623 Web UI on the remote side (via https://192.168.10.1) and navigate to Information → VPN. Confirm Phase 2 SAs are present with matching SPI.
- In TIA Portal: "Online → Online & diagnostics → Diagnostics status". Verify that the diagnostic buffer shows no "Connection interrupted" entries.
- Perform a controlled stop/start of the S623 on the engineering side and observe the remote S623 syslog for "Tunnel re-established" messages.
- Disconnect the WAN link at the remote site for 60 s. TIA Portal should display "connection lost" and recover automatically when WAN returns.
12. Troubleshooting Matrix
| Symptom | Probable Root Cause | Corrective Action |
|---|---|---|
| TIA Portal cannot see remote CPU | Phase 1 IKE not matching | Compare PSK byte-for-byte on both S623. Check that IKE proposals (encryption / DH group) overlap exactly. |
| Ping works, TIA Portal times out | Firewall rule blocking TCP 102 (ISO-on-TCP / S7) | Add explicit rule: Src 192.168.20.0/24, Dst 192.168.10.10, Dst port 102, TCP. |
| Tunnel flaps every 30 s | DPD too aggressive, MTU mismatch | Increase DPD to 60 s; set MTU on WAN interface to 1400 bytes (IPsec overhead). |
| CPU 1214C reachable, but download fails at 12% | Online password set on PLC but not supplied | Project tree → PLC Properties → Protection → "Allow access via PUT/GET communication" + supply password. |
| S623 Web UI returns 404 after SCT import | Incompatible firmware | Update S623 to firmware V3.0 or later; re-import configuration. |
| TIA Portal V13 reports "Unknown device" | HSP missing for CP 1243-1 in V13 | Install Hardware Support Package for CP 1243-1 in TIA V13: Options → Support Packages → Install HSP0181. |
13. FAQ
Do I really need a SCALANCE S623, or can I use the cheaper SCALANCE S615?
The SCALANCE S615 (6GK5615-0AA01-2AA3) is functionally equivalent for IPsec VPN with up to 20 tunnels and AES-256, but it has fewer ports (2 vs. 4) and lacks the Bypass relay used in line topologies. For a simple point-to-point TIA Portal link, the S615 is fully adequate and lower cost.
Can I tunnel two S7-1200 CPUs through one S623?
Yes. The S623 supports up to 20 simultaneous IPsec tunnels. Define one tunnel per remote PLC, each with a unique Phase 2 selector. TIA Portal will see each CPU on its own IP address.
Is TIA Portal V13 compatible with newer CP 1243-1 firmware?
TIA V13 supports CP 1243-1 firmware up to V3.x. Firmware V4.x requires TIA V15.1 or later. Always match the TIA version to the CP firmware version - mixing causes online diagnostics to fail.
What latency is acceptable for remote programming?
TIA Portal downloads tolerate up to ~300 ms RTT for small projects, but large projects (5 MB+) degrade noticeably above 150 ms. Use DSL or 4G with good signal; satellite links (>600 ms) are impractical.
Can I use OpenVPN instead of IPsec on the SCALANCE S623?
The S623 firmware V3 supports OpenVPN as client mode only. For server-mode OpenVPN between two S623s, use IPsec with IKEv2, which is the better-tested path documented in the Siemens application example.
Does TeamViewer still have a role in this architecture?
TeamViewer can complement the IPsec tunnel for occasional desktop sharing (e.g., screen recordings of WinCC flexible Runtime). However, TeamViewer alone does not provide industrial firewalling; keep SCALANCE S623 as the primary security boundary.
How do I license the CP 1243-1 security features?
The security/VPN functionality of the CP 1243-1 (6GK7243-1BX30-0XE0) is enabled by default. No additional license key is required for AES-128. For AES-256, a SINEMA SERVER / SINEMA RC license may be required only when used with SINEMA Remote Connect, not for direct SCALANCE-to-SCALANCE tunnels.