Connect to your private network with WireGuard

WireGuard connects a server or workstation in your own environment to your private network's gateway. Once the tunnel is up, that machine reaches every SIM in the network on its static IP, for example to collect data, manage devices over SSH, or open a device's web interface. To connect a whole network instead, use IPsec.

WireGuard runs on your side, not on the deviceInstall WireGuard on the machine that needs to reach your devices. The devices with Simbase SIMs need nothing extra, only the private network APN. WireGuard doesn't give your devices a different IP address or change how they reach the internet.

How it works

  • Outbound only. Your machine opens a UDP connection to the gateway, and replies come back over that same connection. You don't open any inbound ports: your firewall only needs to allow outbound UDP to the gateway address and port in the config.

  • Split tunnel. Only traffic to your private network goes through the tunnel. The rest of the machine's traffic, including its internet access, is unchanged.

  • Gateway to device. From the gateway, traffic reaches the SIM over the mobile network, inside your private network. WireGuard covers only the part between your machine and the gateway.

Before you start

  • A deployed private network with SIMs assigned, see Private networks.

  • Devices set to the fixedip.us or fixedip.eu APN of your gateway.

  • A Linux, Windows or macOS machine that can send outbound UDP traffic.

Set up WireGuard

1. Generate a profile

  1. In the Simbase dashboard, open your private network.

  2. If the network has no WireGuard connector yet, click Add connector and choose WireGuard.

  3. Click Generate profile, enter a name, for example the hostname of the machine, and click Create profile.

  4. Download <name>.conf.

Download the config right awayThe config contains the profile's private key. Simbase doesn't store it, so you can't download the file again later. If you lose it, delete the profile and generate a new one. Store the file as you would a password.

You can create up to 5 profiles. Give each machine its own profile, so you can revoke one without affecting the others.

The config looks like this:

[Interface]
PrivateKey = <private key of this profile>
Address = <tunnel address of this machine>
​
[Peer]
PublicKey = <public key of your gateway>
AllowedIPs = <your private network subnets>
Endpoint = <gateway IP>:<port>
PersistentKeepalive = 25

2. Install WireGuard

  • Ubuntu or Debian, including Ubuntu on Amazon EC2: sudo apt install wireguard

  • Other Linux distributions, Windows and macOS: see wireguard.com/install.

3. Start the tunnel

On Linux:

sudo install -m 600 <name>.conf /etc/wireguard/simbase.conf
sudo wg-quick up simbase
sudo systemctl enable wg-quick@simbase

The last command starts the tunnel again after a reboot.

On Windows or macOS: in the WireGuard app, click Import tunnel(s) from file, select the .conf file, and click Activate.

4. Check the connection

  1. Check the tunnel. On Linux, run sudo wg show; in the app, open the tunnel. A latest handshake in the last few minutes means the tunnel to the gateway is up.

  2. Ping a SIM on its static IP, or connect to the service you need, such as SSH. Some devices don't answer ping even when they're reachable.

Troubleshooting

No handshake. The tunnel between your machine and the gateway isn't up.

  • Check that outbound UDP to the endpoint in the config is allowed by your firewall, and on Amazon EC2 by the security group and network ACL.

  • Check that the config file is unchanged and the profile still exists in the dashboard.

Handshake, but a SIM doesn't respond. The tunnel works, and the problem is between the gateway and the device.

  • Check that the SIM is Enabled. See SIM state.

  • Check that the device uses the fixedip.us or fixedip.eu APN of your gateway, and has reconnected since the APN was changed. Until it reconnects, it keeps using the old APN.

  • Check that the service on the device is running and that the device's own firewall allows traffic from your private network.

Common questions

No. WireGuard goes on the server or workstation that needs to reach your devices. The devices only need the private network APN.

No. It only connects your machine to the gateway. The devices keep their static IPs in your private network.

Up to 5. Use one per machine, so you can revoke access per machine.

WireGuard to connect a server or workstation and reach devices when you need to. IPsec for a permanent two-way tunnel between your own network and the gateway, see IPsec.

No. Private networks support WireGuard and IPsec.

  • Private networks: what a private network is, what it costs, and how to set one up

  • IPsec: a site-to-site tunnel between your network and the gateway

  • SIM state: enable and disable SIMs

  • VPN for IoT: when a VPN is worth it