Skip to content
Guides

Connect a healthcare organization's network with a VPN tunnel

Create a Classic or HA VPN tunnel, send the peer config and pre-shared key to the other side, test that traffic gets through, and let the tunnel watcher fail over and heal it.

On this page
Connect a healthcare organization's network with a VPN tunnel. Create a Classic VPN tunnel to a healthcare organization's firewall, hand their network engineer the peer config and a one-time link to the pre-shared key, watch the tunnel come up, and send a synthetic ADT^A01 through it.

Many healthcare organizations will not expose an HL7 interface to the internet. A site-to-site IPsec VPN gives the engine a private path to their network. This guide creates a Classic VPN tunnel in the engine, hands the other side everything their network team needs, and checks that MLLP traffic reaches a host behind the tunnel.

sequenceDiagram
    participant You as MedHook admin
    participant Engine as MedHook engine
    participant Org as Healthcare organization network team

    You->>Engine: New tunnel (peer IP, remote subnets)
    Engine-->>You: Peer config, PSK shown once
    You->>Org: Handoff packet (PDF) + peer config
    You->>Engine: One-time PSK link
    Engine-->>You: Link that reveals the key once
    You->>Org: Link (sent separately)
    Org->>Org: Configure firewall, bring tunnel up
    Engine-->>You: Status: Up
    You->>Engine: Send test message (ADT^A01)
    Engine-->>You: ACK and round-trip time

Before you start

  • The engine runs on the GKE deployment. Tunnel management needs it, and other deployments answer 501 with "VPN management requires the GKE deployment".
  • You have the admin role. Tunnel changes are for admins. Operators can also send test messages and run a diagnosis. Viewers can read tunnels. See Who can do what.
  • From the other side: the public IP of their firewall, and the private subnets that hold the hosts you will send to (for example 10.20.0.0/24).

Steps

1. Create the tunnel

Open Tunnels and choose New tunnel. The rail on the left lists the four steps: Type (HA VPN, Classic, Interconnect), Healthcare organization & peer (who, where, which firewall), Routing & security (subnets, IKE, PSK) and Review (create and share). A finished step shows ✓ and you can go back to it from the rail. You can't jump ahead: Continue checks each step first. ← Tunnels leaves without creating anything.

With no tunnels yet, Tunnels shows Connect your first healthcare organization network with a card for each tunnel type. A card opens New tunnel on Healthcare organization & peer with that type already picked. If the healthcare organization sent their firewall export, Import it, like Import firewall config in the Tunnels header, opens the firewall importer under Migration › Import, which fills in the peer, the subnets and the ciphers.

Choose Classic VPN, choose Continue, and fill in Organization and peer. Ask the healthcare organization's network engineer for these. Each field has a hint:

FieldHintWhat to enter
OrganizationThe healthcare organization, for example Demo Health Lab. The tunnel is named after it (demo-health-lab).
Peer public IPtheir firewall's outside addressThe public IP of the other side's firewall. It must be a public address.
Their MLLP subnetwhere the sending system livesTheir private networks, comma-separated. Each is a CIDR from /8 to /32 with the host bits zero.
Network engineer's emailgets the shared linkOptional. MedHook emails them the shared link when you create the tunnel. See The shared link.
Their firewallTheir vendor: the live config on the right follows it

A peer IP that isn't an IPv4 address turns its hint red and reads not an IPv4 address. Their firewall has a chip per vendor, and picking one also switches the tab of the live config beside the form.

Routing and security shows what MedHook sets, read-only: both subnets, static routes, IKEv2 with AES-256 / SHA-256 / DH14, a generated 32-character pre-shared key sent by one-time link, and rotation every 90 days with a reminder 14 days before. Review lists your choices. Choose Create tunnel: the new tunnel opens on Tunnels, selected, with Setting up on its Overview while it provisions. If another tunnel already has the name, -2, -3 is added. An organization name with nothing to slug (no letters or digits, for example a non-Latin name) names the tunnel tunnel.

