This is an old revision of the document!
Table of Contents
Remote accessing your Pi
Unsurprisingly there are many solutions to this particular cat; is the client Windows or Linux, do you have an internet connection with a public-facing IP address, do you want to roll your own or use / purchase a commercial solution, what on the Pi do you want to access; all these questions and scenarios have different solutions. This guide is mostly geared towards packet operators running LinBPQ on a headless Pi, so let's get into it!
Roll your own
IP addresses, ports, CGNAT and the internet
To set up remote access without using a third party provider, save of course whichever ISPs you have chosen, you will need what is known as a globally routable IP. This is a unique address on the internet which your ISP provides to you, and from this address you connect out, or indeed people connect in. There are two address spaces, IPv4 (which look like 173.194.203.102) and IPv6 (which look like 2607:f8b0:400e:c05::8a); this guide is going to stick to IPv4 addresses for the sake of familiarity and ubiquity. To find out your public IP address (maybe, caveat below!) you can visit a website such as https://whatismyipaddress.com/.
The IP address of your computer on your home network will almost certainly not be the a public IPv4 address because you are using a router. One of the jobs of this router is to translate your internal addresses (most often in the range 192.168.x.x) to the single external address (e.g. 173.194.203.102) such that many computers can share a single internet connection. This is referred to as NAT, Network Address Translation. In order for you access a service inside your home network from the outside world your router must be configured to pass that traffic from the outside to the inside; this is referred to as Port Forwarding, or NAPT, Network Address Port Translation.
All software running on a Host using IP also uses a Port in conjunction with this IP address, ranging from 0 to 65535. There are also a number of protocols (for example TCP and UDP) which a service may use; this unique combination of IP address, protocol and port is referred to as a Socket. Any application running on a Host will have a unique Socket, and for a Client to connect to that Host it needs to know what Socket to connect to.
Increasingly, 4G providers and many domestic ISPs are using NAT internally
Dynamic DNS
DuckDNS No-IP
SSH
Public / Private keys SOCKS proxying; browser / telnet
Wireguard
Setup Usage examples
Commercial solutions
To do!
- Tailscale
- Anydesk
- Rustdesk