Ground Sunlight

Windowsで作る - PHPプログラミングの開発環境

ユーザ用ツール

サイト用ツール


centos:firewall-cmd

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
centos:firewall-cmd [2020/06/01 20:40]
y2sunlight [サービス]
centos:firewall-cmd [2020/06/02 08:03] (現在)
y2sunlight
行 1: 行 1:
-> 編集中 
- 
 ====== firewall-cmdコマンド ====== ====== firewall-cmdコマンド ======
 Version CentOS 7.2 Version CentOS 7.2
行 18: 行 16:
   * [[centos:systemctl|systemctl --- サービスの操作]]   * [[centos:systemctl|systemctl --- サービスの操作]]
   * [[centos:journalctl|journalctl --- ログの操作]]   * [[centos:journalctl|journalctl --- ログの操作]]
-  * [[centos:firewall-cmd|firewall-cmd --- ファイアウォールの操作]]+  * firewall-cmd --- ファイアウォールの操作
  
 リンク リンク
行 34: 行 32:
 <code> <code>
 firewall-cmd --get-active-zones firewall-cmd --get-active-zones
 +
 public public
   interfaces: eth0   interfaces: eth0
行 43: 行 42:
 <code> <code>
 firewall-cmd --get-default-zone firewall-cmd --get-default-zone
 +
 public public
 </code> </code>
行 52: 行 52:
 サービスを使用すると、ポートのオープン、プロトコルの定義、パケット転送などを一括して行う事ができます。ゾーンにサービスを追加することで、そのサービス用のファイアウォール設定が反映されます。各サービスのファイアウォール設定は ''/usr/lib/firewalld/services'' にxmlファイルとして保存されています。 サービスを使用すると、ポートのオープン、プロトコルの定義、パケット転送などを一括して行う事ができます。ゾーンにサービスを追加することで、そのサービス用のファイアウォール設定が反映されます。各サービスのファイアウォール設定は ''/usr/lib/firewalld/services'' にxmlファイルとして保存されています。
  
 +{{fa>question-circle}} ファイアウォール設定で使用できるサービスの一覧を表示する
 +<code>
 firewall-cmd --get-services firewall-cmd --get-services
  
- +RH-Satellite-6 amanda-client bacula bacula-client dhcp dhcpv6 dhcpv6-client dns freeipa-ldap freeipa-ldaps freeipa-replication ftp high-availability http https imaps ipp ipp-client ipsec iscsi-target kerberos kpasswd ldap ldaps libvirt libvirt-tls mdns mountd ms-wbt mysql nfs ntp openvpn pmcd pmproxy pmwebapi pmwebapis pop3s postgresql proxy-dhcp radius rpc-bind rsyncd samba samba-client smtp ssh telnet tftp tftp-client transmission-client vdsm vnc-server wbem-https 
-サービスは、個々の XML 設定ファイルを使用して指定し、名前は、service-name.xml のような形式になります。プロトコル名は、firewalld のサービス名またはアプリケーション名よりも優先されます。+</code>
  
 \\ \\
行 63: 行 65:
 以下の例は、publicゾーンを対象とした場合を想定しています。他のゾーンを指定する場合は、''--zone=ZONE_NAME'' オプションを指定して下さい。 以下の例は、publicゾーンを対象とした場合を想定しています。他のゾーンを指定する場合は、''--zone=ZONE_NAME'' オプションを指定して下さい。
  
-{{fa>question-circle}}TODO+=== サービスの許可 === 
 +{{fa>question-circle}}サービスの一覧表示
 <code> <code>
 +firewall-cmd --list-service   #reloadしないと反映されません
 +</code>
 +
 +{{fa>question-circle}}サービスの追加
 +<code>
 +firewall-cmd --add-service=http               #一時的
 +firewall-cmd --add-service=http --permanent   #恒久的
 +
 +#変更後はFWの再起動
 +firewall-cmd --reload
 +</code>
 +
 +{{fa>question-circle}}サービスの削除
 +<code>
 +firewall-cmd --remove-service=http               #一時的
 +firewall-cmd --remove-service=http --permanent   #恒久的
 +
 +firewall-cmd --reload
 +</code>
 +
 +=== ポート番号の許可 ===
 +
 +{{fa>question-circle}}ポート番号の一覧表示
 +<code>
 +firewall-cmd --list-ports   #reloadしないと反映されません
 +</code>
 +
 +{{fa>question-circle}}ポート番号の追加
 +<code>
 +firewall-cmd --add-port=8080/tcp               #一時的
 +firewall-cmd --add-port=8080/tcp --permanent   #恒久的
 +
 +#変更後はFWの再起動
 +firewall-cmd --reload
 +</code>
 +
 +{{fa>question-circle}}ポート番号の削除
 +<code>
 +firewall-cmd --remove-port=8080/tcp               #一時的
 +firewall-cmd --remove-port=8080/tcp --permanent   #恒久的
 +
 +firewall-cmd --reload
 +</code>
 +
 +=== IPアドレスの許可 ===
 +
 +{{fa>question-circle}}IPアドレスの一覧表示
 +<code>
 +firewall-cmd --list-sources   #reloadしないと反映されません
 +</code>
 +
 +{{fa>question-circle}}IPアドレスの追加
 +<code>
 +firewall-cmd --add-source=192.168.1.0/24               #一時的
 +firewall-cmd --add-source=192.168.1.0/24 --permanent   #恒久的
 +
 +firewall-cmd --reload
 +</code>
 +
 +{{fa>question-circle}}IPアドレスの削除
 +<code>
 +firewall-cmd --remove-source=192.168.1.0/24               #一時的
 +firewall-cmd --remove-source=192.168.1.0/24 --permanent   #恒久的
 +
 +firewall-cmd --reload
 </code> </code>
  
 \\ \\
  
-===== ゾーン =====+
  
centos/firewall-cmd.1591011615.txt.gz · 最終更新: 2020/06/01 20:40 by y2sunlight