Our training department had the issue to connect physical devices to a local test net (Ethernet) in a private address range (192.168.x.x). The participants shall also access that local Ethernet. This network has to travel, since we offer inhouse trainings. Unfortunately, the server is a SAP based machine and used by other departments as well, so it cannot move with the test net.
At customer sites, there’s often a guest WLAN available which allows Internet HTTP(S) traffic. That’s all our devices need, so the idea was born to create a LAN to WLAN bridge with the Raspberry Pi 2.
The devices will get static IP addresses. In a first step, the participants will also set up static IP addresses. In a second step we might use DHCP to make it easier.
Connecting to the guest WLAN may involve difficulties: the WLAN may be protected by WPA which requires entering a key or maybe it’s an open WLAN and the registration is done on an internal website asking for credentials prior to getting Internet access. Therefore we must have a display, a keyboard and mouse and a browser. Raspbian brings a browser with the GUI, so that’s fine.
Things to consider
Normally, a WLAN connection will get a higher metric than a LAN connection, because it is considered as more expensive (in terms of cost, speed or latency). We should change this to make sure that the Raspberry will try connections on the WLAN first.
The users of the Raspberry are not familiar with it as hardware, nor with Linux to do lot of configuration or troubleshooting. Connecting to the WLAN and opening a browser is probably the maximum we can expect, so everything should be nice and easy, without too much noise. We have to set the timezone and do the keyboard configuration in advance.
The solution will be used by 3 trainers, each getting an identical setup. So it might be worth writing a single complete script to install everything.
A Raspberry 2 or 3 should give a much better feeling on the Desktop compared to a Raspberry 1. Since we want to connect to WLAN, the Raspberry 3 seems to be the best choice.
The display needn’t be large, just enough to configure the WLAN connection and perhaps see something on the console. The official 7″ display is great, since it is supported out of the box and a nice housing is available. That display might even help us getting rid of the mouse, since it supports touch.
The keyboard could be a Bluetooth keyboard to avoid cable spaghetti.
The devices are powered over Ethernet. PoE switches are already available in our company.
Setting it up
- Download the latest version of Raspbian
- Flash the Raspbian image to SD card with Win32DiskImager
- Download the script
- Unzip it. You have 3 files now: lan2wlan.sh, asplash, splash.png
- Copy the 3 files onto the SD card
- Insert the SD card into the Pi
- Apply power
- The Raspberry will resize the partition and reboot
- Wait until the Desktop appears
- Connect to the Internet via LAN or WLAN
- Run the script from /boot
- Wait until it completed
- Test if everything works fine
What about the throughput of the solution? I tested using a DSL speed test website. My Internet should be 50 MBit/s / 10 MBit and I get realistic 47 MBit/s / 9.7 MBit/s with my normal PC. The Raspberry Pi 2 is connected to the WLAN with 132 MBit/s, so that should be fast enough to not limit the bandwidth during the test.
Connected with my Laptop on the test network, I get 34 MBit/s and 9.2 MBit/s. This is 72% for download and 94% for the upload. That’s fine and definitely enough for the intended test purposes.