Oct 31 2016

Firewalld Add New Port, List All Ports, Remove Port with firewall-cmd command in Oracle Linux 7

Category: Linux & UnixFatih Acar @ 16:32

What is firewalld

Firewalld provides a dynamically managed firewall with support for network/firewall zones that define the trust level of network connections or interfaces. It has support for IPv4, IPv6 firewall settings, ethernet bridges and IP sets. There is a separation of runtime and permanent configuration options. It also provides an interface for services or applications to add firewall rules directly.

Benefits of using firewalld

Changes can be done immediately in the runtime environment. No restart of the service or daemon is needed.

With the firewalld D-Bus interface it is simple for services, applications and also users to adapt firewall settings. The interface is complete and is used for the firewall configuration tools firewall-cmd, firewallctl, firewall-config and firewall-applet.

The separation of the runtime and permanent configuration makes it possible to do evaulation and tests in runtime. The runtime configuration is only valid up to the next service reload and restart or to a system reboot. Then the permanent configuration will be loaded again. With the runtime environment it is possible to use runtime for settings that should only be active for a limited amount of time. If the runtime configuration has been used for evaluation, and it is complete and working, then it is possible to save this configuration to the permanent environment.


Add a Port to Firewalld as temporary

[root@test ~]# firewall-cmd –add-port=1521/tcp

Add a Port to Firewalld as permanent

[root@test ~]# firewall-cmd –permanent –add-port=1521/tcp
[root@test ~]# firewall-cmd –reload

List All Ports

[root@test ~]# firewall-cmd –list-ports

Remove Port from Firewalld

[root@test ~]# firewall-cmd –permanent –remove-port=1521/tcp
[root@test ~]# firewall-cmd –reload

12,871 total views, 6 views today

Tags: Linux Administration, System Administration

facebook comments:

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.