There have been times that I have not been on my LAN but I needed to open up a port in my router. I figured that there might be a way that I could use one of my machines running locally to act as a proxy to serve me web traffic via a VPN connection over SSH.
Make sure the server connected to the LAN can serve unencrypted traffic on port 80:
sudo ufw allow 80 comment 'temporary access to web traffic'
Open an SSH connection on the machine outside of the LAN. Make sure to use a port that you know isnt taken:
# -D: bind to the port.
# -C: Requests compression of all data.
# -N: Specifies that a remote command not be executed. This is useful for just forwarding ports.
ssh -D 42069 -C -N <user>@<ip-of-LAN-machine>
For this step, i use tailscale as my VPN to access my LAN machine.
This is where results may vary. I have only tested this on macOS so I do not have instructions for any other OS. From here, the proxy needs to be configured in settings. Go to:
System settings > search "proxies" > SOCKS proxy
Then, specify the server and port:
server: 127.0.0.1
port: 42069
Thats it! Now you should be able to access IP addresses that are only available to your LAN from your remote machine.