In earlier days I participated in Wireless Leiden, an initiative to cover Leiden with a freely accessible wifi-network. The time has come to dismantle the network. A lot of still usable material remains and before sending it to Third World parties to experiment with it the idea was to test it. In particular the omni-directional antennes used for local signal distribution were suspect: these were filled up with water.
Also available were Ubiquity Bullet2 units that can be set up as an access point. Although they are by now replaced by newer models they are quite suitable for the job. The Bullet2 is powered over ethernet, PoE. This means that a power injector is needed from which an utp-cable leads to the Bullet2 that carries the power. On the other side of the injector is a “normal” cable that in this case is connected via an Edimax EU-4208 USB to ethernet adapter.
In order to do this I needed a reliable manner I decided to make a small and portable set-up, that would be powered from a 12 Volt battery such as in my camper. A platform I am familiar with is the Raspberry Pi so that was the starting point.
Rasberry Pi as router
The Bullet2 setup is done with an internet browser. It uses the static IP-address 192.168.1.20. When the USB to ethernet adapter is plugged into the Raspberry Pi it would be addressable as eth1
.
The Raspberry Pi has a fresh Raspios Bullseye installation. The following steps configure the network part for eth1
with a subnet on 192.168.1.1
with netmask 255.255.255.0
and provided with DHCP. The latter makes sure that newly attached devices will automatically acquire an internet address within that subnet.
Create/edit eth1
network interface /etc/network/interfaces.d/eth1
with the following content
auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
After a reboot the network should be visible with ifconfig
and in fact one can now connect to the Bullet2 using the internet browser on the Raspberry Pi and open 192.168.1.20
.
To configure the DHCP server we use the ISC software. Instructions on how to configure are derived from the article Using Raspberry Pi as a Wired Router. The software is available as a package:
sudo apt update
sudo apt install isc-dhcp-server
Some error messages will appear but these can be ignored. The configuration file is /etc/dhcp/dhcpd.conf
. Following changes are done.
- Domain name, some local name, and domain name server, Google’s, are not really required, but makes it complete.
# option definitions common to all supported networks...
option domain-name "rpi.local";
option domain-name-servers 8.8.8.8;
- Make the DHCP server authoritive
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
- At the end give the configuration specification
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.50 192.168.1.240;
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
}
To complete, also the file /etc/default/isc-dhcp-server
needs to be modified so that it is told which interface to look at.
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="eth1"
INTERFACESv6=""
After a reboot the server should be running as can be verified by plugging in a device and see that IP-address it gets. One may install a firewall and packet forwarding but for the present purpose that is not needed.
Ubiquity Bullet 2 as bridge access point
With the unit attached to the Raspberry Pi through the USB to ethernet adapter the configuration can be opened by browsing to 192.168.1.20
. Enter ubnt
for both user name and password and set the country to log in to the device. After hitting the Wireless
tab, one may set up the unit as an access point.
The changes that are done here are (1) Wireless mode
to Access Point
, (2) the Channel number
, here 3, and the Output Power
. The rest can be left unchanged.
Then hit the network tab to configure the configuration as a bridge.
The changes are minimal. Set the Network Mode
to Bridge
and add some ip addresses in the Network Settings
section.
After changes have been made hit the Change button below and follow the on-screen instructions to finalize. On the Bullet2 the red light will flash. Now a device can associate with the network and connect to the Raspberry Pi.
Web site on Raspberry Pi
A quick way to browse to a web site on an associated device is to turn the Raspberry Pi into a web server. This can be done by installing lighttpd. Also this software is available as a package.
sudo apt update
sudo apt install lighttpd
sudo cp /usr/share/lighttpd/index.html /var/www/html
The last line is needed to make index.html visible, this is probably a bug of the present installation and may not be needed later.
Kismet monitoring tool
On the same Raspberry Pi we may install Kismet so that the signal quality can be assessed. To achieve this a wireless USB dongle is needed as the built-in wifi system does not support monitoring. The Edimax 7811un is suited for this job. When plugged in to a Raspberry Pi4 it appears as wlan1.
Installation is described for a Raspberry Pi in various places albeit that the description my the authors is sufficient, see here. It installs from a package. Once installed, it can be started by
kismet -c wlan1
Subsequently open a web browser on an associated device and open
192.168.1.1:2501
At first instance, a name and password is to be set. After that the screen fills with found wireless devices.
Limit the view to access points only and then scroll down to find UBNT, the SSID for the Bullet2. Clicking on that line gives the above screen.
Adding browser service
To achieve this we need to install a firewall and enable packet service. First install the firewall by
sudo apt install firewalld
this should be successful, but in case of doubt type
sudo systemctl status firewalld
and the firewall should indicate to be active.
Next two commands allow for dhcp traffic and packet forwarding
sudo firewall-cmd --add-service=dhcp --permanent
sudo firewall-cmd --add-masquerade --permanent
If you leave it like this, the local lighttpd web server (192.168.1.1) will not be accessible. To make it accessible add the command
sudo firewall-cmd --add-port=80/tcp --permanent
After a reboot browsing is now possible on connected devices. Moreover, the local web site is available.
Conclusion
A next step is now to compare some antennas to see if this set-up suffices.