Create a Wi-Fi hotspot using a Raspberry Pi that's already connected to your Tailscale network. Your connected devices can access the VPN without needing a client installed.
This project is for anyone who wants to provide VPN access to devices that can't run a VPN client natively. A common use case is a Wi-Fi only device (like a smart TV or game console) that needs to route its traffic through a VPN for privacy and security. By turning a Raspberry Pi into a VPN-connected hotspot, any device that joins it will automatically be on your Tailscale (or other) VPN network.
- Effortless VPN access: Simply connect to the Wi-Fi hotspot to route traffic through the VPN.
- No client software required on connected devices.
- Works with Tailscale, and the concepts are extensible to other VPNs.
- Built on Raspberry Pi and optimized for a lean Ubuntu Server environment.
The Raspberry Pi acts as a gateway, forwarding all traffic from the Wi-Fi interface to the VPN. This is accomplished using netplan for network configuration and IP forwarding to route packets between the two networks.
graph TD
Tailscale_Network[Tailscale Network] --> Internet[Internet]
subgraph "Location A"
Device_A[Device A] --> RPi[Raspberry Pi]
Device_B[Device B] --> RPi
Device_C[Device C] --> RPi
end
subgraph "Location B"
Server[Server]
Device_C[Device C]
end
Server[Server] --> Tailscale_Network
RPi --> Tailscale_Network
- Hardware: Raspberry Pi (any model with a Wi-Fi interface)
- OS: Ubuntu Server (latest LTS release recommended)
- VPN: An active Tailscale account is needed.
-
Flash Ubuntu Server to your Raspberry Pi and boot it up.
-
Clone this repository to your Pi:
git clone https://github.com/maddyb99/vpn-hotspot.git cd vpn-hotspot -
Make the setup scripts executable:
chmod +x hotspot.sh vpn.sh
-
[OPTIONAL] Open and edit the netplan.yaml file. Set your desired SSID, password, etc.
-
Run the setup scripts in sequence:
sudo ./hotspot.sh sudo ./vpn.sh <your_tailscale_key> <your_exit_node_ip>
- hotspot.sh: Sets up Wi-Fi AP mode, configures NetworkManager and ipv4 sharing.
- vpn.sh: Ensures VPN connectivity and applies firewall/nat rules.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
Distributed under the GNU GENERAL PUBLIC LICENSE v3.0 —see the LICENSE file for more details.