TutorialsGB10

Serve a cloud application from a DGX Spark in your office

Keep the application in AWS and move only the model server to a box on your own network: the VPN settings that work, the load balancer target, the checks and the faults you will meet.

Time
Half a day, plus a period of side-by-side testing
For
Network and platform engineers
Status
In service at Understand Tech · addresses replaced by examples

What you will have

  • An application that stays in AWS and sends its model requests to a DGX Spark on your office network.
  • No change in the application: same host name, same port, same health check.
  • A way back to cloud capacity that is one target-group change.

What you need

  • An application in AWS that reaches its model server through one internal Application Load Balancer.
  • A DGX Spark in the office running a model server with an HTTP health endpoint. The examples use port 8000 and /health.
  • An internet line with a static public IP address.
  • A small VPN router that speaks IPsec IKEv2. This record uses a TP-Link Omada ER605 v2, which costs under $100.
On this page
  1. How a request travels
  2. Why there are two routers
  3. 1Prepare the office side
  4. 2Create the VPN on the AWS side
  5. 3Configure IPsec on the VPN router
  6. 4Register the box as a load balancer target
  7. 5Check the whole path
  8. 6Set the packet size before large answers hang
  9. When something fails
  10. Before production
  11. Sources
  12. Fact sheet

How a request travels

The design rule: the application must not know where the model lives. All model requests go through one internal load balancer. The VPN makes the box in the office reachable as if it were one more private address in the cloud network.

  1. A service in the VPC calls the internal load balancer over HTTPS on port 443.
  2. The load balancer forwards to its target group, whose registered target is the box’s office address on port 8000.
  3. That address is outside the VPC, so the VPC route table sends the packet to the virtual private gateway.
  4. The gateway puts the packet into the IPsec tunnel and sends it to the office’s public IP address.
  5. The internet provider’s router receives it and passes it to the VPN router, declared as its DMZ host.
  6. The VPN router ends the tunnel and delivers the packet on its own LAN.
  7. The box answers on port 8000. The reply takes the same path back.

The examples below use these addresses. Replace them with yours.

ItemExample value
VPC network10.0.0.0/16
AWS tunnel endpoint198.51.100.20
Office public IP address (static)203.0.113.10
Provider router LAN192.168.1.0/24
VPN router, address on the provider router’s LAN192.168.1.2
VPN router LAN192.168.50.0/24, router at 192.168.50.1
DGX Spark192.168.50.10, port 8000, health check /health

Why there are two routers

Some providers do not let you replace their router. In France, Orange fibre requires an authentication (RFC 3118 DHCP) that in practice only the Livebox performs. The provider router therefore stays in place, and the VPN router sits behind it.

The office then runs a double NAT on purpose. AWS identifies the office by the source address of the packets, which is the public IP address, and not by the identity the VPN router announces, which is its private address 192.168.1.2.

This identity mismatch is expected. It does not prevent the tunnel from coming up, and it does not need to be corrected.

Step 1

Prepare the office side

On the provider router, two settings carry everything:

  1. A fixed DHCP lease that always gives the VPN router the same address, here 192.168.1.2.
  2. The DMZ host set to that address. This is what lets the tunnel traffic reach the VPN router at all.

On the VPN router, give the box a fixed address that is outside the range the router hands out to other devices.

On the box, check that the model server answers locally, then from another machine on the same LAN:

Command
curl -sv http://127.0.0.1:8000/health
curl -sv http://192.168.50.10:8000/health

The box’s firewall must accept connections on port 8000 from the VPC network, 10.0.0.0/16.

Step 2

Create the VPN on the AWS side

Three objects, created in the AWS console. The AWS Site-to-Site VPN guide describes each screen.

  1. A customer gateway holding the office’s public IP address, 203.0.113.10. This address cannot be edited later: if the public IP changes, the customer gateway is created again.
  2. A virtual private gateway, attached to the VPC.
  3. A Site-to-Site VPN connection between the two, with the office LAN 192.168.50.0/24 as the remote network.

Then make the VPC send traffic for the office into the tunnel, and let it through:

  • Routes. Enable route propagation from the virtual private gateway on the route table of every subnet the load balancer lives in. 192.168.50.0/24 must then appear there with the gateway as its target.
  • Security groups. The load balancer’s group must allow outbound traffic to 192.168.50.0/24 on port 8000. Rules written only in terms of the VPC network silently drop this traffic.
  • Network ACLs. They are stateless: allow both directions.

Step 3

Configure IPsec on the VPN router

These values negotiate cleanly with AWS. Treat them as a matched set, on both phases.

SettingPhase 1 (IKE)Phase 2 (IPsec)
IKE versionIKEv2n/a
EncryptionAES-256-CBCAES-256-CBC
IntegritySHA2-256SHA2-256
Diffie-Hellman group / PFSGroup 14Group 14
Lifetime28,800 s3,600 s
Dead peer detectionEnabledn/a
Remote gateway198.51.100.20n/a
Local networkn/a192.168.50.0/24
Remote networkn/a10.0.0.0/16

Enable NAT traversal. Because of the double NAT, the tunnel travels in UDP port 4500, not 500.

Caution. Do not use AES-256-GCM with a separate integrity algorithm. GCM authenticates by itself, and the pair fails with No Proposal Chosen, a message that looks like a password or peer problem and is not.

Caution. Stay on SHA2-256. On this router, SHA-384 or SHA-512 brings the tunnel down to about 38 Mbps, where SHA2-256 sustains about 260 Mbps.

Step 4

Register the box as a load balancer target

The target group is of type IP. An address outside the VPC is accepted only when the attachment declares the availability zone as all. Without it, AWS rejects the registration.

