Search This Blog

Saturday, 6 February 2021

Linux firewalld Rules

 Open all incoming connections on 5003/tcp port . Zone should be public

[root@master ~]# systemctl status firewalld

● firewalld.service - firewalld - dynamic firewall daemon

   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)

   Active: active (running) since Sat 2021-02-06 23:02:29 EST; 2min 25s ago

     Docs: man:firewalld(1)

 Main PID: 32724 (firewalld)

    Tasks: 2 (limit: 11343)

   Memory: 23.9M

   CGroup: /system.slice/firewalld.service

           └─32724 /usr/libexec/platform-python -s /usr/sbin/firewalld --nofork --nopid


Feb 06 23:02:28 master systemd[1]: Stopped firewalld - dynamic firewall daemon.

Feb 06 23:02:28 master systemd[1]: Starting firewalld - dynamic firewall daemon...

Feb 06 23:02:29 master systemd[1]: Started firewalld - dynamic firewall daemon.


[root@master ~]# firewall-cmd --zone=public --list-all

public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s3
  sources:
  services: cockpit dhcpv6-client ssh
  ports:
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

[root@master ~]# firewall-cmd --permanent --zone=public --add-port=5003/tcp
success
[root@master ~]# firewall-cmd --reload
success
[root@master ~]# systemctl restart firewalld

[root@master ~]# firewall-cmd --zone=public --list-ports
5003/tcp
[root@master ~]# firewall-cmd --zone=public --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s3
  sources:
  services: cockpit dhcpv6-client ssh
  ports: 5003/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

No comments: