يجب أن يكون نشر وضع الجسر لنقطة اتصال MikroTik المُنشأة بشكل صحيح غير مرئي للشبكة وواضح للمستخدم.
تشغيل MikroTik نقطة اتصال في وضع الجسر يتيح لك وضع صندوق RouterOS في شبكة طبقة-2 موجودة دون إعادة ترقيم أي شبكة فرعية. إذا تم ذلك بشكل صحيح، يكون غير مرئي للشبكة وواضح للمستخدم. إذا تم بشكل خاطئ، نصف عملائك لا يرون صفحة الترحيب والنصف الآخر يتجاوزها مباشرة.
هذه هي التكوين الدقيق الذي أنشره في المقاهي والنزل ومناطق نقاط اتصال مزودي خدمة الإنترنت الصغيرة، بالإضافة إلى الأخطاء التي تكلفني أكبر عدد من الاستدعاءات.
عندما يكون وضع الجسر هو الاختيار الصحيح
استخدم وضع الجسر عندما:
- البوابة وDHCP موجودان بالفعل ولا يمكنك تغييرهما (فندق، حرم جامعي، مبنى مشترك).
- تحتاج إلى أن تكون نقطة الاتصال قابلة للإزالة — اسحب الصندوق ولا تزال الشبكة تعمل.
- عدة نقاط وصول تشترك بالفعل في VLAN موحد وإعادة عنونتها غير متاحة.
استخدم وضع التوجيه بدلاً من ذلك عندما تمتلك الحافة بالكامل. التوجيه أبسط للفهم، وتختفي كل تذكرة "العملاء غير مرئيين".