With a network engineer's email (any type but Interconnect), Create tunnel also makes the tunnel's shared link and emails it to them. While the tunnel is being set up, its Overview says Sent to , or The link wasn't emailed. Copy it and send it yourself. with Copy link when the engine has no email channel or the send failed.

The reminder goes out once per key, 14 days before it is due, as PSK for {name} rotates in {n} d, to the tunnel alert rule that gets PSK age alerts (and follows that switch in the tunnel's Settings). It goes out at severity info, so a PagerDuty rule does not page on-call for it. Needs you lists the key from the same day.

Remote subnets must not overlap

The engine refuses a tunnel, on create and on every edit, when one of its remote subnets overlaps:

  • another tunnel's remote subnets, of any type and in any workspace. Two routes for overlapping ranges would send one healthcare organization's traffic down the other's tunnel. The one exception is a backup tunnel, which routes its primary's subnets by design.
  • the cluster's own ranges: the GKE node range (the local subnets), the pod range or the service range. Traffic for them would leave through the tunnel instead of reaching the engine.

The error names the range it hit and the tunnel that uses it, for example 10.20.0.0/24 overlaps 10.20.0.0/16, used by clinic-lab. If two organizations really use the same private range, ask one of them to NAT it to a free range on their side. The GKE Terraform module passes the cluster's ranges to the engine as VPN_LOCAL_SUBNETS, GKE_PODS_CIDR and GKE_SERVICES_CIDR (Helm engine.env). On another GKE install, set them yourself. A range that is not set is not checked.

Sample values for demos

A demo engine can set a sample peer so the form fills in one click. Set TUNNEL_SAMPLE_VALUES to JSON (with Helm, set engine.tunnelSampleValues to the same keys as a map) with the organization, the peer's public IP, its remote subnets and a test target inside them:

json
{
  "organization": "Demo Health",
  "peerIp": "34.10.38.218",
  "remoteSubnets": ["10.20.0.0/24"],
  "testTarget": "10.20.0.2:2575"
}

New tunnel then shows Use sample values to admins. It fills the name (the organization as a slug, with -2, -3 added while an earlier demo tunnel still exists, though a second tunnel with the same remote subnets is refused while the first exists), peer IP, remote subnets and IKE version, sends the organization as the tunnel's description (the connection packet's organization name), and puts the test target in the Health card. The pre-shared key is never part of the sample: the engine generates it on Create tunnel. Optional keys: type (classic, the default, or ha with peerIp2 and peerAsn), name and ikeVersion. Ciphers aren't configurable; the peer config lists the proposals GCP uses. Unset, or invalid JSON (logged as a warning), hides the button. Leave it unset on production engines.

For a repeated demo: Use sample values, Create tunnel, wait for Up, Send test ADT^A01 on the Health card, then Back to tunnels and Delete.

The engine creates the record and provisions the tunnel in the background. The status shows Provisioning, then Waiting for healthcare org side once your side is up, then Up when the other side connects. The engine checks health every 5 seconds.

New tunnel with Classic VPN chosen, on the Healthcare organization & peer step: the step rail, Organization Demo Health clinic lab, peer public IP 198.51.100.20, their MLLP subnet 10.20.0.0/24, Their firewall, and Their config, live on the right showing the Cisco ASA configuration

2. Send the peer config

The Peer config panel shows the configuration for the other side. Pick the firewall tab: Cisco IOS, Junos, pfSense or strongSwan. The text on screen always shows a placeholder where the key goes.

From the tunnel's detail page, Download peer config also offers Cisco ASA and FortiGate for Classic VPN. The same files come from the API:

bash
curl -s "$ENGINE_URL/api/vpn-tunnels/$TUNNEL_ID?format=strongswan" \
  -H "Authorization: Bearer $TOKEN" -o medhook-clinic-lab.conf

The formats are ios, junos, pfsense, strongswan, asa and fortinet. Without reveal=1 the file holds a placeholder instead of the key. The proposal is AES-256, SHA-256, Diffie-Hellman group 14 and PFS group 14, with an IKE lifetime of 36000 s and an IPsec lifetime of 10800 s.

For example, the strongSwan file has this shape:

