How to password protect the WiFi Hotspots created by the LibreRouter network?

There are many reasons why your community might want to password protect the LibreRouter network. We designed the LibreRouter with an ethos of solidarity, especially for networks where access is open, so by default the WiFi is not password protected. There is currently (2020 July) no graphical interface for setting a WiFi password in LibreRouterOs. A password can be set by editing certain files and running commands, explained below.

How to add a password to LibreRouter WiFi

The “correct” way of doing this is using the libremesh configs, for example by adding the following to /etc/config/lime-community. In this example, the new WiFi password is SuperSecreto and WPA2-Home encryption is used:

config lime 'wifi'
	option ap_key 'SuperSecreto'
	option ap_encryption 'psk2'
	option apname_key 'SuperSecreto'
	option apname_encryption 'psk2'

Then run lime-config, then reboot.

For more information, all the lime config options are documented with examples here: https://github.com/libremesh/lime-packages/blob/master/packages/lime-docs/files/lime-example . And here is the more general overview on configuring LibreMesh https://libremesh.org/docs/en_config.html . As of 2020-July-9, that overview is outdated as it does not explain lime-node and lime-community.

We are using one LibreRouter for wifi in a home. It will not be part of a mesh network. We want to put a password on the WiFi. What options will work?

  • LibreRouterOS
    • ssh thisnode.info, then use uci commands to set the wifi password
    • build LibreRouterOS firmware with a config file that sets wifi password
    • none of these?

I see the post Can I put my own firmware on it? – that post explains some details about OpenWrt on the LibreRouter. I have moved some parts of my post to that thread.

We just upgraded to LibreRouterOS 1.2 and used uci to set a WiFi password. Here’s what we did. Assumptions: We have already done the FirstBootWizard, and we named our network LaSuperRed and our node MiCasa.

  1. ssh root@thisnode.info
  2. uci show wireless
  3. We looked at the output, and found the two lines that defined SSIDs:
    3.1. wireless.lm_wlan0_apname_radio0.ssid='LaSuperRed/MiCasa'
    3.2. wireless.lm_wlan0_ap_radio0.ssid='LaSuperRed'
  4. Based on that, we issued the following commands:
  5. uci set wireless.lm_wlan0_apname_radio0.key='SuperSecreto'
  6. uci set wireless.lm_wlan0_apname_radio0.encryption='psk2+ccmp'
  7. uci set wireless.lm_wlan0_ap_radio0.key='SuperSecreto'
  8. uci set wireless.lm_wlan0_ap_radio0.encryption='psk2+ccmp'
  9. uci changes (this shows us that our changes are ready to commit)
  10. uci commit (or you could use uci commit wireless, in this case the result is the same)
  11. reboot

Now both SSIDs require the password SuperSecreto.

For more documentation, see Wi-Fi /etc/config/wireless.

Maybe this way of setting the password is unreliable?

The problem editing directly /etc/config/wireless is that if you run lime-config because you want to change some libremesh config then the wireless configuration will be lost (as it will be recreated without password).
The “correct” way of doing this is using the libremesh configs (for example editing /etc/config/lime-community and add the following:

config lime 'wifi'
	option ap_key 'SuperSecreto'
	option ap_encryption 'psk2'
	option apname_key 'SuperSecreto'
	option apname_encryption 'psk2'

And then run lime-config and reboot.

For more information all the lime config options are documented with examples here: https://github.com/libremesh/lime-packages/blob/master/packages/lime-docs/files/lime-example . And here is the more general overview on configuring libremesh https://libremesh.org/docs/en_config.html . It is outdated as it does not explain about lime-node and lime-community yet.

1 Like

Thanks @SAn, I’ve updated the wiki post :slight_smile:

1 Like