الحد الأدنى من تكوين وضع جسر نقطة اتصال MikroTik العامل
/interface bridge add name=bridge-hotspot protocol-mode=none /interface bridge settings set use-ip-firewall=yes /interface bridge port add bridge=bridge-hotspot interface=ether2 add bridge=bridge-hotspot interface=ether3 /ip pool add name=hs-pool ranges=10.20.0.10-10.20.0.254 /ip dhcp-server add address-pool=hs-pool interface=bridge-hotspot name=hs-dhcp disabled=no /ip hotspot profile set [find default=yes] use-radius=yes login-by=http-chap,mac-cookie html-directory=hotspot /ip hotspot add address-pool=hs-pool interface=bridge-hotspot name=hotspot1 profile=default السطر الأكثر أهمية هو use-ip-firewall=yes. بدون ذلك، لا تدخل الإطارات المربوطة جدار الحماية IP — وتعيش قواعد إعادة توجيه نقطة الاتصال في جدار الحماية IP. كل شيء آخر قد يكون مثالياً ولا يزال العملاء يتجاوزون صفحة تسجيل الدخول.
المقايضة التي تستحق المعرفة:
use-ip-firewallيدفع حركة المرور المربوطة عبر مسار جدار الحماية، مما يرفع استهلاك المعالج على الأجهزة منخفضة الأداء. على hEX أو hAP ac² ستشعر به عند أكثر من حوالي 150–200 مستخدم متزامن. خطط لاستخدام CCR أو RB5009 فوق ذلك.
أين يجب أن يتواجد خادم DHCP
هذا هو الفشل الثاني الأكثر شيوعًا. ترى نقطة الاتصال العميل "نشطًا" فقط إذا تعلم ربط IP إلى MAC للعميل. إذا كان جهاز توجيه أعلى يوزع العناوين، يرى RouterOS عناوين MAC بدون عقود ويبقى جدول الجلسات فارغًا.
خياران صالحان:
- نقل DHCP إلى صندوق RouterOS (الموضح أعلاه) — أبسط وأكثر موثوقية.
- احتفظ بـ DHCP الأعلى وأضف
/ip dhcp-relayعلى الجسر حتى تمر العقود عبر RouterOS.
أساسيات الحديقة المغلقة
الأجهزة الحديثة تستكشف عنوان URL معروف لتحديد ما إذا كانت خلف بوابة مقيدة. احظر الاستكشاف وسيرى المستخدم "متصل، لا إنترنت" حتى بعد تسجيل دخول ناجح.
| المضيف | لماذا يهم |
|---|---|
connectivitycheck.gstatic.com | كشف بوابة Android وChromeOS |
captive.apple.com | كشف بوابة iOS وmacOS |
www.msftconnecttest.com | كشف بوابة Windows 10\/11 |
| نطاق بوابة الدفع الخاصة بك | يجب تحميل القسائم المدفوعة قبل المصادقة |
/ip hotspot walled-garden add dst-host=connectivitycheck.gstatic.com add dst-host=captive.apple.com add dst-host=*.msftconnecttest.com Add DNS to the IP-level walled garden too, otherwise name resolution for those hosts fails before HTTP is ever attempted:
/ip hotspot walled-garden ip add action=accept dst-address=8.8.8.8 protocol=udp dst-port=53 Bandwidth limits without a RADIUS server
For a single-site deployment that does not justify RADIUS yet, per-user rate limiting lives directly in the hotspot user profile – no separate queue configuration needed:
/ip hotspot user profile add name=guest-tier rate-limit=2M/8M shared-users=1 /ip hotspot user add name=guest01 password=<voucher-code> profile=guest-tier The rate-limit syntax here is rx/tx from the client’s perspective, which is the opposite convention from the Mikrotik-Rate-Limit RADIUS attribute discussed in the PPPoE/FreeRADIUS setup – worth double-checking if you run both hotspot and PPPoE on the same network, since mixing up the two conventions is an easy mistake. shared-users=1 stops one voucher code being pasted into three phones in the same café – raise it deliberately for a family-plan style voucher, never leave it unset by accident.
Branding the login page without breaking portal detection
The files under RouterOS’s نقطة اتصال HTML directory (referenced in the profile config above) are plain HTML/CSS, editable via Winbox’s file manager or SFTP. Two things break more login pages than anything else:
- Loading external assets (fonts, images, scripts) from the open internet before authentication. The walled garden blocks exactly this by design, so a login page referencing
fonts.googleapis.comrenders broken until every such host is added to the walled garden – or, simpler, host logo and font files locally inside the hotspot directory itself. - A login form that does not match the variable names RouterOS expects (
username,password, the hiddendstfield for post-login redirect). Start from the defaultlogin.htmltemplate and restyle it rather than rebuilding the form from scratch – the variable names are what actually authenticates the session, not the visual design around them.
Closing the common bypasses
MAC cloning. A user copies the MAC of an authorised device and inherits the session. Bind sessions to MAC و IP, and keep mac-cookie lifetimes short (a working day, not a month):
/ip hotspot profile set [find default=yes] mac-cookie-timeout=1d Static IP self-assignment. A user sets a manual address in your subnet and skips DHCP. Drop unauthenticated forwarding at the firewall:
/ip firewall filter add chain=forward src-address=10.20.0.0/24 hotspot=!auth action=drop \ comment="Block non-authenticated hotspot subnet" DNS tunnelling. Restrict outbound port 53 to the router itself and force clients through it:
/ip firewall nat add chain=dstnat protocol=udp dst-port=53 action=redirect to-ports=53 \ in-interface=bridge-hotspot Verifying the deployment
Work down this list before you leave site:
/ip hotspot active print— a freshly logged-in client shows MAC و IP. IP missing means DHCP placement is wrong./ip hotspot host print— unauthenticated devices should appear here. Empty table meansuse-ip-firewallis off.- Connect an iPhone and an Android handset. Both should auto-open the portal. Only one working means a walled-garden entry is missing.
- Set a manual IP on a laptop. It must have no internet.
/tool profileunder load — if the firewall process is pegged, the hardware is undersized for bridge mode.
RADIUS: when to add it
For a single site, local hotspot users are fine. Move to RADIUS the moment you have more than one site, need per-plan bandwidth profiles, or want usage accounting for billing. FreeRADIUS with a MySQL or PostgreSQL backend handles thousands of concurrent sessions on modest hardware, and rate limits arrive as a Mikrotik-Rate-Limit attribute rather than being hard-coded per router.
That is exactly the layer NexaLink automates — plans, vouchers, and per-user rate limits pushed to every RouterOS box from one panel.
Troubleshooting: portal loads but login fails
This specific symptom – the splash page itself renders, but submitting credentials does nothing or errors – has a short, ordered list of real causes:
- Clock skew between RouterOS and the browser’s device. Hotspot authentication is time-sensitive (the MD5-CHAP challenge has a short validity window); a RouterOS clock that drifted because NTP is misconfigured causes logins to silently fail. Check
/system clock printand confirm NTP client is enabled. - A stale session for the same MAC still active. Check
/ip hotspot active printfor a zombie session from a previous disconnect that never cleaned up – remove it manually and retry. - HTTPS redirect loop on modern phones. iOS and Android both now prefer HTTPS by default, and a captive portal cannot terminate HTTPS for domains it does not hold certificates for. Confirm
/ip hotspot profilehaslogin-by=http-chap,mac-cookie(not HTTPS-only) and that the walled garden entries use plain HTTP where the OS portal-detection probe expects it.
Field checklist
-
use-ip-firewall=yeson bridge settings - DHCP on the RouterOS box or relayed through it
- Walled garden covers Android, iOS, Windows, DNS, payment gateway
- Forward drop rule for
hotspot=!auth - Portal tested on two phone platforms and a laptop
- Configuration exported and stored off-box
Get those six right and the hotspot stops generating tickets.
