Firewall

From Dogtag
Jump to: navigation, search

Firewall Configuration

The configuration is located at /etc/sysconfig/firewalld.

To enable debugging:

FIREWALLD_ARGS=--debug=10

To display firewall status:

$ firewall-cmd --state

To display active zones:

$ firewall-cmd --get-active-zones
FedoraWorkstation
  interfaces: enp0s25 tun0

To display services:

$ firewall-cmd --list-services

To display ports:

$ firewall-cmd --zone=FedoraWorkstation --list-ports
1025-65535/udp 1025-65535/tcp

To display sources:

$ firewall-cmd --zone=FedoraWorkstation --list-sources

Enabling Firewall

$ systemctl start firewalld

Disabling Firewall

$ systemctl stop firewalld

Opening a Port

To open a port:

$ firewall-cmd --add-port=8080/tcp
$ firewall-cmd --reload

To configure port forwarding:

$ firewall-cmd --zone=external --add-forward-port=port=<source port>:proto=tcp:toport=<dest port>:toaddr=<dest IP>

See Also