Select Page

Using CentOS firewall daemon can help secure your server. This might help protect you from data theft, and unwanted server access.

Adding a TCP port:

firewall-cmd --permanent --zone=public --add-port=80/TCP

Adding a SERVICE:

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

Open firewall for ip address

firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="11.22.33.44" accept'

 

Remember to reload your firewall config after adding new rules:

firewall-cmd --reload

 

Ref sources:

Trust an IP address with firewalld’s rich rules