$linuxjunkies
>

port forward

also: port redirection, port mapping, SSH tunneling, SSH port forwarding

Port forwarding redirects network traffic from one address and port to another, typically allowing external connections to reach services running on an internal or remote machine.

Port forwarding is a networking technique that intercepts incoming traffic on a specific port and redirects it to a different port on the same or a different machine. This is commonly used to expose internal services to the internet, bypass firewalls, or access remote machines securely.

For example, you might forward external port 8080 to an internal web server running on port 80 of a machine at 192.168.1.100. Traffic arriving at your router's port 8080 would then be automatically sent to that internal machine's port 80.

In Linux, port forwarding can be configured using iptables, ufw, SSH tunneling, or modern alternatives like nftables. SSH tunneling is especially useful for secure remote access: ssh -L 8080:localhost:80 user@remote-host forwards your local port 8080 to port 80 on a remote machine.

Related terms