Use a Mikrotik as a wifi converter

The situation: You have a computer with no wifi, and you have an access point. No wifi, so no Internet. Sad face. But if you have a MikroTik router with a wifi interface and a couple of Ethernet interfaces, you can set up a private Ethernet network and connect your computer to wifi through the MikroTik.

The MicroTik wireless interfaces can be put into several different modes. The one we want here is “station” mode.

You will need the SSID and PSK for the wifi access point. For this article we’ll assume an SSID or “MYSSID” and a PSK of “mySecret”; substitute your own values as appropriate.

This article also assumes a MikroTik with a default configuration – a WAN port on ether1, the rest of the Ethernet ports and wlan1 bridged together, a DHCP server on the bridge.

Step 1: Take the wireless interface out of bridge-local

/interface bridge port
remove [find interface=wlan1]

Step 2: Set up a new security profile

/interface wireless security-profile
add name=station mode=dynamic-keys authentication-types=wpa-psk,wpa2-psk wpa-pre-shared-key="mySecret" wpa2-pre-shared-key="mySecret"

Step 3: Configure station mode

/interface wireless
set 0 mode=station ssid=MYSSID security-profile=station

After this step, the interface should change to “Running” status, but you won’t have any connectivity yet.

Step 4: Set up a DHCP client on the wireless interface

/ip dhcp-client add interface=wlan1 disabled=no

You should see an IP address appear on wlan1

Step 5: Set up NAT on the wireless interface

/ip firewall nat
add chain=srcnat action=masquerade out-interface=wlan1

There you go. Plug your Ethernet cable into one of the Ethernet ports on the router (not ether1 though 🙂 and you should have connectivity to the world.

3 thoughts on “Use a Mikrotik as a wifi converter

  1. Hi Karl
    De separately struggling to make the same thing work but on a single Ethernet port Mikrotik device named MAP Lite – basically a Ethernet to wifi sexy adapter.
    I have configured the same way as you did and the device manages to ping the internet but as soon as I plug an Ethernet laptop, after it gets its IP address in 172.16.9.0 network, this laptop cannot ping neither the internet nor even the wifi interface.
    I triad both with and without the WiFi and Ethernet interfaces bridged, same failing result.
    My IP addresses are :
    ISP main gateway 192.168.1.254
    MAP Wifi station (dhcp client) 192.168.1.230
    MAP Ethernet port (dhcp server) 172.16.9.5
    Laptop Ethernet 172.16.9.254
    I seem to miss a default route although 2 are already defined:
    0.0.0.0/0 192.168.1.254
    172.16.9.0/24 172.16.9.5 ether1
    192.0.0.0/8 192.168.1.230 wlan1

    Any idea?
    Thanks for all
    Hacen

    • Hullo Hacen.

      Could you please provide the routes on your laptop? And the output from “/ip dhcp-server network print detail” on the mAP?

      I’m guessing that your laptop has no default route; it should be sent the address of ether1 via DHCP.

      Regards, K.

    • One other thing – the network mask on your host network looks odd. Is it really 192.0.0.0/8? It probably should be 192.168.0.0/16, because not all of 192.0.0.0/8 is private (RFC1918) address space. That looks like a misconfiguration of the host network, and the mAP will be getting it from there.

      Regards, K.

Leave a Reply to kauer Cancel reply

Your email address will not be published. Required fields are marked *