# Portal Cautivo Huawei.

Source: https://help.aiwifi.io/hardware-setup-guides/portal-cautivo-huawei

### Paso 1: Alta del Servidor RADIUS de AIWIFI

1. En el panel de Huawei, ve a **Design** &gt; **Template Management** &gt; **Policy Template**.
2. Selecciona **RADIUS Relay Server** en el menú izquierdo y haz clic en **Create**.
3. Configura el perfil:
    
    
    - **Name:** `RADIUS_AIWIFI`
    - **Authentication Server Address:** 3.135.4.246 . Puerto: **1812**.
    - **Accounting Server Address:** 3.135.4.246. Puerto: **1813**.
    - **RADIUS Key / Shared Secret:** mysecret
    - **Authentication Protocol:** Selecciona **PAP**.
4. Guarda la plantilla.

### Paso 2: Creación del Walled Garden (Sitios Exentos)

Para que las antenas Huawei dejen cargar el portal antes de que el usuario inicie sesión, crearemos la lista ACL.

1. En el menú de plantillas, ve a **ACL** y haz clic en **Create**.
2. **ACL Type:** Selecciona **User**.
3. Agrega las siguientes reglas (Rules):
    
    
    - **Regla 1 (DNS):** Protocolo `UDP`, Puerto Destino `53`, Action: `Permit` (Esencial para evitar pantallas en blanco).
    - **Regla 2 (Nube Huawei):** Permite el dominio `mx-device.naas.huaweicloud.com`.
    - **Reglas 3 a 12 (AIWIFI &amp; Redes):** Agrega los dominios FQDN.
    - `captive.aiwifi.io`
    - `storage1-prod-media.s3.us-east-2.amazonaws.com`
    - `api.aiwifi.io`
    - `connect.facebook.net`
    - `facebook.com`
    - `sentry.io`
    - `cloudfront.com`
    - `lr-ingest.io`
    - `doubleclick.net`
    - `fbsbx.com`
4. Guarda la plantilla ACL con el nombre `WALLED_GARDEN_AIWIFI`.

### Paso 3: Enlazar la URL del Portal AIWIFI

1. Ve a **Admission Resources** &gt; **Page Management** &gt; **URL Template** y haz clic en **Create**.
2. **Template Type:** Elige *Cloud platform-based relay authentication*.
3. Guarda los cambios básicos.
4. Ahora ve a la pestaña superior **Portal Page Push Policy** y haz clic en **Create**.
5. Configura la redirección:
    
    
    - **Match SSIDs:** Selecciona el SSID de tus clientes.
    - **Authentication Mode:** *Cloud platform-based relay authentication*.
    - **Interconnection Mode:** *RADIUS Relay*.
    - **URL Template:** Selecciona la plantilla que acabas de crear.
    - **Third-party authentication URL:** Pega la URL exacta de AIWIFI: `[http://captive.aiwifi.io] o (captive.aiwifi.io)`
6. Haz clic en **Apply**.

### Paso 4: Modificación del SSID en los APs AirEngine

1. Ve a **Provision** &gt; **Device Configuration** &gt; **Site Configuration** &gt; **AP** &gt; **Wi-Fi**.
2. Edita tu SSID existente.
3. En la pestaña **Security Authentication**:
    
    
    - **WLAN Security Policy:** Selecciona **Open Network**.
    - Activa la casilla **Open + Portal authentication**.
    - **Page Pushing Mode:** *Relay authentication by cloud platform*.
    - **Interconnection Mode:** *RADIUS Relay*.
    - **RADIUS Relay Server:** Selecciona tu perfil `RADIUS_AIWIFI` (Paso 3).
    - **Default Permit Rule (Walled Garden):** Selecciona tu ACL `WALLED_GARDEN_AIWIFI` (Paso 4).
4. Haz clic en **Save/Apply**.
