반응형
기존에 centos7 방화벽 관련 설정을 이곳에 포스팅해두었다.
현재 사용중인 서버는 centos8 이기 때문에 바뀐 방화벽 설정 명령을 정리해보려고 한다.
Step1.Check the status of your firewall.
# firewall-cmd --state
running
Step2. Retrieve your currently active zones. Take a note of the zone within which you wish to open ports 80 and 443:
# firewall-cmd --get-active-zones
libvirt
interfaces: virbr0
public
interfaces: enp0s3
Step3. Open port 80 and port 443 port.
# firewall-cmd --zone=public --add-service=http
# firewall-cmd --zone=public --add-service=https
728x90
Step4. Open port 80 and port 443 port permanently. Execute the below commands to open both ports permanently, hence, make the settings persistent after reboot:
# firewall-cmd --zone=public --permanent --add-service=http
# firewall-cmd --zone=public --permanent --add-service=https
# firewall-cmd --reload
Step5. Check for open ports/services. The services with permanently open ports are listed on line starting with services::
# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: enp0s3
sources:
services: cockpit dhcpv6-client http https ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
Step6. In case you need to close the previously open HTTP port 80 and HTTPS port 443 execute:
# firewall-cmd --zone=public --permanent --remove-service=http
# firewall-cmd --zone=public --permanent --remove-service=https
# firewall-cmd --reload
반응형
'DEVELOPMENT > SERVER(centos7)' 카테고리의 다른 글
you do not have the SUPER privilege 에러 처리 (0) | 2022.06.13 |
---|---|
리눅스 터미널 프롬프트에서 git branch 표시하기 (0) | 2021.05.20 |
Centos8 flask express 설정하기 (0) | 2021.03.18 |
FLASK static 설정 (2) | 2020.08.11 |
centos 방화벽 설정 port 80 오픈 (4) | 2020.06.19 |
댓글