Skip to content
This repository was archived by the owner on Jul 4, 2020. It is now read-only.

firewall cmd

kim yongbin edited this page Jun 3, 2020 · 1 revision

CentOS7부터 방화벽에 규칙을 수정할 때 firewall-cmd 명령어를 사용한다. iptables보다 편리한 것 같다.

항상 reload 해주어야 변경된 규칙이 적용된다.

# 서비스 추가
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

# 포트 직접 추가
firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload

Clone this wiki locally