I’m not going to explain everything here since you can find each part on this website.
Basically the goal is to connect from PCA to PCB with modem/router
The device that is a modem and router at the same time is called a gateway.
the diagram is:
PC A -> gateway -> PC B
- PC B has a private IP
- The gateway has an IP that is called public IP
- PC B has ports, which are called internal ports, They are not accessible from the Internet, they are accessible on LAN or from the local network itself.
- The gateway has ports, which are external ports
- You must make the ports accessible from the Internet, for that you do “port forwarding”
- “Port forwarding” is that you send traffic that arrives from the public IP and external port to a device with a private IP and internal port
- PC A and PC B use Unix-like operating systems such as macOS and Linux Ubuntu Server.
- You access it via SSH
- You must purchase a domain (xxxx.com) so that access is through a fixed or static address.
- The gateway will give you a dynamic public IP, that is, it changes from time to time.
- You must hire a dynamic DNS service like DYN DNS, this maps a dynamic IP to a static alphanumeric hostname and updates the dynamic IP with software.
- Your domain xxxx.com must be mapped to the dynamic DNS hostname, You do that using a CNAME RECORD.
- You can configure a static private IP for PC B device, that is useful for port forwarding and not modify anything else.
- You can configure an SSH alias, to access with an alias: “ssh alias”
- If you do not configure an sssh alias you must type the command “~ ยป ssh username@domain.com -p 99999”
- The local network is called LAN, the Internet is called WAN