Firewall Rules on Linux

There are a few different ways of configuring firewall rules in the various flavours of Linux that we run.

For Debian based systems, including Ubuntu, you can use ufw tool to open the port and on CentOS 7 you can use Firewalld utility to manage the firewall rules the examples below are for the port Zabbix uses to communicate, change to whatever port you need:

On Debian based systems

sudo ufw allow 10050/tcp

For centOS 7 (both temporary and permanent rules)

sudo firewall-cmd --add-port=10050/tcp
sudo firewall-cmd --add-port=10050/tcp --permanent

For older distributions such as centOS 6 or unmanaged firewalls through specific utilities use the iptables command to open ports:

iptables -A INPUT -p tcp -m tcp --dport 10050 -j ACCEPT

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *