«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Tags more
Archives
Today
Total
12-28 16:41
관리 메뉴

+1-1+1-1+1-1+1-1...

Linux - Firewalld 오류 해결 - No route to host 본문

Linux/Trouble Shooting

Linux - Firewalld 오류 해결 - No route to host

투명인간 2021. 1. 13. 13:38
728x90

웹서버 방화벽을 아래와 같이 해제

[root@localhost httpd]# firewall-cmd --permanent --add-service=http

 클라이언트에서 Telnet 테스트 결과 - 실패

[root@lottelab ~]# telnet 192.168.60.11 80 
Trying 192.168.60.11... 
telnet: connect to address 192.168.60.11: No route to host 

No route to Host 에러 > NAT 네트워크 환경에 오류로 확인, 구글 서치 결과 masquerade 옵션 no일 경우 발생한다고 함

 

현재 firewall 설정 상태 확인 결과 masqerade 옵션 no 임

[root@localhost httpd]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s3 enp0s8
  sources:
  services: dhcpv6-client http https ssh
  ports:
  protocols:
  masquerade: no
  forward-ports:
  sourceports:
  icmp-blocks:
  rich rules:

 

아래 명령으로 추가 masqerade 옵션 등록

[root@localhost httpd]# firewall-cmd --permanent --zone=public --add-masquerade

firewalld 서비스 재시작

[root@localhost httpd]# systemctl restart firewalld

masqerade 옵션 yes 확인

[root@localhost httpd]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s3 enp0s8
  sources:
  services: dhcpv6-client http https ssh
  ports:
  protocols:
  masquerade: yes
  forward-ports:
  sourceports:
  icmp-blocks:
  rich rules:

클라이언트에서 Telnet 테스트 결과 - 성공

[root@lottelab ~]# telnet 192.168.60.11 80
Trying 192.168.60.11...
Connected to 192.168.60.11.
Escape character is '^]'.
반응형