jaguile
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Configuració de Mikrotik com a Hotspot https://wiki.mikrotik.com/wiki/Manual:Wireless_AP_Client ## Conceptes previs ### Wireless Access point vs Wireless station 1. Wireless Access Point (AP): - Funció Principal: L'AP és responsable de crear una xarxa sense fil i permetre que els dispositius es connectin a aquesta xarxa. - Operació: Els dispositius com ordinadors portàtils, telèfons intel·ligents o altres dispositius sense fil es connecten a l'AP per obtenir accés a la xarxa local o a Internet. - Rang d'Acció: S'estableix per proporcionar cobertura sense fil en una àrea determinada, com ara una llar, una oficina o un lloc públic. 2. Wireless Station (Estació Sense Fil): - Funció Principal: Una estació sense fil (o Wireless Station) és un dispositiu que es connecta a un AP per accedir a la xarxa sense fil. - Operació: En lloc de crear una xarxa sense fil, una estació sense fil es connecta a un AP existent per obtenir accés a la xarxa. Pot ser utilitzada, per exemple, per connectar un ordinador sense fil a un AP a llarga distància. - Rang d'Acció: Sol ser un dispositiu mòbil o estacionari que s'utilitza per connectar-se a una xarxa existent. ## Altres modes d'access point a *Mikrotik* https://wiki.mikrotik.com/wiki/Manual:Wireless_Station_Modes https://blog.nestwireless.co.uk/2021/03/28/mikrotik-wireless-modes/ ### Alignment only Per alinear l'antena de l'access point. ### Ap bridge Access point en el seu mode normal, el qual permet fer de pont (*bridge* - Capa 2) entre la targeta wireless de l'access point i els ports ethernet. ### Bridge Igual que *Ap bridge* però en aquest cas només es pot connectar un client wireless (*Pont to point mode*). Per exemple, útil quan volem (en mode bridge) unir dos xarxes wireless. ### Nstream dual slave per activar el protocol *Nstream dual slave* propietari de *Mikrotik*. Calen dos punts d'accés en aquest mode, els quals treballaran conjuntament però en dos canals de freqüència diferent. Un dels access point servirà per la transmissió de dades i l'altre per la recepció de dades, per la qual cosa la xarxa wireless creada serà *full duplex*. ### Station El punt d'accés és un client wireless. > For example if you wish to connect multiple devices behind a MikroTik router when connecting to a hotel WiFi system but make them believe only one device is connected use ‘station‘ mode and operate behind a NAT firewall configuration using a new dhcp server based network on the ethernet side. This would allow you to connect to the hotel WiFi with the one single MAC Address but have multiple devices connected. In situations where hotels operate a captive portal using voucher codes, this allows one to operate multiple devices from one single voucher provided by the front desk. ### Station bridge En aquest mode el punt d'accés tant actua com a client wireless (station) i com a *ap bridge*. Es fa a partir d'un protocol propietari de *Mikrotik* i és necessari que els dos punts d'accés siguin d'aquest fabricant. ### Station pseudobridge Aquest mode permet que un *access point* es connecti a un altre que no soporta *bridging* i doni accés a un client seu a la xarxa de *l'access point* mitjançant capa 2 (amb una traducció ipv4 a MAC). ### Station WDS Aquest mode és propietat de *Mikrotik* i **només funciona si els dos dispositius (en el que hem configurat aquest mode i al que es connecta) són d'aquesta marca**. En aquest mode l'access point es connecta a un altre creant una pseudo interfície (WDS Interface) per la connexió punt a punt amb l'altre access point a la vegada que té activa l'altra interfície per oferir xarxa als seus clients. ### WDS Slave Aquest mode permet que el punt d'accés s'afegeixi a la xarxa wireless per extendre-la. L'altre dispositiu ha d'acceptar connexions WDS (s'ha de configurar previament en el *master* el mode WDS). ## WDS - Wireless distribution system > Básicamente es la forma de conectar dos dispositivos, como pueden ser routers o puntos de acceso. Esto va a permitir un par de acciones: > * Ampliar la cobertura de un SSID emitido por un router > * Conectar dos dispositivos para interconectar diferentes subredes ## Primer contacte amb Mikrotik Em baixo versió de *Winbox 3.40* i em conecto amb un fuetó de xarxa al Mikrotik pel port 2 (per defecte el port 1 té capat l'accés per ip i per MAC). ### Backup de la configuració ``` [admin@MikroTik] > system backup save name=default.conf ``` ### Fer un reset de fàbrica https://www.youtube.com/watch?v=H-UZay-k7J0 ### Configuració en blanc ``` System > Reset configuration ``` ![imatge](https://hackmd.io/_uploads/Bkx0J-W46.png) ## Mikrotik com a Wireless Station https://sanisimov.com/2019/02/connect-mikrotik-router-to-a-wifi-access-point-and-serve-internet-via-ethernet-and-wifi/ **Atenció**: En aquest apartat hi ha documentat com connectar-se a la xarxa principal a través de la Wi-fi. Si es vol connectar per cable, els passos 1 a 3 ja no s'han de fer. I en el pas 4, hem de canviar la interfície `wlan2` per `eth1`. 1. **Configurem les credencials per connectar-nos a la wifi principal.** Afegim un nou perfil a *Security Profile*. Aquest perfil té les credencials de la wifi amb la que em vull connectar (Al perfil creat li he ficat de nom el nom de la wifi): ``` Wireless > Security Profiles ``` ![imatge](https://hackmd.io/_uploads/SySweJGV6.png) 2. **Afegeixo una interfície Wireless per on connectar-me a la wifi principal.** La idea és crear una interfície virtual (*wlan2*) en mode *station* per a que es connecti a la xarxa i mantenir la real que tenim per defecte (*wlan1*) per permetre que se'ns connectin clients *wireless*. Altres opcions serien * Si els dos access point són Mikrotik: * Station bridge * Station WDS * Si l'altre accés point té habilitat el mode WDS * WDS Slave Amb el *Mikrotik hap lite* aquesta interfície `wlan2` ha de ser virtual i ha de penjar de `wlan1`. No puc fer servir `wlan1` per connectar-me ja que aquesta la faré servir per a que es connectin els meus clients: ![imatge](https://hackmd.io/_uploads/rJ55ZkGNa.png) He de ficar *wlan2* en mode `station` (a diferència de `wlan1`, que està en mode `ap bridge`) i li he d'aplicar el *Security profile* creat abans: ![imatge](https://hackmd.io/_uploads/rJJ0ZkzNT.png) 3. **Connexió a la wifi princial.** Ara m'he de connecar a la wifi principal des de `wlan2`: ``` Wireless > Wifi Interfaces > Scanner > start ``` `Scanner` em llista les wifis que hi han al voltant. Escollo la interfície `wlan2`, la wifi a la que em vull connectar i li dono a `Connect`. 4. **Configurar el dhcp client per wlan2** ``` 'Ip > dhcp Client >' ``` Afegeixo un client *dhcp* per `wlan2`. 5. **Provo connexió a internet** ``` [admin@MikroTik] > ping 8.8.8.8 SEQ HOST SIZE TTL TIME STATUS 0 8.8.8.8 56 118 20ms 1 8.8.8.8 56 118 17ms 2 8.8.8.8 56 118 14ms 3 8.8.8.8 56 118 15ms 4 8.8.8.8 56 118 15ms 5 8.8.8.8 timeout sent=6 received=5 packet-loss=16% min-rtt=14ms avg-rtt=16ms max-rtt=20ms ``` 6. **Provem. Connectem dispositiu a la wifi Mikrotik** **Important**: assegurar-se que no s'hagi desconfigurat `wlan1` ni el *Security profile* que té per defecte (no el que hem creat abans). Ara no tenim internet. Hem d'escollir com a interfície WAN la *wlan2* que és la que està connectat a la wifi principal: ``` Interfaces > Interfaces List > wlan2 ``` ![imatge](https://hackmd.io/_uploads/rkxCxZzNa.png) 7. **Configurar Mikrotik amb regla NAT** ``` IP > Firewall > NAT ``` Afegim una regla NAT. ![imatge](https://hackmd.io/_uploads/rkTfWbzN6.png) 8. **Backup de la configuració fins aleshores** Backup binari i backup en format text (script per exportar la configuració a d'altres dispositius), respectivament: ``` [admin@MikroTik] > system backup save name=wireless_station [admin@MikroTik] > export file=wireless_station ``` **Nota**: Per restaurar una configuració de la qual tinc backup: ``` Files > Escollo backup > restore ``` ## Mikrotik com a Hotspot 9. **Anem a crear el Hotspot** Anem a fer que els dispositius que es connectin pel Hotspot ho facin per un altre rang d'ip, diferent del que estem oferint per accés als ports ethernet. Per exemple, la 172.16.0.0/24. **Important**: Com que la *wlan1* està vinculada al bridge on hi han els ports d'ethernet, i aquesta interfície bridge ja té una ip (la 192.168.88.1), desvinculem *wlan1* del bridge. ``` Bridge > ports ``` Seleccionem wlan1 i la treiem. A l'hora de crear el Hotspot ja configurem el seu servei *dhcp*. O sigui que no cal configurar el servei *dhcp* a part. ``` Ip > Hotspot > Servers > Hotspot Setup ``` ![imatge](https://hackmd.io/_uploads/ry89L-G4T.png) ![imatge](https://hackmd.io/_uploads/Bkttvbz4p.png) Aquí m'ha donat error: *Invalid address*. És perquè li he de donar la ip del hotspot, no la ip de la xarxa. Després escollo el rant d'ip a donar pels dispositius que es connectin al hotspot. Donaré de la 100 a la 254. No seleccionem certificat ni SMTP server. De DNS, afegim el 8.8.8.8. Com a DNS name, hem de donar el nom de domini a través del qual ens connectem al hotspot (per exemple, *aguileraj.cat*). En l'últim pas, em demana un primer usuari per entrar al Hotspot. Ens haurà creat un *pool* d'adreces per entrar via *Hotspot*. Mireu el nom del *pool*. **Important** - Si estem fent servir una interfície wireless virtual per connectar-nos a la xarxa, anem en cura de que al generar el hotspot no ens modifiqui la interfície wireless principal com a *station*. 10. **Configuro com es validen els usuaris** ``` Ip > Hotspot > Server Profiles ``` Escullo el hotspot fet, vaig a `login` i marco *HTTP Chap* i *HTTP PAP*, *HTTPS* i desmarco les *cookies* (com a mínim, marcar PAP): ![imatge](https://hackmd.io/_uploads/r1TxWzfNa.png) 11. **Genero un usuari més** ``` Ip > Hotspot > Users ``` ![imatge](https://hackmd.io/_uploads/BJ9ObfMVa.png) 12. **Generem els plans d'Internet pels respectius usuaris** ``` Ip > Hotspot > User Profile ``` ![imatge](https://hackmd.io/_uploads/rJFnfzzVT.png) **Important:** La *m* de mega ha d'anar en minúscula. 13. Generem els plans als diferents usuaris Associem cada usuari al pla (*Profile*) que li toca. ![imatge](https://hackmd.io/_uploads/r1uuXGMEa.png) 14. **Provem** El dispositiu que tinc connectat a la wifi del Mikrotik ha deixat de tenir internet. Si obro navegador i escric `aguileraj.cat` se m'hauria d'obrir la pàgina principal del hotspot (desconnecta't de les dades): ![imatge](https://hackmd.io/_uploads/H1QQUfMNT.png) Si escric un dels usuaris, ja tindré internet. 15. **Customització de la pàgina d'entrada** Des de `Files` podem accedir a la pàgina que et mostra el hotspot. La podem modificar al nostre gust. 16. **Fem backup de la configuració** 17. **Restaurem la configuració per defecte** ``` System > Reset configuration ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully