Skip to content

Network Routing (Port Forwarding)

While standard web traffic and text chat pass through your reverse proxy over HTTPS (port 443), real-time voice, video, and screen sharing establish a direct WebRTC connection between the user's device and the embedded LiveKit server inside your Spokes container.

(For a full breakdown of how signaling and WebRTC media routing work under the hood, see How Networking Works.)

Even if you use a reverse proxy or a Cloudflare Tunnel for the Web UI, you must forward the LiveKit media ports on your hardware router to your Spokes host's local IP address:

Purpose Protocol External (WAN) Port Internal (Host) Port Mapping Rule
LiveKit Media (UDP) UDP 30000 - 30007 30000 - 30007 Must match 1-to-1
LiveKit TCP Fallback TCP 7881 7881 Must match 1-to-1

If these ports are closed or translated to different port numbers (for example, forwarding WAN port 40000 to internal port 30000), WebRTC media negotiation will fail and voice connections will hang on "Connecting...".

Below are specific instructions for two popular prosumer firewall and router platforms: pfSense and UniFi.


To make sure voice and video work reliably through pfSense, forward both the UDP port range and the TCP fallback port to your Spokes Docker host.

  1. Log into your pfSense web interface.
  2. Navigate to Firewall > NAT > Port Forward.
  3. Click Add to create a new rule.

Configure the rule with the following settings:

  • Interface: WAN
  • Protocol: UDP
  • Destination: WAN address
  • Destination port range: 30000 to 30007 (or your custom UDP range)
  • Redirect target IP: The internal LAN IP of your Spokes server (e.g., 192.168.1.50)
  • Redirect target port: 30000 (must match the start of the Destination port range)
  • Description: Spokes LiveKit UDP
  • Filter rule association: Add associated filter rule

Save the rule.

Click Add again for the second rule:

  • Interface: WAN
  • Protocol: TCP
  • Destination: WAN address
  • Destination port range: 7881 to 7881 (or your custom TCP Fallback port)
  • Redirect target IP: The internal LAN IP of your Spokes server (e.g., 192.168.1.50)
  • Redirect target port: 7881 (must match the Destination port)
  • Description: Spokes LiveKit TCP Fallback
  • Filter rule association: Add associated filter rule

Save the rule, and click Apply Changes at the top of the screen.

pfSense Port Forwarding

Double NAT & Local Network Voice Chat in pfSense

Section titled “Double NAT & Local Network Voice Chat in pfSense”

Because LiveKit advertises your external Public IP during the WebRTC handshake, devices on the same local network as your Spokes server need your router to loop that traffic back inside (NAT Reflection / Hairpin NAT).

If you are stuck behind Double NAT on pfSense, you can make local voice chat work by creating a second pair of port forwarding rules targeting a DDNS alias, bringing the total to 4 rules:

  1. In pfSense, go to Firewall > Aliases.
  2. Create a new Host(s) alias (e.g., public_ip).
  3. Add your domain or DDNS hostname (e.g., spokes.yourdomain.com) to the alias and save.

Go back to Firewall > NAT > Port Forward. You already have your two standard rules targeting WAN address:

  • WAN | UDP | Destination: WAN address | Port: 30000-30007
  • WAN | TCP | Destination: WAN address | Port: 7881

Create two additional rules identical to the ones above, but change Destination from WAN address to Single host or alias and enter your public_ip alias:

  • WAN | UDP | Destination: public_ip | Port: 30000-30007
  • WAN | TCP | Destination: public_ip | Port: 7881

Edit all four rules, scroll down to NAT reflection, and set it to Enable (Pure NAT).

(Also make sure Enable automatic outbound NAT for Reflection is checked under System > Advanced > Firewall & NAT).

When a local user joins a voice channel, pfSense matches your resolved public IP against the public_ip alias and loops the UDP packets directly back to your internal Spokes server.


To configure port forwarding on a UniFi Dream Machine (UDM), Cloud Gateway, or USG:

  1. Log into your UniFi Network Controller.
  2. Navigate to Settings (Gear Icon) > Security > Port Forwarding (or Routing & Firewall in older versions).
  3. Click Create Entry.
  • Name: Spokes LiveKit UDP
  • Enabled: Checked
  • Interface: WAN (or Both)
  • From: Any
  • Port: 30000-30007 (or your custom UDP range)
  • Forward IP: The internal LAN IP of your Spokes server (e.g., 192.168.1.50)
  • Forward Port: 30000-30007 (must match Port)
  • Protocol: UDP

Save the rule.

Click Create Entry again:

  • Name: Spokes LiveKit TCP Fallback
  • Enabled: Checked
  • Interface: WAN (or Both)
  • From: Any
  • Port: 7881 (or your custom TCP Fallback port)
  • Forward IP: The internal LAN IP of your Spokes server (e.g., 192.168.1.50)
  • Forward Port: 7881 (must match Port)
  • Protocol: TCP

Save the rule. Your UniFi gateway will provision the rules automatically.

Local Network Voice Chat & Double NAT on UniFi

Section titled “Local Network Voice Chat & Double NAT on UniFi”