Skip to content

Instantly share code, notes, and snippets.

@ceccillia
Created August 28, 2023 07:32
Show Gist options
  • Save ceccillia/eb5e13e61338d43fb01ac1ab9c22f99d to your computer and use it in GitHub Desktop.
Save ceccillia/eb5e13e61338d43fb01ac1ab9c22f99d to your computer and use it in GitHub Desktop.
Firewall-cmd rich-rules
Ниже расскажу как добавить и удалить rich правила, добавить для конкретного IP разрешение на подключение к порту 80:
firewall-cmd --permanent --zone=public --add-rich-rule="rule family="ipv4" source address="192.168.1.7" port protocol="tcp" port="80" accept"
Удаление:
firewall-cmd --permanent --zone=public --remove-rich-rule="rule family="ipv4" source address="192.168.1.7" port protocol="tcp" port="80" accept"
Просмотр правил:
firewall-cmd --list-rich-rules
После примененения команд с параметром permanent, необходимо совершать:
firewall-cmd --reload
Если необходимо создать правила для подсети, то достаточно указать источник так:
source address="192.168.1.0/24"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment