0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

RHEL9のパケットフィルタリング

Last updated at Posted at 2025-02-21

firewalldを使用したパケットフィルタリング。

firewalldの有効確認

以下コマンドを使用し、有効になっていることを確認した。

systemctl status firewalld

永続的にTCPポート解放

ファイル転送ソフトに設定したTCPポートを解放するため、以下のコマンドを入力。

firewall-cmd --zone=public --add-port=30000/tcp --permanent
firewall-cmd --zone=public --add-port=31000/tcp --permanent
firewall-cmd --zone=public --add-port=65535/tcp --permanent
firewall-cmd --zone=public --add-port=30001/tcp --permanent
firewall-cmd --zone=public --add-port=31001/tcp --permanent
firewall-cmd --zone=public --add-port=65534/tcp --permanent

その後、設定を反映。

firewall-cmd --reload

TCPポートの状態確認

リロード後に許可されているかを確認する。

firewall-cmd --list-all

出力結果より先のコマンドで記述したポートが許可されていることを確認した。

public (active)
  target: default
  icmp-block-inversion: no
  interfaces: eth0
  services: cockpit dhcpv6-client http https ssh
  ports: 30000/tcp 31000/tcp 65535/tcp 30001/tcp 31001/tcp 65534/tcp 
  protocols: 
  ...

念のため、/etc/firewalld/zones/public.xmlも確認、反映されていたためよしとした。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?