Share this post with your friends
This post is about how to open specific tcp and udp ports using the command
firewall-cmd. So without further due, let's get started.
Opening TCP ports:
Let's say, I want to open the tcp ports
443 which are used by http and https protocol respectively.
To do that, run the following commands,
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=443/tcp
Opening UDP ports:
Let's say, I want to open the udp port
53, which is used by bind dns service.
To do that, run the following command,
firewall-cmd --permanent --add-port=53/udp
Reload the Configuration:
Now we have to reload
firewall-cmd configurations. To do that, run the following command,
To verify that the commands worked, let's view the current opened port list,
443/tcp 80/tcp 53/udp
Tested on: CentOS 7