text
conn medhook-clinic-lab
    keyexchange=ikev2
    left=%defaultroute
    leftsubnet=10.20.0.0/24
    right=<MedHook gateway IP>
    rightsubnet=<MedHook subnets>
    authby=secret
    ike=aes256-sha256-modp2048!
    esp=aes256-sha256-modp2048!
    ikelifetime=36000s
    lifetime=10800s
    dpddelay=10s
    dpdaction=restart

Firewall rules on their side

Google Cloud puts the VPN gateway behind 1:1 NAT, so the tunnel always uses NAT traversal (NAT-T): ESP travels inside UDP 4500. Their firewall must allow UDP 500 and UDP 4500 from the MedHook gateway IP, plus ESP (IP protocol 50). Allowing ESP alone is not enough: IKE comes up on UDP 500 and then the tunnel stops on UDP 4500. Every config file, the setup link page and the connection packet say so. No template turns NAT-T off; FortiGate, Palo Alto (where it is off by default), Cisco ASA and pfSense set it on explicitly.

Dead-peer detection

Dead-peer detection (DPD) decides how fast a broken tunnel is noticed and brought back. Every config sets it explicitly:

FormatDPD setting
Cisco ASAisakmp keepalive threshold 10 retry 3 in the tunnel group (IKEv1 and IKEv2)
FortiGateset dpd on-idle, set dpd-retryinterval 5, set dpd-retrycount 3
strongSwandpddelay=10s, dpdaction=restart; IKEv1 also dpdtimeout=30s (IKEv2 uses its own retransmits)
pfSenseDead peer detection every 10 s, 5 failures
Palo AltoDPD on, interval 5 s; IKEv1 also retry 3
Cisco IOSIKEv1 crypto isakmp keepalive 10 3 periodic; IKEv2 dpd 10 3 periodic in the IKEv2 profile
Junosdead-peer-detection interval 10 threshold 3 on each IKE gateway

3. Send the pre-shared key

Never paste the key into email or chat. Use a one-time PSK link:

  1. On the tunnel's detail page, open Handoff packet and choose One-time PSK link.
  2. Choose Create link, then Copy link, and send it to their network engineer in a separate message.

The link opens their engineer's setup page: the firewall settings, live tunnel status, a test message and Reveal key, which shows the key once. The one-time link expires after 24 hours or first use, whichever comes first. A new link replaces the one sent before, and Rotate PSK makes a link for the new key. Creating and opening a link are both audited, and both appear under Events on the tunnel.

One-time links sent before the setup page existed (/psk/…) still work once until they expire. Their page says it is from before setup moved to one page and asks the engineer to get the current link from you. Making a new key link stops any unused /psk/… link working.

Rotating the key

Rotate PSK (Config tab) does not cut the tunnel over straight away. MedHook makes the next key, for example v3, and gives you its one-time link for the healthcare organization's network engineer (the link expires after 24 hours or first use). Their firewall keeps v2 for 72 hours, and they enter v3 when MedHook applies it: the link page says when ("Enter this key at Nov 1 09:10; until then keep v2"), because entering v3 early takes the tunnel down until then. The Overview says so: "Rotating PSK v2 → v3. The new key went to by one-time link at 09:10. The peer still uses v2, which keeps working until Nov 1 09:10." The status reads Up · rotating PSK.

  • Resend link makes a new link for v3; the one sent before stops working. The 72 hours don't restart.
  • Cancel rotation drops v3. The tunnel keeps using v2, and the link already sent stops working.
  • Apply now gives v3 to GCP before the 72 hours are up. The tunnel is re-created, and traffic stops until their firewall has v3.

Rotate PSK is off while a rotation is staged; use the banner. When the 72 hours end, MedHook applies v3 by itself (until it does, the banner reads "MedHook applies v3 shortly"). v2 is then kept for 24 hours, so you can still roll back to it if their firewall wasn't ready. Each step asks first, is admin only, and appears under Events on the tunnel.

