A site-to-site VPN connects two or more physical office networks — so devices in your Hong Kong office can reach servers in your Singapore office, and vice versa, as if they were on the same local network. Using a Hong Kong VPS as the WireGuard hub with CN2 GIA routing means all inter-office traffic benefits from premium Asian backbone connectivity, and mainland China offices get stable, low-latency connections to your central infrastructure.
Architecture: Hub-and-Spoke vs Full Mesh
Hub-and-Spoke (Recommended for Most Teams)
[HK Office] [Shanghai Office]
192.168.1.0/24 192.168.3.0/24
\ /
\ / (CN2 GIA)
[HK VPS Hub — 10.10.0.1]
/
/
[Singapore Office]
192.168.2.0/24
All branch offices connect to the central VPS hub. Traffic between branches routes through the hub. Simple to configure and manage; adding a new branch requires only a new peer on the hub server.
Full Mesh (For Low-Latency Direct Branch Communication)
Each office connects directly to every other office — no hub. Lower latency between branches but more complex configuration (N² peer relationships). Recommended only when direct branch-to-branch latency matters (e.g., real-time database replication between offices).
Prerequisites
- Hong Kong VPS with a public IP (the hub)
- A router at each branch office capable of running WireGuard, or a dedicated Linux machine at each site
- Non-overlapping private IP ranges at each location (e.g., 192.168.1.x for HK office, 192.168.2.x for Singapore, 192.168.3.x for Shanghai)
Step 1: Configure the Hub (Hong Kong VPS)
apt install wireguard -y
# Generate hub keys
wg genkey | tee /etc/wireguard/hub_private.key | wg pubkey > /etc/wireguard/hub_public.key
chmod 600 /etc/wireguard/hub_private.key
HUB_PRIVATE=$(cat /etc/wireguard/hub_private.key)
cat > /etc/wireguard/wg0.conf << EOF [Interface] PrivateKey = ${HUB_PRIVATE} Address = 10.10.0.1/24 ListenPort = 51820 # Enable routing between connected networks PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; \ iptables -A FORWARD -o wg0 -j ACCEPT; \ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; \ iptables -D FORWARD -o wg0 -j ACCEPT; \ iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE # Hong Kong Office Router [Peer] PublicKey = HK_OFFICE_PUBLIC_KEY AllowedIPs = 10.10.0.2/32, 192.168.1.0/24 PersistentKeepalive = 25 # Singapore Office Router [Peer] PublicKey = SG_OFFICE_PUBLIC_KEY AllowedIPs = 10.10.0.3/32, 192.168.2.0/24 PersistentKeepalive = 25 # Shanghai Office Router (CN2 GIA gives excellent connectivity) [Peer] PublicKey = SH_OFFICE_PUBLIC_KEY AllowedIPs = 10.10.0.4/32, 192.168.3.0/24 PersistentKeepalive = 25 EOF # Enable IP forwarding echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
sysctl -p
systemctl enable --now wg-quick@wg0
ufw allow 51820/udp
Step 2: Configure Each Branch Office
Hong Kong Office Router/Gateway
# Generate HK office keys
wg genkey | tee hk_office_private.key | wg pubkey > hk_office_public.key
cat > /etc/wireguard/wg0.conf << EOF
[Interface]
PrivateKey = $(cat hk_office_private.key)
Address = 10.10.0.2/24
# Route all inter-office traffic through the tunnel
PostUp = ip route add 192.168.2.0/24 dev wg0 # Singapore office
PostUp = ip route add 192.168.3.0/24 dev wg0 # Shanghai office
PostDown = ip route del 192.168.2.0/24 dev wg0
PostDown = ip route del 192.168.3.0/24 dev wg0
[Peer]
PublicKey = HUB_PUBLIC_KEY
Endpoint = YOUR_HK_VPS_IP:51820
AllowedIPs = 10.10.0.0/24, 192.168.2.0/24, 192.168.3.0/24
PersistentKeepalive = 25
EOF
systemctl enable --now wg-quick@wg0
Repeat the same pattern for Singapore (10.10.0.3/24) and Shanghai (10.10.0.4/24) offices, adjusting the IP addresses and routing rules accordingly.
Step 3: Configure Local Network Routing at Each Office
For other devices on the office LAN to reach remote offices, they need to route traffic through the office gateway. Add a static route on each office’s main router:
# On each office's main router/firewall:
# Route traffic for remote offices through the WireGuard gateway machine
# HK office main router — add routes to:
# Singapore network (192.168.2.0/24) via WireGuard gateway (192.168.1.254)
# Shanghai network (192.168.3.0/24) via WireGuard gateway (192.168.1.254)
# Most routers have a "static routes" configuration page
# Or via CLI on a Linux gateway:
ip route add 192.168.2.0/24 via 192.168.1.254
ip route add 192.168.3.0/24 via 192.168.1.254
Step 4: Verify Connectivity
# On HK VPS hub — check all peers are connected
wg show
# Expected output shows each peer with a recent handshake:
# peer: HK_OFFICE_PUBLIC_KEY
# endpoint: HK_OFFICE_PUBLIC_IP:PORT
# allowed ips: 10.10.0.2/32, 192.168.1.0/24
# latest handshake: 23 seconds ago
# transfer: 1.45 GiB received, 3.21 GiB sent
# From HK office — ping Singapore office device
ping 192.168.2.100
# From Singapore office — ping Shanghai office device
ping 192.168.3.50
# Check latency between offices via the hub
traceroute 192.168.3.50
Step 5: Split Tunnelling — Route Only Inter-Office Traffic
By default, the above configuration only routes inter-office traffic through the VPN. Internet traffic from each office continues to exit through that office’s local internet connection — this is split tunnelling, and it’s the correct design for site-to-site VPNs (you don’t want all of Singapore office’s internet traffic routing through Hong Kong).
# In each branch's wg0.conf, the AllowedIPs covers only:
# - The VPN subnet (10.10.0.0/24)
# - Other office subnets (192.168.2.0/24, 192.168.3.0/24)
# NOT 0.0.0.0/0 — that would route all internet through the hub
# This is already correct in the configuration above.
# Verify with:
ip route show table main | grep wg0
Step 6: DNS Resolution Across Sites
For devices to use hostnames rather than IP addresses across offices, set up cross-site DNS:
# Option A: Central DNS on the HK VPS hub
apt install dnsmasq -y
cat > /etc/dnsmasq.d/offices.conf << 'EOF'
# HK office devices
address=/hk-fileserver.company.internal/192.168.1.10
address=/hk-printer.company.internal/192.168.1.20
# Singapore office devices
address=/sg-fileserver.company.internal/192.168.2.10
# Shanghai office devices
address=/sh-fileserver.company.internal/192.168.3.10
EOF
systemctl enable --now dnsmasq
Configure each office’s DHCP server to push the VPS hub IP (10.10.0.1) as the secondary DNS server for .company.internal domains.
Monitoring the Site-to-Site VPN
# Monitor all peer connections and traffic
watch -n 5 'wg show'
# Alert if a peer goes down (cron-based)
cat > /opt/wg-monitor.sh << 'EOF'
#!/bin/bash
PEERS=("HK_OFFICE_KEY_PREFIX" "SG_OFFICE_KEY_PREFIX" "SH_OFFICE_KEY_PREFIX")
for PEER in "${PEERS[@]}"; do
HANDSHAKE=$(wg show wg0 latest-handshakes | grep "$PEER" | awk '{print $2}')
AGE=$(($(date +%s) - HANDSHAKE))
if [ $AGE -gt 180 ]; then # Alert if no handshake in 3 minutes
echo "WireGuard peer $PEER offline (last handshake ${AGE}s ago)" | \
mail -s "VPN ALERT" admin@company.com
fi
done
EOF
chmod +x /opt/wg-monitor.sh
crontab -l | { cat; echo "*/5 * * * * /opt/wg-monitor.sh"; } | crontab -
Latency Between Asian Offices via HK VPS Hub
| Route | Via HK VPS (CN2 GIA) | Direct internet |
|---|---|---|
| HK Office → Shanghai Office | 35–55ms (via hub) | 50–120ms (variable) |
| Singapore Office → Shanghai Office | 80–120ms (via hub) | 90–160ms (variable) |
| HK Office → Singapore Office | 70–100ms (via hub) | 50–80ms (direct) |
The hub adds one extra hop (office → hub → destination office), but CN2 GIA routing to mainland China means HK-Shanghai and Singapore-Shanghai traffic is often more stable and lower-jitter than direct internet routing, which varies significantly under load.
Conclusion
A WireGuard site-to-site VPN using a Hong Kong VPS as the hub securely connects your Asia-Pacific offices with an encrypted backbone that benefits from CN2 GIA routing to mainland China. The hub-and-spoke architecture keeps configuration simple — adding a new branch office requires only a new peer configuration on the hub, and CN2 GIA ensures the Shanghai office connection remains stable even during peak mainland China internet congestion hours.
Build your office network: Browse Server.HK Hong Kong VPS plans — a 2 GB plan handles WireGuard hub duties for 5–20 branch offices with minimal resource overhead.