Configure a Raspberry Pi as a Wi-Fi to Ethernet Router

Recently, I found myself in a situation where a client was moving to a new office, within the same building. Up until the move they had been sharing an Internet connection with a neighbouring business, however the new office had a completely separate network and networked photocopier.

The client had applied for the Internet to be connected at the new office, however due to the pace of the ISP it was not ready in time and a temporary Internet connection was required to get them operational.

They were still able to access their neighbours Wi-Fi From the new office, but were not able to access the new photocopier as it was connected to their new network.

To temporarily provide an Internet connection to the new network two solutions came to mind:

Connect a 4G modem to the router; with the number of devices on the network mobile data charges could become excessive.

Configure a spare Raspberry Pi to connect to the neighbours Wi-Fi and share it out the Ethernet port, connected to the WAN port of the new network's router.

Tips

Before you start to follow the guide you will need to copy Raspbian Stretch Lite to a microSD card. You can find the steps to do so here.

Instead of following Step 4, run sudo raspi-config to connect the Raspberry Pi to Wi-Fi, as this will limit the Wi-Fi chipset to operate within your country's channel restrictions.

After following Gus' guide I had an intermittent error during boot; "Failed to start dnsmasq - A lightweight DHCP and caching DNS server", this was resolved by removing the line bind-interfaces in /etc/dnsmasq.conf.