The Config tab's Shared with the healthcare organization card holds one link for their network engineer: the config, the key once, live status and an MLLP test. The link is hidden until an admin chooses Copy link, which copies that same link every time, for example https://connect.demohealth.example.test/t/7Kq2-mW4d, and then shows it. The engine hands the link out only on a copy, and each copy is audited. The link works for 7 days. New link asks first, then replaces the code; the old link stops working at once.

The link is on the engine's own address unless an admin sets a white-label host (connectHost in PUT /api/settings/branding). Point that host's DNS at the engine first. Viewers and operators see the link masked.

Emailing the link. When the tunnel names a network engineer, Create tunnel and New link email the link to them through the engine's email channel (RESEND_API_KEY or ENGINE_EMAIL_WEBHOOK_URL, with ENGINE_EMAIL_FROM; see Environment variables). The email holds no PHI and nothing about the network: its subject is · Secure network setup, and it carries only the link and when it expires. It never carries the pre-shared key, a subnet, an IP address, or the tunnel or organization name. The card then says Sent to . When the link wasn't emailed, because the engine has no email channel or the send failed, the card says For · not emailed: choose Copy link and send it yourself. Viewers read The link wasn't emailed. An admin can copy it and send it. A sent email is audited as vpn_tunnel.share_emailed and a failed one as vpn_tunnel.share_email_failed, each with the recipient's domain only. One-time PSK links are never emailed: send those yourself, in a separate message. The access log under the card lists each open, download, key reveal and MLLP test, for example "Opened by j.alvarez@demohealth.example · downloaded Cisco ASA config".

While rolled back, v3 stays ready: links hand out v3, and after 24 hours MedHook applies it again. Once their engineer has applied v3, choose Rotate PSK to apply it now ("Apply PSK v3 now?"). It puts v3 back rather than making a new key, so the key they applied keeps working.

4. Send the connection packet

The connection packet is a PDF for the other side's network and interface teams. It lists the gateway addresses, subnets, cipher settings, the senders that will move, the tests to run and a rollback plan. It never contains the key.

Under Handoff packet, choose Edit packet details to add the organization name, the cutover window, the legacy engine, the senders and contacts. Then choose Preview packet or Download PDF.

5. Wait for their side

Until their firewall sends traffic, the tunnel shows Waiting for healthcare org side. Your side is up. The engine receives nothing yet. This is normal. Once they bring their end up, the status changes to Up.

Other states you may see:

StatusMeaning
Provisioning, Updating, DeletingThe engine is changing the tunnel. Wait.
Connecting · waiting for peerThe tunnel is starting.
Down · PSK mismatchThe key on their firewall is wrong. Send a new link.
Down · IKE negotiation failedTheir cipher settings differ from the peer config.
Down · subnet mismatchThe subnets on the two sides do not match.
FailedProvisioning failed. Read the message, fix it, then choose Retry.

Test it

When the status is Up, open the tunnel, choose Send test message, and enter a host and port inside the remote subnets, such as 10.20.0.40:6661. Choose Send ADT^A01.

The engine sends one synthetic ADT^A01 with MSH-11 = T and a made-up patient over MLLP. The console shows the round trip. You should see an ACK with MSA|AA and a round-trip time. Only hosts inside the tunnel's subnets are allowed.

To check TCP only, call the reachability test:

bash
curl -s -X POST "$ENGINE_URL/api/vpn-tunnels/$TUNNEL_ID/test" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"host": "10.20.0.40", "port": 6661}'

It opens a TCP connection from the engine, with a 5 second timeout, and reports whether it connected and how long it took.

Live MLLP connections

The tunnel's Overview shows Live MLLP connections: the senders connected to an MLLP listener from inside the tunnel's remote subnets, and the MLLP destinations whose host is inside them, each with when it connected, its last message each way, its last ACK and its traffic in the last 5 and 15 minutes. It refreshes every 5 seconds. All connections opens Messages › Connections. Operators and admins see it.

HA VPN

HA VPN gives one healthcare organization two tunnels, one per interface of MedHook's HA gateway, and a BGP session over each. Routes are learned over BGP, so there are no static routes to manage, and when one interface goes down BGP moves traffic to the other. Use it when the other side's firewall speaks BGP. It needs the HA gateway and Cloud Router from the GKE deployment.

