Advertisement
easternnl

CentOS 7 Firewall examples

Jun 2nd, 2015
602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.57 KB | None | 0 0
  1. #Disable Firewall
  2. service firewalld stop
  3.  
  4. #List the default zone
  5. firewall-cmd  --get-default-zone
  6.  
  7. #Get current zone
  8. firewall-cmd  --get-active-zone
  9.  
  10. #Move to internal
  11. firewall-cmd --set-default-zone=internal
  12.  
  13. #Enable samba on a zone
  14. firewall-cmd --zone=internal --add-service=samba
  15. firewall-cmd --permanent --zone=internal --add-service=samba
  16. firewall-cmd --permanent --zone=internal --add-service=http
  17. firewall-cmd --zone=internal --add-port=41872/tcp
  18.  
  19. #Firewall reload from the permanent settings
  20. firewall-cmd --reload
  21.  
  22. #View settings
  23. firewall-cmd --list-all
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement