Skip to content

Ubuntu network management

swoellauer edited this page Jan 23, 2025 · 9 revisions

Internet default port for HTTP is port 80 and default port for HTTPS is port 443. In a web browser you do not need to type the port numbers when that default ports are used.

Binding to low port numbers like port 80 and port 443 is allowed for root or sudo users only. You would need to run RSDB as root or sudo.
You should run RSDB as normal user, never as root or sudo.

Port forwarding

To use port port 80 and port 443 in RSDB you may create internal port forwarding:
port 80 (public HTTP port) to --> port 8080 (internal RSDB HTTP port)
port 443 (public HTTPS port) to --> port 8443 (internal RSDB HTTPS port)

You may use iptables directly. For a recommended way see section ufw firewall.
Following iptables rules are directly applied but removed after reboot. To add the rules permanently, you need additional commands.

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080  
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443  

ufw firewall

It is recomended to atcivate a firewall on your server.
Here we configure the firewall ufw for usage with SSH and for RSDB.

Attention: An activated ufw blocks everything from the outside, including SSH, and a connection is no longer possible. It is best to do a backup to revert the following steps if something goes wrong, e.g. for a VM system, take a snapshot of the VM image first!

Clone this wiki locally