routeros-hotspot

aiskillstore/marketplace

Hotspot captive portal в RouterOS: профили, walled garden, DHCP option 114, интеграция RADIUS.

Звёзды486
Форки53
Авторaiskillstore
Обновлённоя 17 2026

Установка

SKILL.md

RouterOS Hotspot

How Hotspot Chains Work

Hotspot traffic intercept runs before the regular firewall input/forward chains. This is the single most important fact to internalize:

  • /ip/hotspot binds to a bridge or interface — all traffic on that interface enters the hotspot chain first
  • Firewall rules blocking TCP 80/443 from the hotspot interface do NOT block the captive portal login page — hotspot handles it before the firewall sees it
  • RouterOS automatically injects dynamic firewall rules (hs-unauth, hs-auth chains) — do not manually create, remove, or interfere with these hotspot-managed rules

Common mistake: Adding a DROP rule for port 443 from bridge-hotspot to "fix a security gap" — this breaks the HTTPS login page silently.

Hotspot Profile

/ip/hotspot/profile/add \
  name=my-profile \
  hotspot-address=10.20.0.1 \
  login-by=https,mac,http-pap \
  mac-auth-mode=mac-as-username-and-password \
  dns-name=login.example.com \
  ssl-certificate=login.example.com.crt_0 \
  nas-port-type=ethernet \
  use-radius=yes \
  radius-accounting=yes \
  html-directory-override=hotspot-files

Key properties:

  • ssl-certificate= — reference the name after import (RouterOS appends _0 to imported certificate names)
  • nas-port-type= — use ethernet for wired hotspots and wireless-ieee-802-11-g for wireless hotspots
  • html-directory-override= — must match the exact folder name on the router's filesystem
  • login-by=https — serves the login page over HTTPS; requires www-ssl service enabled with the same certificate
  • use-radius=yes — when set, local /ip/hotspot/user entries are bypassed; adding them has no effect

Hotspot Instance

/ip/hotspot/add \
  name=hotspot1 \
  interface=bridge-hotspot \
  profile=my-profile \
  address-pool=pool-hotspot \
  addresses-per-mac=2 \
  idle-timeout=5m \
  keepalive-timeout=none \
  disabled=no

Note: keepalive-timeout=none disables the keepalive. keepalive-timeout=0 is NOT valid — it is ignored.

Note: RouterOS hotspot relies on NAT and is IPv4-only. IPv6 clients are not supported by the hotspot subsystem.

DHCP Option 114 — Captive Portal API (RFC 8910)

Option 114 (standardized 2020, RFC 8910) signals the captive portal URI to clients. It is underrepresented in LLM training data.

# force=yes is REQUIRED — without it, clients whose DHCP Parameter Request
# List does not include code 114 (e.g. iOS, Android) silently skip the option
/ip/dhcp-server/option/add \
  name=captive-portal \
  code=114 \
  force=yes \
  value="'https://login.example.com/api'"

/ip/dhcp-server/option/sets/add \
  name=captive-portal-set \
  options=captive-portal

/ip/dhcp-server/set my-dhcp-server dhcp-option-set=captive-portal-set

Option value syntax: outer double quotes, inner single quotes — "'https://...'". Missing inner quotes cause the option to be sent as a binary blob, not a string URI.

api.json timing: RouterOS creates hotspot/api.json only after the first client CAPPORT probe — not at hotspot enable time. Move it to the html-directory-override folder after first client connects:

# Handles both flash/ and non-flash storage layouts
:local srcPath "hotspot/api.json"
:local dstPath "hotspot-files/api.json"
:if ([:len [/file find name="flash"]] > 0) do={
  :set srcPath "flash/hotspot/api.json"
  :set dstPath "flash/hotspot-files/api.json"
}
:if ([:len [/file find name=$srcPath]] > 0) do={
  /file set [find name=$srcPath] name=$dstPath
} else={
  :log warning "api.json not yet created — run after first client CAPPORT probe"
}

Walled Garden

Use a consistent comment= tag for idempotent add/remove. Without it, repeated script runs accumulate duplicate entries.

# Remove only our entries, not manually-added ones
/ip/hotspot/walled-garden/ip/remove [find comment="my-wg"]

/ip/hotspot/walled-garden/ip/add dst-host=example.com   action=accept comment="my-wg"
/ip/hotspot/walled-garden/ip/add dst-host=*.example.com action=accept comment="my-wg"

IP vs HTTP walled garden:

  • /ip/hotspot/walled-garden/ip — layer 3 match by destination host, applied BEFORE authentication. Use for HTTPS destinations.
  • /ip/hotspot/walled-garden — layer 7 URL pattern match, requires HTTP. Does NOT work for HTTPS.

