Useful Commands Of Firewall On Redhat/CentOs 7

0
22

Useful Commands Of Firewall On Redhat/CentOs 7

Today we’re going to show you useful commands of firewall in your Linux machine. We have installed redhat 7.5 version installed on our system.

To check state of firewall

Firewall-cmd –state

Check default zone of firewall

firewall-cmd –get-default-zone

Check active zone of firewall

firewall-cmd –get-active-zone

Check rules are associated with firewall   

firewall-cmd –list-all

Check all zone available

firewall-cmd –get-zones

Add service

firewall-cmd –zone=public –add-service=http

Check services in specific zone

firewall-cmd –zone=public –list-services

Open port

firewall-cmd –zone=public –add-port=4000/tcp

Note : You can use –permanent parameter to added it permanent.

Check particular port added in zone

firewall-cmd –zone=public –list-ports

You’re done

Sponsored

LEAVE A REPLY

Please enter your comment!
Please enter your name here