Created
August 28, 2023 07:32
-
-
Save ceccillia/eb5e13e61338d43fb01ac1ab9c22f99d to your computer and use it in GitHub Desktop.
Firewall-cmd rich-rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ниже расскажу как добавить и удалить 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