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.)
Required Port Forwarding Rules
Section titled “Required Port Forwarding Rules”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.
pfSense Specifics
Section titled “pfSense Specifics”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.
Port Forwarding (NAT)
Section titled “Port Forwarding (NAT)”- Log into your pfSense web interface.
- Navigate to Firewall > NAT > Port Forward.
- Click Add to create a new rule.
Rule 1: UDP Range
Section titled “Rule 1: UDP Range”Configure the rule with the following settings:
- Interface: WAN
- Protocol: UDP
- Destination: WAN address
- Destination port range:
30000to30007(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.
Rule 2: TCP Fallback
Section titled “Rule 2: TCP Fallback”Click Add again for the second rule:
- Interface: WAN
- Protocol: TCP
- Destination: WAN address
- Destination port range:
7881to7881(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.

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:
Step 1: Create a DDNS Alias
Section titled “Step 1: Create a DDNS Alias”- In pfSense, go to Firewall > Aliases.
- Create a new Host(s) alias (e.g.,
public_ip). - Add your domain or DDNS hostname (e.g.,
spokes.yourdomain.com) to the alias and save.
Step 2: Duplicate Rules with the Alias
Section titled “Step 2: Duplicate Rules with the Alias”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
Step 3: Enable Pure NAT Reflection
Section titled “Step 3: Enable Pure NAT Reflection”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.
UniFi Specifics
Section titled “UniFi Specifics”To configure port forwarding on a UniFi Dream Machine (UDM), Cloud Gateway, or USG:
Creating Port Forwarding Rules
Section titled “Creating Port Forwarding Rules”- Log into your UniFi Network Controller.
- Navigate to Settings (Gear Icon) > Security > Port Forwarding (or Routing & Firewall in older versions).
- Click Create Entry.
Rule 1: UDP Range
Section titled “Rule 1: UDP Range”- 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.
Rule 2: TCP Fallback
Section titled “Rule 2: TCP Fallback”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.
