/etc/iptables/rules.v4
파일을 수정한다.참고:
Essential Firewall Rules
...
- Do not use Uncomplicated Firewall (UFW) to edit firewall rules on an Ubuntu image. Using UFW to edit rules might cause an instance not to boot. Therefore, we recommend you edit UFW rules using the method described in this note: Ubuntu instance fails to reboot after enabling Uncomplicated Firewall (UFW).
필수 방화벽 규칙
...
Ubuntu 이미지에서 방화벽 규칙을 편집하기 위해 UFW를 사용하지 마세요. 규칙을 수정하기 위해 UFW를 수정하면 인스턴스가 부팅되지 않을 수 있습니다. 그러므로, 저희는 이 노트에 나와있는 방법을 사용해 UFW 규칙을 수정하기를 권장드립니다: (링크)
Ubuntu instance fails to reboot after enabling Uncomplicated Firewall (UFW)
...
Workaround
Do not use UFW to edit firewall rules. Platform images are preconfigured with firewall rules to enable instances to make outgoing connections to the instance's boot and block volumes. For more information, see Essential Firewall Rules. UFW may remove these rules so that during a reboot the instance is not able to connect to the boot and block volumes.To modify or add new firewall rules, update the
/etc/iptables/rules.v4
file instead. Modifications to firewall rules here will take effect after a reboot. To have the rules take effect immediately, run the following:$ sudo su - # iptables-restore < /etc/iptables/rules.v4
Ubuntu 인스턴스가 UFW를 활성화한 이후 재부팅에 실패합니다.
...
해결 방법
방화벽 규칙을 수정하기 위해 UFW를 사용하지 마세요. 플랫폼 이미지는 인스턴스가 인스턴스의 부팅 및 블록 볼륨에 나가는 연결을 할 수 있도록 방화벽 규칙으로 미리 구성되어 있습니다. 자세한 내용은 필수 방화벽 규칙을 참조하십시오. UFW는 재부팅하는 동안 인스턴스가 부팅 및 블록 볼륨에 연결할 수 없도록 이러한 규칙을 제거할 수 있습니다.방화벽 규칙을 수정하거나 새로 만들기 위해선, 대신
/etc/iptables/rules.v4
파일을 업데이트하세요. 여기에 수정된 방화벽 규칙은 재부팅 이후 적용도리 것입니다. 규칙을 즉시 적용하기 위해서는 다음을 실행하세요:$ sudo su - # iptables-restore < /etc/iptables/rules.v4