File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
projects/LinuxSystemOps/Security/firewall Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 66# Description: allow the login ip access a port on this host
77
88function remove_an_old_fw_rich_rule() {
9- wanted_rich_rule=$( firewall-cmd --list-all | awk ' /fw_temp_kw_phone /' ,' $1=$1' )
9+ wanted_rich_rule=$( firewall-cmd --list-all | awk ' /fw_temp_kw_internal /' ,' $1=$1' )
1010 if [[ $wanted_rich_rule != " " ]]; then
1111 firewall-cmd --permanent --zone=public --remove-rich-rule=" $wanted_rich_rule "
1212 firewall-cmd --reload
@@ -15,7 +15,7 @@ function remove_an_old_fw_rich_rule() {
1515
1616function add_a_fw_rich_rule() {
1717 from_ip=$( bash -c " w -h | awk '/w -h/ {print \$ 3}'" )
18- firewall-cmd --permanent --add-rich-rule=" rule family=" ipv4" source address=" $from_ip " port protocol=" tcp" port=" 50009" log prefix=" fw_temp_kw_phone " level=" info" accept"
18+ firewall-cmd --permanent --zone=public -- add-rich-rule=" rule family=" ipv4" source address=" $from_ip " port protocol=" tcp" port=" 50009" log prefix=" fw_temp_kw_internal " level=" info" accept"
1919 firewall-cmd --reload
2020}
2121
You can’t perform that action at this time.
0 commit comments