You want a device, let's call it a BRoku, to route its traffic through your home IP even though it's actually physically located in someone else's house on their wifi network.
- BRoku connects over wired ethernet directly to a Raspberry Pi (3B+ or 4).
- Raspi connects to local wifi.
- Raspi's traffic is routed to a Tailscale exit node (potentially another Raspi) in your home LAN.
The majority of this is taken from: https://www.instructables.com/Share-WiFi-With-Ethernet-Port-on-a-Raspberry-Pi/
Many of the early steps can be done directly in the Raspberry Pi Imager; enabling ssh, setting login, configuring wifi, configuring locale.
In the Raspberry Pi Imager, navigate the OS selection options to install the 64-bit version (with or without the desktop UI).
The "Set your ethernet adapter to a static IP address" section lacks detail. The missing necessary steps are taken from here and are copied below:
sudo nano /etc/dhcpcd.conf
At the end of the file add:
denyinterfaces eth0
CTRL-X, y to save
Next:
sudo nano /etc/network/interfaces
We're going to configure the Raspi to use a static IP addr on its ethernet port that will be the beginning of its own mini-LAN for anything connecting to it over ethernet:
source /etc/network/interfaces.d/*
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.2.1
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
CTRL-x, y to save.
After dnsmasq
is installed, configure it with:
sudo nano /etc/dnsmasq.conf
The Raspi's ethernet connection will have its own local dns server to create its own mini-LAN. Configure it to assign IP addrs in the 192.168.2.x range:
interface=eth0
dhcp-range=192.168.2.50,192.168.2.100,12h
server=8.8.8.8
bind-interfaces
domain-needed
bogus-priv
CTRL-x, y to save.
Now we enable internet sharing:
sudo nano /etc/sysctl.conf
Find this line and enable it by removing the "#":
net.ipv4.ip_forward=1
CTRL-x, y to save.
And activate ip forwarding:
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
Follow the steps here for Debian Bullseye to install Tailscale on the Raspi: https://tailscale.com/kb/1038/install-debian-bullseye/
We assume that you're already running your own Tailscale network in your home LAN. Configure one of your always-on devices to be an exit node.
Configure the Raspi's Tailscale defaults:
sudo tailscale set --exit-node=EXIT_NODE_TAILSCALE_IP --exit-node-allow-lan-access
EXIT_NODE_TAILSCALE_IP
should be that IP provided in the Tailscale dashboard for your exit node.
Copy the wifi-to-eth-route.sh script included in this gist. It sets up the necessary iptables routing, etc.
nano wifi-to-eth-route.sh
Paste in the raw contents of the script. CTRL-x, y to save.
Now configure the Raspi to run that script whenever it boots:
sudo nano /etc/rc.local
Instruct it to run the .sh file before the exit 0
line:
sudo bash /home/pi/wifi-to-eth-route.sh
CTRL-x, y to save