SSL Certificate Note

The hotspot profile references ssl-certificate=name.crt_0 (RouterOS appends _0 on import). Enable www-ssl with the same certificate:

/ip/service/set www-ssl disabled=no certificate=login.example.com.crt_0 tls-version=only-1.2

Quick import pattern:

/certificate import file-name=login.example.com.crt passphrase=""
/certificate import file-name=login.example.com.key passphrase=""
# After import, the certificate appears as login.example.com.crt_0

External Captive Portal — HTML Template Variables

RouterOS substitutes $(variable) server-side in any file under html-directory-override before serving it. These are not JavaScript variables — they are filled before the browser receives the page.

Servlet pages RouterOS serves (drop your own to override): login.html, flogin.html (failed-login), alogin.html (post-success), status.html, logout.html, error.html, redirect.html, rlogin.html, rstatus.html, fstatus.html, flogout.html, radvert.html, md5.js, errors.txt. Most external-CP setups only need login.html + alogin.html + status.html.

Most-used variables for external CP:

VariableDescription
$(link-login-only)Login POST endpoint without ?dst= — preferred for external auth (avoids double-encoding)
$(link-login)Login URL with ?dst= redirect appended
$(link-orig) / $(link-orig-esc)Original URL the client requested. Use -esc when interpolating into another URL
$(server-name)Hotspot instance name
$(mac) / $(mac-esc)Client MAC (raw / URL-escaped)
$(ip)Client IP
$(host-ip)IP from hotspot host table (differs from $(ip) under one-to-one NAT)
$(interface-name), $(vlan-id)Useful for tenant-aware external auth
$(error) / $(error-orig)Localized vs raw error from previous auth attempt
$(logged-in)yes if client is already authenticated
$(trial)yes if trial access still available for this MAC
$(username) / $(username-esc)Authenticated username (status page)
$(bytes-in[-nice]), $(bytes-out[-nice]), $(uptime[-secs]), $(session-time-left[-secs])Status-page counters
$(radius<id>[u]), $(radius<id>-<vnd-id>[u])Pass-through of RADIUS Access-Accept attributes — text or unsigned int. Empty / "0" when local-DB auth (use-radius=no)
$(http-header-<Name>)Read an incoming request header — e.g. $(http-header-User-Agent), $(http-header-Accept-Language)
$(if http-status == XYZ)MSG$(endif)Set the HTTP response status code
$(if http-header == NAME)VALUE$(endif)Set a custom response header (different syntax from the read pattern above)

Always pick the -esc variant ($(link-orig-esc), $(mac-esc), $(username-esc)) when embedding a value into a URL or query string. The non-escaped variants will break parsing or open injection paths if the value contains &, =, ?, #.

POST form fields RouterOS accepts at $(link-login-only): username, password, domain, dst, popup, session-id, var, erase-cookie, target (multi-language subdir).

Conditional syntax (server-side, not JavaScript):

$(if logged-in == "yes")
  <a href="$(link-logout)">Logout</a>
$(else)
  <form action="$(link-login-only)" method="post">...</form>
$(endif)

Operators: presence ($(if VAR)), ==, !=. Also $(elif ...). No nested arithmetic / string ops.

Generic login.html pattern for external captive portal:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="pragma" content="no-cache">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- External auth provider loads redirect logic -->
  <script src='https://auth.example.com/snippets/router-os/redirect'></script>
</head>
<body>
  <div id="entryPoint">Redirecting...</div>
  <script>
    window.addEventListener('load', function () {
      ExternalAuth_redirect(
        '$(server-name)', '$(mac-esc)', '$(link-login-only)',
        '$(link-orig-esc)', '$(error-orig)', '$(logged-in)', '$(ip)'
      );
    });
  </script>
</body>
</html>

The external provider authenticates the user and redirects the browser back to $(link-login-only) with username + password + dst POST fields. RouterOS validates (local DB or RADIUS), issues the auth cookie, and redirects to dst.

Walled-garden must include the external auth host (and any CDN/asset hosts) — otherwise the unauthenticated browser cannot reach the redirect script in step 2.

Full variable reference, all servlet pages, RADIUS pass-through patterns, multi-language target= mechanics, and HTTP response control: see references/template-variables.md.

Common LLM Mistakes

