Firewalldサービス起動
sudo systemctl start firewalld
現在の状態を確認
sudo firewall-cmd --state
アクティブなゾーンを表示
sudo firewall-cmd --get-active-zones
アクティブなゾーンの設定を表示
sudo firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens3
sources:
services: cockpit dhcpv6-client ssh
ports:
protocols:
forward: yes
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
80/tcpポートを開放
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
設定をリロード
sudo firewall-cmd --reload
確認
sudo firewall-cmd --list-all
target: default
icmp-block-inversion: no
interfaces: ens3
sources:
services: cockpit dhcpv6-client ssh
ports: 80/tcp ⇦ 80/tcpが追加された
protocols:
forward: yes
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules: