Localization and geo-specific testing by simulating traffic from different global locations

Last validated:

Testing localization and geo-specific behavior typically requires deploying infrastructure in multiple regions or relying on third-party proxy services. Both approaches add cost and complexity, and proxy-based testing often produces unreliable results because commercial proxies share IP ranges that many services flag or block.

Tailscale exit nodes let you route traffic from your test machine through a device in any geographic location in your tailnet. By deploying exit nodes in the regions you need to test, you can simulate real user traffic from those locations. Combined with Siege, a command-line load testing tool, you can generate realistic traffic patterns to validate localization, geo-routing, and region-specific content delivery.

Set up exit nodes in target regions

Configure Linux servers in at least two geographic regions (for example, US East and EU West) as exit nodes so your test machine can route traffic through them. Each server needs Tailscale installed and running. Follow the Install Tailscale on Linux instructions if needed.

  1. On each regional server, enable IP forwarding:

    echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
    echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
    sudo sysctl -p /etc/sysctl.d/99-tailscale.conf
    
  2. Advertise each server as an exit node:

    sudo tailscale set --advertise-exit-node
    
  3. Approve each exit node in the admin console. This requires Admin privileges.

    1. Open the Machines page of the admin console.
    2. Find the regional server, select the ellipsis icon button, then select Edit route settings.
    3. Select Use as exit node, then select Save.
  4. Verify the exit nodes are available from your test machine:

    tailscale exit-node list
    

    You'll find your regional servers in the output.

Name your machines descriptively (for example, exit-us-east and exit-eu-west) so they are easy to identify when switching between regions.

Grant access to exit nodes

  1. Add the following grant and tag owner definition to your tailnet policy file to let members of group:qa use exit nodes tagged tag:eu-exit-node for geo-specific testing.

    • tagOwners: Defines who can assign a tag to devices. This example lets members of group:qa assign tag:eu-exit-node to the exit nodes they want to use for testing.
    • src: Specifies who the grant applies to. This example applies the grant to members of group:qa.
    • dst: Specifies what the source can access. The autogroup:internet destination grants access to internet traffic, which a device can only reach through an exit node.
    • via: Restricts which exit nodes the source can route traffic through. This example limits group:qa to exit nodes tagged tag:eu-exit-node, so group members can't use other exit nodes in your tailnet. For more information, refer to via.
    • ip: Specifies the protocols and ports permitted by the grant. The * wildcard permits all protocols and ports.
    "tagOwners": {
      "tag:eu-exit-node": ["group:qa"]
    },
    "grants": [
      {
        "src": ["group:qa"],
        "dst": ["autogroup:internet"],
        "via": ["tag:eu-exit-node"],
        "ip": ["*"]
      }
    ]
    

    You can use the visual policy editor to manage your tailnet policy file. Refer to the visual editor reference for guidance on using the visual editor.

  2. Assign the tag to each exit node server:

    sudo tailscale set --advertise-tags=tag:eu-exit-node
    

Install Siege on your test machine

Install Siege on the machine you will use to generate test traffic.

Install Siege with your package manager. On Ubuntu and Debian systems, use apt:

sudo apt install siege

Verify the installation:

siege --version

Run geo-specific load tests with Siege

With your traffic routed through a regional exit node and Siege installed, generate load against your application to validate its localization behavior.

  1. On your test machine, select the exit node for the region you want to test. For example, to route traffic through your US East server:

    sudo tailscale set --exit-node=exit-us-east
    
  2. Confirm that your traffic is routing through the exit node by checking your public IP address:

    curl -s https://ifconfig.me
    

    The output displays the public IP address of the exit node server, not your local machine.

  3. Run a basic load test through the US East exit node:

    sudo tailscale set --exit-node=exit-us-east
    siege -c 10 -r 50 -H "Accept-Language: en-US" https://your-app.example.com
    

    This sends 50 rounds of requests with 10 concurrent users, each including the en-US language header. Your application will serve US-localized content based on the geographic origin of the traffic.

  4. To verify that your application returns region-specific content, request a page with curl and inspect the response:

    sudo tailscale set --exit-node=exit-eu-west
    curl -s -D - -H "Accept-Language: de-DE" https://your-app.example.com
    

    Check the response headers and content to confirm the application returns the expected localized version.

  5. Once you've finished testing, turn off the exit node on your test machine so traffic routes normally:

    sudo tailscale set --exit-node=
    
  6. Verify your traffic is no longer routed through the exit node:

    curl -s https://ifconfig.me
    

    The output displays your local machine's public IP address.

Test multiple regions sequentially

Create a script that switches exit nodes and runs Siege against each region:

#!/bin/bash

REGIONS=("exit-us-east" "exit-eu-west")
LANGUAGES=("en-US" "de-DE")
TARGET="https://your-app.example.com"

for i in "${!REGIONS[@]}"; do
  echo "Testing region: ${REGIONS[$i]} with language: ${LANGUAGES[$i]}"
  sudo tailscale set --exit-node="${REGIONS[$i]}"
  sleep 5

  siege -c 10 -r 50 \
    -H "Accept-Language: ${LANGUAGES[$i]}" \
    --log="/tmp/siege-${REGIONS[$i]}.log" \
    "$TARGET"

  echo "Completed: ${REGIONS[$i]}"
done

sudo tailscale set --exit-node=
echo "All region tests complete."

The script cycles through regions, sets the exit node, runs Siege using the language for that region, and then turns off the exit node at the end.