MistakeCorrect behavior
DROP TCP 443 from hotspot interfaceHotspot chain runs before firewall — breaks the HTTPS login page
keepalive-timeout=0 to disable keepaliveUse keepalive-timeout=none
Option 114 value= without inner single quotesMust be "'https://...'" — outer double, inner single
Option 114 without force=yesiOS/Android silently skip option if not in their DHCP PRL
Adding /ip/hotspot/user when use-radius=yesLocal users are bypassed when RADIUS is active
Wildcard HTTPS domains in /ip/hotspot/walled-gardenUse /ip/hotspot/walled-garden/ip for HTTPS (layer 3 match)
Hotspot on dual-stack network with IPv6Hotspot is IPv4-only — IPv6 not supported
$(link-login) treated as JavaScript variableIt is RouterOS server-side substitution, not JS
Embedding $(link-orig) / $(mac) / $(username) into another URLUse the -esc variant — non-esc breaks parsing on &, =, ? and may enable injection
Hotspot with PCC / multiple routing tablesHotspot uses only the default routing table — split-WAN setups need explicit /ip route rule for hotspot traffic

Additional Resources

Related skills:

  • routeros-fundamentals — RouterOS CLI syntax, REST API, scripting basics
  • routeros-certificates (in backlog) — for the full certificate chain handling pattern

MCP tools:

  • rosetta MCP server — /tool/ping, /ip/hotspot command tree inspection (routeros_search, routeros_get_page)

MikroTik docs:

  • HotSpot — official reference
  • DHCP Server — option 114 configuration

RADIUS Integration

See references/radius-client.md for RADIUS client configuration patterns.

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: routeros-hotspot](https://darkplay.ru/ai/skills/aiskillstore-marketplace-routeros-hotspot)

Из того же репозитория

when-profiling-performance-use-performance-profiler Система профилирования производительности, поиска узких мест и оптимизации. ★486 when-optimizing-agent-learning-use-reasoningbank-intelligence Адаптивное обучение с ReasoningBank: распознавание паттернов и оптимизация стратегий. ★486 when-optimizing-prompts-use-prompt-architect Фреймворк для анализа, создания и улучшения промптов на основе доказательных техник. ★486 when-optimizing-prompts-use-prompt-optimization-analyzer Диагностика промптов: оценка качества, поиск антипаттернов и лишних токенов. ★486 when-orchestrating-swarm-use-swarm-orchestration Оркестрация сложного роя агентов с декомпозицией задач и синтезом результатов. ★486 when-releasing-software-use-github-release-management Оркестрация релизов GitHub: версионирование, тестирование, деплой и откат. ★486 when-reviewing-github-pr-use-github-code-review Ревью pull request в GitHub с параллельным анализом специализированными агентами. ★486 when-reviewing-code-comprehensively-use-code-review-assistant Ревью PR с роем агентов: безопасность, производительность, стиль, тесты, документация. ★486

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

trailmarktrailofbits · Строит многоязычные графы исходного кода для анализа безопасности: графы вызовов, карту…
122 комп.
srclightanthropics · Глубокий индекс кода: символы, графы вызовов, семантика, 28 MCP-инструментов.
38 комп.
vitalsanthropics · Показатели здоровья кодовой базы: поиск горячих точек, диагностика по ROI, связность…
38 комп.
162-java-profiling-analyzejabrena · Анализ данных профилирования Java: флеймграфы, аллокации, горячие точки CPU, проблемы…
462 ★
fallowfallow-rs · Анализ мёртвого кода, дублирования и сложности с автоисправлением для…
2 комп.
tech-debtshipshitdev · Инвентаризация и приоритизация техдолга по частоте боли, а не по затратам на исправление.
39 ★
AgentHotspotAgentHotspot · Поиск тысяч MCP-коннекторов из маркетплейса AgentHotspot через ИИ-агента.
—
Biohotspot· Данные об океане для любой береговой зоны, факты о морских парках Австралии и…
—
Hotspot Creator Studio· Управление картами, точками и заработком Hotspot из вашего ИИ-ассистента.
—
io.github.attnstack/codegraphattnstack · Граф вызовов TS/JS-репозитория: кто вызывает, влияние с цепочками, трассировка, горячие…
—

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации изображений

Генерация изображений

Подборка нейросетей для генерации изображений от фотореализма до концепт-арта. Сервисы, которые экономят часы ручной работы, создавая визуал для блогов, рекламы и дизайна за минуты

MagviMagvi
По запросу
5.0
DALL-E 3OpenAI
По подписке
5.0
SupaLabSupalab
По запросу
5.0
Freestyling.aiFreestyling
Есть бесплатный тариф
4.9
ArtGeneration.meArtgeneration
Есть бесплатный тариф
4.9
BigjpgBigjpg
По запросу
4.9
Художник от VKVK
Бесплатно
4.9
Wonderink — ИИ-книги
Есть бесплатный тариф
4.8
Avato AI12ai
По запросу
4.8
Virton AIVirton
По запросу
4.8