تحميل

Allowing Other Ports in UFW on Your Server/VPS

Updated at
16/12/2023
Views
3647

Introduction: Managing ports is a crucial part of server administration. This tutorial will guide you through the process of allowing additional ports on your Virtual Private Server (VPS) using UFW (Uncomplicated Firewall), a user-friendly interface for managing iptables firewall rules.

Prerequisites: Before you begin, make sure you have:

  1. Access to your VPS via SSH with a username and password.

Step-by-Step Guide

Step 1: Enabling UFW

Before altering firewall rules, ensure UFW is enabled. This can be done with the following command:

sudo ufw enable

This command activates the UFW firewall, allowing you to manage its rules.

Step 2: Allowing a Specific Port (TCP)

To allow traffic on a specific port, use the ufw allow command. For instance, to allow traffic on port 80 (commonly used for HTTP) for TCP only, use:

sudo ufw allow 80/tcp

This command configures the firewall to allow TCP traffic on port 80.

Step 3: Allowing a Specific Port (TCP and UDP)

If you want to allow both TCP and UDP traffic on the same port, you don't need to specify the protocol. For example, to allow both TCP and UDP traffic on port 80, simply use:

sudo ufw allow 80

Step 4: Checking the Firewall Status

After configuring the rules, it's important to check if they've been applied correctly. Use this command to display the current rules and their statuses:

sudo ufw status

This command lists all active rules in UFW, allowing you to verify that the correct ports are allowed.

Conclusion

By following these steps, you can easily manage the ports on your VPS using UFW. This is essential for running various services and ensuring that your server's communication channels are open and secure.

YottaSrc footer

لماذا تختارنا؟

أفضل الأسعار, تخزين SSD سريع و دعم فني
24/7 حقيقي

control panel icon
cPanel

إدارة موقعك من خلال CPanel بأحدث إصدار

security icon
سريع وموثوق وآمن

ضمان وقت تشغيل بنسبة 99.8٪.
لذا ركز على عملك!

support icon
دعم 24/7/365

ليلاً أو نهارًا ، مطر أو شمس ،
فريقنا هنا من أجلك!

cloud backup icon
نسخ احتياطي يومي

نسخ احتياطي يومي وأسبوعي.
ملفاتك آمنة!