58 lines
1.7 KiB
Bash
Executable File
58 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# Script para configurar puertos UDP para LiveKit local
|
|
|
|
echo "🔧 Configurando puertos UDP para LiveKit..."
|
|
|
|
# Verificar si ufw está disponible
|
|
if command -v ufw &> /dev/null; then
|
|
echo "Configurando con UFW..."
|
|
|
|
# Puertos TCP para LiveKit API
|
|
sudo ufw allow 7880/tcp comment "LiveKit API"
|
|
|
|
# Rango de puertos UDP para WebRTC (según livekit.yaml)
|
|
sudo ufw allow 50000:60000/udp comment "LiveKit WebRTC UDP"
|
|
|
|
# Verificar reglas
|
|
echo "Reglas UFW configuradas:"
|
|
sudo ufw status numbered
|
|
|
|
elif command -v firewall-cmd &> /dev/null; then
|
|
echo "Configurando con firewalld..."
|
|
|
|
# Puerto TCP para LiveKit
|
|
sudo firewall-cmd --permanent --add-port=7880/tcp
|
|
|
|
# Rango UDP para WebRTC
|
|
sudo firewall-cmd --permanent --add-port=50000-60000/udp
|
|
|
|
# Recargar firewall
|
|
sudo firewall-cmd --reload
|
|
|
|
echo "Reglas firewalld configuradas:"
|
|
sudo firewall-cmd --list-ports
|
|
|
|
else
|
|
echo "⚠️ No se detectó UFW ni firewalld"
|
|
echo "Configurar manualmente:"
|
|
echo "- TCP 7880 (LiveKit API)"
|
|
echo "- UDP 50000-60000 (WebRTC media)"
|
|
fi
|
|
|
|
echo "✅ Configuración de firewall completada"
|
|
|
|
# Verificar que LiveKit esté corriendo
|
|
echo "🔍 Verificando LiveKit..."
|
|
if curl -s http://localhost:7880 > /dev/null 2>&1; then
|
|
echo "✅ LiveKit responde en puerto 7880"
|
|
else
|
|
echo "❌ LiveKit no responde - verificar que esté corriendo"
|
|
fi
|
|
|
|
# Mostrar puertos abiertos
|
|
echo "📊 Puertos actualmente en uso:"
|
|
if command -v ss &> /dev/null; then
|
|
ss -tulnp | grep -E "(7880|50000|60000)"
|
|
elif command -v netstat &> /dev/null; then
|
|
netstat -tulnp | grep -E "(7880|50000|60000)"
|
|
fi |