VPSなんかでの疎通確認でつい忘れがちなポート開放。必要なものだけ開けようね!
登録されているサービス名の表示
# firewall-cmd --get-services
空いているポートの確認
# firewall-cmd --list-services --zone=public
dhcpv6-client ssh
ポート開放
# firewall-cmd --permanent --add-service=http
# firewall-cmd --permanent --add-service=https
# firewall-cmd --permanent --add-service=smtp
# firewall-cmd --permanent --add-service=smtps
# firewall-cmd --permanent --add-service=smtp-submission
or
# firewall-cmd --permanent --add-port=80/tcp
# firewall-cmd --permanent --add-port=443/tcp
特定範囲の番号を開ける(22220-22230)
# firewall-cmd --add-port=22220-22230/tcp --zone=public --permanent
ポートを閉じる
$ firewall-cmd --remove-service=https --zone=public --permanent
特定範囲の番号を閉じる
$ firewall-cmd --remove-port=22220-22230/tcp --zone=public --permanent
設定反映(リロード)
$ firewall-cmd --reload
コメント