Setup a guest Wifi Hotspot using Yocto

  • 0

Setup a guest Wifi Hotspot using Yocto

In this tutorial we will show how to setup a guest Wifi hotspot and configure it to restrict the internet access to only web surfing.

We will showcase this setup using Poky/Yocto as Linux distribution and connman as network manager. As hardware we will use:

  • Raspberry-Pi
  • Beaglebone-black

For both boards we will use a Realtek RTL8192CU based Wifi USB dongle.


Yocto Layers Setup

First we clone Poky repository:

Add the meta-raspberrypi layer:

Enable it in bblayers.conf:

Beaglebone Black machine configuration is already contained in Poky so no need for other layers unless you want to build it for other hardware not supported in those layers.


Kernel Configuration

In order to support tethering, the following kernel configuration options
need to be enabled either as modules (m) or builtin (y):

For routing and statistic support , the following options need to be enabled as modules (m) or builtin (y):

Finally the RTL8192Cu driver option need to be enabled as modules (m) or builtin (y):

You can use kernel fragments to set the configurations above.

Also make sure that ip_tables module is autoloaded by setting in kernel recipe or local.conf:


Yocto Recipes

Your image recipe must include connman and connmanctl packages:

Rtl8192cu firmware package must be also included:

Ready to build an image either for the Bone or the Pi:

Now we can write the output image to an SD card and start the corresponding board to setup tethering in connman.

Connman Setup

Plug in a Network cable on Ethernet interface and configure NAT(Network Address Translation):

Enable Wifi:

Finally activate tethering for Wifi using EmbexuSpot as SSID and 12345678 as password:


Firewall Setup

To restrict guest to browse only internet (No bittorrent, No nasty stuffs) we configure the firewall with the following rules:

This will allow only http/https traffic and drop everything else.