Port Forwarding in Ubuntu 22.04 to Access as a Secure

Port Forwarding in Ubuntu 22.04 to Access as a Secure

Hello Guys, Welcome to the inet70. Now get the best Information about Port Forwarding in Ubuntu 22.04 Server so the user can Securely Access and use the Server from the External Devices.

This service allows users to access your Ubuntu server remotely with custom ports. There are two types of ports available: (i) TCP and (ii) UDP. TCP stands for Transmission Control Protocol, while UDP stands for User Datagram Protocol. Before we start the process, let’s get some information about Port Forwarding.

What is Port Forwarding in Ubuntu?

Port Forwarding is used so that clients can access computer (server) services remotely. In the Linux Operating System, we use ufw for Port Forwarding. You can follow all my steps carefully to install ufw on the Ubuntu Operating System. Follow the given steps to install ufw on Ubuntu.

ufw Install in Ubuntu

ufw is Best and Powerful tool in Linux System for Firewall and Port Forwarding Services. ufw Used in SSH Server, Web Server, FTP Server and Other Protocols.

First, put the following command to install the ufw firewall:

sudo apt-get install ufw

Put the given command and hit the enter key. You will get a prompt asking for Yes/No. Press Y to start the firewall installation process. After completing this step, you are ready to start Port Forwarding.

Now, I will give you some examples of Port Forwarding that you can use in your Ubuntu System. But before that, enable the ufw Service with the given commands:

sudo systemctl start ufw
sudo systemctl enable ufw

After following these given commands, the ufw Service is enabled on your Ubuntu Server. Now, you are able to use the firewall using ufw. Follow my next step to use the firewall.

Port Forwarding with Ufw

Suppose I need to allow the firewall rule to the Apache Web server using ufw in Ubuntu. Then I need to allow the Firewall permission to the web server so that users can access it from the browser. Now, I can allow the firewall permission to Apache Web Server over the http connection. Then I can use the following command to allow users to access the web server:

sudo ufw allow 80/tcp

Here, 80 is the http protocol, and TCP is a firewall port forwarding protocol. In the given table, I have provided some useful Port Forwarding Protocol details that you can check now.

Important Ports

Thank you for visiting my platform. If you like this content, please share it with your friends and press the 🔔 icon to subscribe to my blog to get all new blog posts notifications.

Buy Me A Coffee