このページの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: | * [[centos: | ||
| * [[centos: | * [[centos: | ||
| - | * [[centos: | + | * firewall-cmd --- ファイアウォールの操作 |
| リンク | リンク | ||
| 行 34: | 行 32: | ||
| < | < | ||
| firewall-cmd --get-active-zones | firewall-cmd --get-active-zones | ||
| + | |||
| public | public | ||
| interfaces: eth0 | interfaces: eth0 | ||
| 行 43: | 行 42: | ||
| < | < | ||
| firewall-cmd --get-default-zone | firewall-cmd --get-default-zone | ||
| + | |||
| public | public | ||
| </ | </ | ||
| 行 52: | 行 52: | ||
| サービスを使用すると、ポートのオープン、プロトコルの定義、パケット転送などを一括して行う事ができます。ゾーンにサービスを追加することで、そのサービス用のファイアウォール設定が反映されます。各サービスのファイアウォール設定は ''/ | サービスを使用すると、ポートのオープン、プロトコルの定義、パケット転送などを一括して行う事ができます。ゾーンにサービスを追加することで、そのサービス用のファイアウォール設定が反映されます。各サービスのファイアウォール設定は ''/ | ||
| + | {{fa> | ||
| + | < | ||
| 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 のサービス名またはアプリケーション名よりも優先されます。 | + | </ |
| \\ | \\ | ||
| 行 63: | 行 65: | ||
| 以下の例は、publicゾーンを対象とした場合を想定しています。他のゾーンを指定する場合は、'' | 以下の例は、publicゾーンを対象とした場合を想定しています。他のゾーンを指定する場合は、'' | ||
| - | {{fa> | + | === サービスの許可 === |
| + | {{fa> | ||
| < | < | ||
| + | firewall-cmd --list-service | ||
| + | </ | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | firewall-cmd --add-service=http | ||
| + | firewall-cmd --add-service=http --permanent | ||
| + | |||
| + | # | ||
| + | firewall-cmd --reload | ||
| + | </ | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | firewall-cmd --remove-service=http | ||
| + | firewall-cmd --remove-service=http --permanent | ||
| + | |||
| + | firewall-cmd --reload | ||
| + | </ | ||
| + | |||
| + | === ポート番号の許可 === | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | firewall-cmd --list-ports | ||
| + | </ | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | firewall-cmd --add-port=8080/ | ||
| + | firewall-cmd --add-port=8080/ | ||
| + | |||
| + | # | ||
| + | firewall-cmd --reload | ||
| + | </ | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | firewall-cmd --remove-port=8080/ | ||
| + | firewall-cmd --remove-port=8080/ | ||
| + | |||
| + | firewall-cmd --reload | ||
| + | </ | ||
| + | |||
| + | === IPアドレスの許可 === | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | firewall-cmd --list-sources | ||
| + | </ | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | firewall-cmd --add-source=192.168.1.0/ | ||
| + | firewall-cmd --add-source=192.168.1.0/ | ||
| + | |||
| + | firewall-cmd --reload | ||
| + | </ | ||
| + | |||
| + | {{fa> | ||
| + | < | ||
| + | firewall-cmd --remove-source=192.168.1.0/ | ||
| + | firewall-cmd --remove-source=192.168.1.0/ | ||
| + | |||
| + | firewall-cmd --reload | ||
| </ | </ | ||
| \\ | \\ | ||
| - | ===== ゾーン ===== | + | |