Terraform
resource "aws_lb_target_group_attachment" "office_box" {
  target_group_arn  = aws_lb_target_group.inference.arn
  target_id         = "192.168.50.10"
  port              = 8000
  availability_zone = "all"
}

Nothing is installed on the box for AWS. The load balancer checks /health on port 8000 through the tunnel and forwards to that address like to any other backend.

Keep your cloud capacity registered and warm while you test. Sending traffic back is then one target-group change, not a deployment.

Step 5

Check the whole path

Tunnel state, with the time of the last status change. That time tells you whether the tunnel has been stable for weeks or has been going up and down.

Command
aws ec2 describe-vpn-connections \
  --vpn-connection-ids <vpn-connection-id> \
  --region <region> \
  --query 'VpnConnections[0].VgwTelemetry'

The office route, as the VPC sees it:

Command
aws ec2 describe-route-tables \
  --region <region> \
  --query "RouteTables[].Routes[?DestinationCidrBlock=='192.168.50.0/24']"

The health of the box, as the load balancer sees it. This is the fastest proof that the whole path works.

Command
aws elbv2 describe-target-health \
  --target-group-arn <target-group-arn> \
  --region <region>

Step 6

Set the packet size before large answers hang

The tunnel adds its own headers, so less room is left in each packet. The classic sign: the health check passes, small calls succeed, and any long answer hangs.

Set the MTU of the box’s network interface to 1400. Then confirm from the box, toward a machine in the VPC, with pings that may not be fragmented:

Command
ping -M do -s 1372 -c 3 <vpc-side-host>   # 1372 + 28 = 1400, must pass
ping -M do -s 1472 -c 3 <vpc-side-host>   # 1472 + 28 = 1500, expected to fail

If long answers still hang, enable MSS clamping for the tunnel on the VPN router.

When something fails

Most incidents come down to one of these rows. A target that turns unhealthy is first a tunnel question: check the tunnel before the box.

What you seeMost likely causeWhat to do
Requests fail, target unhealthy, tunnel downThe provider router lost its DMZ host or fixed lease after a rebootRestore both settings. Check that the public IP address has not changed.
Tunnel down, log shows No Proposal ChosenCipher mismatch on phase 1 or phase 2, often GCM with a separate integrity algorithmGo back to the set of Step 3, on both phases.
Tunnel down, dead peer detection times outThe path on UDP 500 and 4500 is blocked. It is not a cipher problemCheck the DMZ host, then NAT traversal, then the line itself.
Tunnel up, no traffic passesRoute propagation or security groups do not cover the office LANCheck Step 2. An accepted route count of zero on a tunnel that is up confirms it.
Small requests work, long answers hangPacket sizeStep 6.
Everything works, slowlyIntegrity algorithm on the routerUse SHA2-256.
Tunnel up, traffic passes, target still unhealthyModel server stopped, firewall on the box, or health check settingsRun the two curl checks of Step 1, then check the target group’s path, port and timeout.
Worked yesterday, box unreachable todayAnother device was given the box’s addressFix the box’s address outside the DHCP range.

When the tunnel is down, work outward from AWS, because the AWS view tells you whether packets arrive at all. If nothing explains it, disable and re-enable the IPsec policy on the VPN router: this forces a fresh negotiation.

Not faults: the identity mismatch described above, and the phase 2 renegotiation that appears in the logs every 3,600 seconds.

To do for a production deployment

Before you rely on it in production

  1. Bring up both AWS tunnel endpoints. AWS provides two per connection, and a single tunnel has no redundancy while AWS maintains an endpoint. On this router that means either a second WAN port for its failover feature, or two independent IPsec policies, one per endpoint.

  2. Register a second box as a second target, so the load balancer can take one out of service.

  3. Give the box an address outside the VPN router’s DHCP range, and set its MTU to 1400 before going live rather than after the first hang.

  4. Add an alarm on the tunnel state and one on the unhealthy host count of the target group, and keep the VPN tunnel logs in CloudWatch long enough to cover a weekend.

  5. Act on the maintenance notices AWS sends for VPN endpoints.

  6. After any reboot or update of the provider router, check its fixed lease and DMZ host before anything else.

  7. Back up the VPN router’s configuration every month. Do not update its firmware during an incident.

  8. Prove every change on a staging path first, and keep the cloud capacity as a fallback until the office path has run without trouble.

  9. Write down your availability target before you migrate. Minutes of downtime and four nines are different budgets, in the cloud or out of it.

Where the commands come from

Sources

Read on 30 November 2026. Commands are copied from the sources. A step a source does not show is described in words.

Reference

Fact sheet

Where this comes from

Understand Tech moved the model serving of its cloud application from rented GPU instances to DGX Spark units in its office, without changing the application. The application still calls one internal load balancer; a site-to-site VPN makes the box reachable as one more private address.

Machine

NVIDIA DGX Spark · 128 GB unified. A reference machine helps locate guidance; it does not establish identical behaviour on another maker’s system.

Software

AWS Site-to-Site VPN · internal Application Load Balancer · TP-Link Omada ER605 v2

Model

Any model server with an HTTP health endpoint; the examples use port 8000

Evidence

The configuration Understand Tech runs, from its published recipe (20 August 2026, updated 28 September 2026) and its operating notes. Every address, identifier and host name is replaced by an example. AI Deskside has not rebuilt this path on a second site.

Still open
  • Your internet provider’s router: whether it can be replaced, and whether it offers a DMZ host
  • Throughput of your VPN router with the chosen ciphers
  • Latency added by the tunnel for your own requests
  • Behaviour with both AWS tunnel endpoints in service