There are three ways to watch your cameras when you are out: the manufacturer’s cloud, a port forwarded from the router to the NVR, or a VPN. Port forwarding is the riskiest: NVRs and cameras exposed directly are among the most searched targets for automated attacks. With WireGuard you expose a single UDP port protected by cryptographic keys, and everything else stays closed.
The three options compared
| Option | Pros | Cons |
|---|---|---|
| Manufacturer cloud or P2P | Easy, works behind CGNAT | Video and accounts go through third-party servers; you depend on the vendor’s updates |
| Port forwarded to the NVR | No extra software | The NVR web interface is exposed to the whole Internet: a weak password or old firmware is enough to get in |
| WireGuard VPN | One UDP port, key-based authentication, nothing visible without a key | Needs a one-time setup; behind CGNAT you need an extra step |
Where to run the WireGuard server
- On the router: many recent routers include it (for example FRITZ!Box with FRITZ!OS 7.50 or later, OpenWrt, OPNsense, pfSense). It is the simplest choice: you create the connection and the router generates the file or QR code for the phone.
- On Home Assistant: there is a WireGuard add-on. You then forward only its UDP port on the router.
- On an always-on mini PC or Raspberry Pi, with the
wireguard-toolspackage.
Do not run it on the NVR: even if it supports it, the recording device is better kept as a closed system.
Basic configuration
Each device has a key pair (private and public). The server knows the public keys of the authorised clients and only answers them: without a key it does not reply at all, so a port scan reveals nothing.
[Interface] # on the server
Address = 10.8.0.1/24
ListenPort = 51820
PrivateKey = (server private key)
[Peer] # the phone
PublicKey = (phone public key)
AllowedIPs = 10.8.0.2/32
[Interface] # on the phone
Address = 10.8.0.2/32
PrivateKey = (phone private key)
DNS = 192.168.1.1
[Peer] # the home server
PublicKey = (server public key)
Endpoint = home.example.com:51820
AllowedIPs = 192.168.1.0/24, 10.8.0.0/24
PersistentKeepalive = 25
- AllowedIPs on the phone: list only the home network (split tunnel) if you want to see the cameras without routing all traffic through home.
- Endpoint: if your public address changes, use a dynamic DNS name.
- Never share private keys or send them by email: create a separate profile for each phone, so you can revoke one without touching the others.
If your provider puts you behind CGNAT
If the router’s WAN address is in 100.64–100.127, or differs from what a “what is my IP” site shows, you are behind CGNAT and cannot receive IPv4 connections. Alternatives:
- IPv6: if your line has it, the WireGuard server can be reachable over IPv6, opening only its UDP port to that address in the firewall. The network you connect from needs IPv6 too. See IPv6 at home.
- A public IPv4 address from your provider, sometimes for a fee.
- A small external server (VPS) as a meeting point, or WireGuard-based services that handle NAT traversal.
Watching the cameras through the VPN
- In the NVR app or an ONVIF/RTSP app, use the NVR’s local address (for example
192.168.1.50), not the public one. - With Frigate or Home Assistant just open the local interface: see Frigate with Home Assistant.
- On mobile data use the low-resolution sub-stream: a 4K stream can exceed your home upload bandwidth.
Mistakes to avoid
- Leaving the old port-forwarding rules to the NVR in place after setting up the VPN.
- Leaving UPnP on: the NVR and cameras could open ports by themselves.
- Using the same configuration on several phones: lose one and you must redo everything.
- Forgetting to update the router or server that runs WireGuard.
- Using the home subnet for the VPN too (for example 192.168.1.0/24 for the clients): it causes routing conflicts.
For the other rules on camera networks see IP camera cybersecurity.
Sources
- WireGuard, quick start and protocol description.
- IETF, RFC 6598 (the 100.64.0.0/10 shared address space used for CGNAT).