On New tunnel, choose HA VPN. Step 2 asks for a Second peer IP as well (the other side's second VPN interface); Their MLLP subnet holds the only prefixes the engine accepts from this organization over BGP (and longer ones inside them). Anything else they announce, including a default route, is dropped.

Routing and security is read-only: BGP on MedHook's Cloud Router ASN. The tunnel is created with peer ASN 64512, and the engine allocates one free 169.254.x.y/30 per interface on the shared Cloud Router. When their engineer asks for another ASN or other ranges, change them after creating with PATCH /api/vpn-tunnels/{id} and peerAsn and/or bgpRanges (Admin, audited). The engine refuses a /30 another HA tunnel holds and re-creates the tunnel with the new values. The shared link shows the new peer ASN and ranges, but a config or connection packet their engineer already downloaded keeps the old ones: tell them, and send the config again.

The remote subnets of an HA tunnel may not overlap any other tunnel's, so one organization can never announce a route that pulls another's traffic.

The detail page shows each interface (if0, if1) with its peer, tunnel status and BGP state. An interface counts as up when its tunnel is established and its BGP session is up. While one interface is down, the status and the watcher line both read Degraded · one interface down, and the API reports health: "degraded" (filter with GET /api/vpn-tunnels?health=degraded). Traffic still flows over the other interface, but nothing backs it up. With both interfaces down the status reads Down, and Down · BGP sessions down when both tunnels are established but neither BGP session is. The peer config and the connection packet list both Google gateway addresses, both peer IPs, both ASNs and the two BGP sessions (each side's link-local address), so the other side's network team can set up both tunnels in one change window.

Backup tunnel and failover

A Classic tunnel can have a backup: a second Classic tunnel to the same healthcare organization on MedHook's second Classic gateway. Both route the same remote subnets. The tunnel carrying traffic routes them at priority 100 and the standby at 200, so the standby waits instead of sharing the load. It needs the second Classic gateway from the GKE deployment.

  1. Open the Classic tunnel's Settings tab. Under Failover, the first row reads no backup tunnel · Add a backup. Choose Add a backup. It shows only on a ready Classic tunnel that has no backup yet, when the second Classic gateway is deployed.
  2. In Add backup tunnel, enter the peer IP for the backup (leave it blank to use the same firewall), and generate a key or enter one from the organization. Choose Add backup.
  3. Copy the backup's key from the dialog. It is shown once, like any new key.
  4. Send the updated connection packet. The packet for either tunnel asks for both tunnels, with both Google gateways and both peers.

In the list the backup sits under its primary. The detail header names the partner (Primary · backup: or Backup of ), and the Settings tab's Failover section says which end carries traffic: Carrying traffic or Standby.

The Overview's Backup pair card draws the pair. The tunnel carrying traffic is the solid box (Primary · carrying traffic). Its standby is the dashed box, with when it takes over: Standby · takes over after 60 s down, the same number as the Settings row. After a failover the backup's box is solid (Backup · carrying traffic), and the primary's says when it takes traffic back: Standby · takes traffic back after 5 min stable, or fail back off in Settings.

Run failover test on the card moves live traffic to the standby and back, so it asks first (Run a failover test on ?) and is for admins. A standby that isn't established fails the test without moving anything. The line under the button reads last test Oct 12 · passed in 41 s, last test Oct 12 · failed with the cause on its own line, or never tested. The test and its result are in the audit log as vpn_tunnel.failover_tested.

To move traffic by hand, for example before maintenance on the primary's side, open the standby's Settings tab and choose Make this tunnel carry traffic. The move is audited and shows in both tunnels' Events. A move made by hand holds: the watcher does not move traffic back to a healthy primary. If the primary goes down and recovers later, the watcher moves traffic back to it once it has been stable for 5 minutes. To move traffic back sooner, choose Make this tunnel carry traffic on the primary.

Tunnel settings

A tunnel's Settings tab has four sections. Admins change them, and every other role reads them with the switches disabled. A change is audited as vpn_tunnel.settings_updated with the names of the fields that changed, never their values.

Alerts (Who hears about it, and when.). Each row has a switch and names who hears it.

RowOn by defaultGoes to
Tunnel down for 2 minYesEvery PagerDuty Tunnel events alert rule
Flapping: 3 drops in 10 minYesEvery Slack Tunnel events alert rule
BGP route withdrawnHA VPN onlyEvery Slack Tunnel events alert rule
PSK older than 90 daysYesEvery email Tunnel events alert rule

The row names the rules, for example PagerDuty · Integrations on-call, #integrations or email the owner. When the workspace has no rule of that kind, the alert goes to every Tunnel events rule, and the row names the first two and +N more. A recovery goes wherever its outage's alert went.

Tunnel down for 2 min means it: the down alert is sent 2 minutes after the first bad read. A tunnel that comes back before then never pages, and its recovery isn't sent either. Both stay recorded as muted. Failover, failback and re-establish alerts go out at once.

Maintenance windows (Alerts are muted and messages wait at the healthcare organization during these.). Add a window takes Every week (a day) or One time (a date), From and To times, a Time zone and a Note. A window reads, for example, Every Sunday 02:00 to 04:00 CT, and shows when it is open now. During a window, tunnel-event alerts are muted and kept as a record, and the watcher holds: it doesn't fail over or re-establish. An outage that outlasts the window is alerted. With none, the section reads No maintenance windows · alerts always go out.

Failover (Only for tunnels with a backup.).

  • Fail over to the backup after 60 s down, with the pair under it (demo-health → demo-health-backup).
  • Fail back when the primary is stable for 5 min.

Turning either off or on asks first (Turn off automatic failover?), because it changes where live traffic goes. The watcher uses the new setting on its next check. On a tunnel with no backup both switches are off and disabled, and the first row offers Add a backup. The numbers are the watcher's: with TUNNEL_WATCHER_* set, the labels follow.

Danger zone. Delete tunnel asks you to type the tunnel's name. While workflows listen through the tunnel, the row says how many (2 workflows listen through this tunnel; move them first) and Delete is blocked. The API doesn't block it: DELETE /api/vpn-tunnels/{id} on a tunnel in use goes ahead and answers a TUNNEL_IN_USE warning naming the workflows, which the audit log records.

Self-healing watcher

The engine watches every Classic and HA tunnel and acts when one goes down. It reads each tunnel's status (and, for HA, each BGP session) every 15 seconds.

What happensWhat the watcher does
A tunnel is not established for 4 reads in a row (60 s)Records Tunnel down. One bad read is ignored.
The tunnel carrying a pair's traffic is down and its partner is establishedMoves traffic to the partner at once (Failed over). It never moves traffic to a tunnel that is not established.
A tunnel stays down for 5 minutesRe-establishes it: deletes it and creates it again with the same settings and key, so the other side renegotiates. At most once per 5 minutes.
The pair's primary is back from an outage and stays established for 5 minutesMoves traffic back to it (Traffic back on). It never undoes a move an admin made while the primary was healthy.
One interface of an HA tunnel is downRecords One interface down (degraded) and alerts. BGP already moved traffic, so it does nothing else.
A tunnel comes backRecords Recovered.

It leaves alone a tunnel that has never been established (the other side is not set up yet), a tunnel being created, changed or deleted, and any tunnel it cannot read from Google Cloud.

Flapping. A tunnel that drops (goes from up to down) 3 times within 10 minutes, or would need more than 4 actions in an hour, is paused: the detail shows Paused: flapping or Paused: too many actions in an hour, and the watcher takes no action on it until it has been quiet for 30 minutes. An admin can choose Resume watching on the Settings tab to clear the pause. A paused primary that is standing by then takes traffic back once it has been established for 5 minutes after the resume, as it does when the pause runs out.

The watcher follows the tunnel's settings: with Fail over to the backup off it doesn't fail over, with Fail back off it leaves traffic on the backup, and during a maintenance window it takes no action.

Every event appears in the tunnel's Events with the watcher's reason, for example Failed over to clinic-lab (backup) · primary down 60s · watcher, and in the audit log. To be told, add an alert rule of kind Tunnel events (watcher) under Settings → Alert rules: it sends down, degraded, failover, re-established, recovered, failback and paused events to Slack, email, PagerDuty or a webhook, once per event. Each tunnel's Alerts switches decide which kinds go out and to which rules. See Engine alert rules.

The watcher runs on every engine replica and each tunnel is watched by one of them at a time; if that pod stops, another takes over within a minute. The watcher saves each action before carrying it out and keeps its claim on the tunnel while the action runs, so a slow re-create on one replica is never repeated by another. The thresholds can be changed with the TUNNEL_WATCHER_* settings in Environment variables. The Cloud Monitoring tunnel-down policy pages independently of the watcher, for Classic and HA tunnels, so a stopped watcher still pages.

After an engine restart

Creating, changing and deleting a tunnel finish in the background. If the engine restarts partway through, for example during a rollout, the tunnel would otherwise stay Provisioning, Updating or Deleting. When the engine starts, and every minute after that, it looks for tunnels that have been in one of those states for 10 minutes and finishes the job against Google Cloud:

  • Deleting: removes the tunnel and its routes again, then the record.
  • Provisioning or Updating: removes whatever the interrupted job left, then creates the tunnel again from its saved settings and pre-shared key. A key rotation in progress completes. The healthcare organization's side sees a short renegotiation.

Each resume shows in the tunnel's Events as Resumed … after an engine restart, and in the audit log as vpn_tunnel.reconcile_resumed. If Google Cloud refuses, the tunnel shows Failed with Google's reason, as any failed create does. A resume that a second restart also interrupts is not retried. The tunnel shows Failed with the reason interrupted twice by an engine restart, the event reads … interrupted by engine restarts · marked failed (vpn_tunnel.reconcile_failed), and you choose Retry or Delete.

With several engine replicas, only one works on a given tunnel at a time. Each background job, and each resume, holds a database lock on the tunnel, and a replica that stops releases the lock. VPN_RECONCILE_STALE_MS (default 600000) and VPN_RECONCILE_INTERVAL_MS (default 60000) change the wait and the interval.

Diagnose a down tunnel

A down tunnel shows a red Down banner at the top of Tunnels with what is wrong. Diagnose on the banner opens that tunnel's Overview and runs its diagnosis; Run diagnosis on the Overview does the same at any time (Run again after a run). It is for operators and admins.

The checks read the tunnel's live status from Google Cloud. They run in order and stop at the first failure; every check after it is skipped:

CheckPasses when
Peer reachableGoogle Cloud gets IKE packets (UDP 500 and 4500) from the healthcare organization's peer address.
IKE SA_INITThe two sides agree on the IKE proposals (phase 1).
IKE AUTHThe pre-shared keys match.
Traffic selectorsThe subnets on both sides match (phase 2). On an HA tunnel this check is BGP sessions.
MLLP round tripA synthetic ADT^A01 reaches the Overview's MLLP target inside the tunnel's subnets and gets an ACK. Skipped without a target.

The MLLP message goes only when every IPsec check passed. Then Agent · likely cause says, in a sentence or two, what failed, what their side needs to change and the next step, with the last IKE exchanges (see IKE log). The explanation is worked out without the model, so it reads the same with AI off. Each run is an event under Events and is audited as vpn_tunnel.diagnosed. The pre-shared key is never read or shown.

When the keys don't match

When the diagnosis finds a PSK mismatch, the card offers two fixes, both admin only:

  • Send a new one-time PSK link opens the link dialog for the healthcare organization's engineer. Once the link is made the button reads Link sent · expires in 24 h.
  • Roll back to PSK v for 24 h shows for 24 hours after a rotation was applied, while MedHook still keeps the key it replaced. It asks first ("Roll back to PSK v for 24 hours?"): the tunnel comes back now with the key their firewall still has, the newer key stays ready for their engineer, and after 24 hours MedHook applies the newer key again. Choose Roll back. The tunnel is re-created in the background, and the rollback is audited as vpn_tunnel.psk_rolled_back with the versions and when it ends, never a key.

The rollback is also POST /api/vpn-tunnels/{id}/psk-rollback. It answers 409 when there is nothing to roll back to, while a rollback is on, or while the tunnel is busy. The Agent can propose it as an Asks first card; nothing runs until an admin confirms it on Tunnels.

Who can do what

ActionMinimum role
Read tunnels, their Overview, Traffic, Events, Config and SettingsViewer
Send test message, Run diagnosis and the IKE logOperator
New tunnel, Import firewall config, edits, Delete tunnel, Rotate PSK, Roll back to PSK v for 24 h, One-time PSK link, Copy link, New link, Add a backup, Make this tunnel carry traffic, Run failover test, Resume watching and the Settings switchesAdmin

Anyone below the role a control needs sees it disabled, and its title says which role it needs. That covers Import firewall config in the Tunnels header and Import it on the empty state, and Edit packet details and One-time PSK link in the Handoff packet menu. New tunnel opens read-only for them: a notice says so, the steps and the live config still work, and there is no Create tunnel button. The engine API checks the same roles.

Troubleshooting

ProblemFix
Create answers 400 about the peer IPThe peer must be a public IPv4 address. Private, documentation and reserved addresses are refused.
Create answers 409A tunnel with that name exists. Choose another name.
Create answers 501This engine is not on the GKE deployment.
The status stays Waiting for healthcare org sideTheir firewall has not brought its end up. Check the config, the key and that UDP 500 and 4500 are open on their side.
Send test message is disabledThe tunnel must be in the ready state.
The test connects but gets no ACKThe host answers TCP but is not an MLLP listener. Check the port with their interface team.
Add a backup is missingOnly a ready, unpaired Classic tunnel takes a backup, and only when the second Classic gateway is deployed.
The detail shows Paused: flappingThe tunnel changed state too often. Fix the cause with their network team, then choose Resume watching.
A tunnel stays Provisioning, Updating or DeletingAn engine restart interrupted it. The engine resumes it after 10 minutes. See After an engine restart.
The diagnosis shows IKE log not available on this installThe engine's service account can't read Cloud Logging. Grant it roles/logging.viewer (see IKE log). The checks and the explanation work without it.

Not sure which row applies? Ask the assistant why the tunnel is down. It reads the tunnel's status and its last reachability test and says where it fails: IKE phase 1 (proposals or the pre-shared key), phase 2 (subnets), BGP (ASNs or advertised prefixes), or the partner's firewall when the tunnel is up but the test fails. It gives the fix to send their network engineer, with MedHook's proposals or subnets, and never the key.

IKE log

When a diagnosis stops, the Agent · likely cause card shows the last IKE exchanges from the Cloud VPN gateway's log, for example 14:24:08 IKE_AUTH ← AUTHORIZATION_ERROR (24). On an HA tunnel each line starts with its interface (if0 or if1), and each Events row names that interface's peer. Events lists the notable ones by time: IKE_AUTH failed · AUTHORIZATION_ERROR from {peer}, IKE_SA_INIT ok · proposal AES-256 / SHA-256 / DH14, Rekey failed · AUTHORIZATION_ERROR and Child SA rekeyed · AES-256 / SHA-256. MedHook reads at most 20 lines, from 30 minutes before the tunnel went down until now (the last 24 hours while it is up). Each line is rebuilt from known IKE wording, so it never shows the pre-shared key or any other log text. GCP's AUTHENTICATION_FAILED reads AUTHORIZATION_ERROR, as everywhere else in MedHook.

The engine reads the log with Cloud Logging, so its service account (the Workload Identity account, medhook-…-engine) needs roles/logging.viewer on the project. The GKE Terraform does not grant it. Without it, the card reads IKE log not available on this install and Events shows only the audit rows. Each read is in the audit log as vpn_tunnel.ike_log_read, with the line count only. Operators and admins can read it.

Reference