Skip to content

Instantly share code, notes, and snippets.

@mojagehub
Created January 6, 2017 14:47
Show Gist options
  • Save mojagehub/6bb01d4988765921d7d5a710a37a665b to your computer and use it in GitHub Desktop.
Save mojagehub/6bb01d4988765921d7d5a710a37a665b to your computer and use it in GitHub Desktop.
firewalld how to open ports

許可されているサービスやポートの一覧を表示

$ firewall-cmd --list-all --zone=public
$ firewall-cmd --list-services --zone=public
$ firewall-cmd --list-ports --zone=public

許可するサービスの追加と削除

$ firewall-cmd --add-service=ssh --zone=public --permanent
$ firewall-cmd --remove-service=ssh --zone=public --permanent

許可するポートの追加と削除

$ firewall-cmd --add-port=22/tcp --zone=public --permanent
$ firewall-cmd --remove-port=22/tcp --zone=public --permanent

利用可能なサービス一覧

$ firewall-cmd --get-services

firewalldのリロード

$ firewall-cmd --reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment