CentOS7 如何新增/移除 Rich Rule for firewalld

如果要針對某個 ip 開放某個 port
需要用到 rich rule 來設定

針對 public zone 列出永久的 rule
# firewall-cmd --zone=public --list-all --permanent

針對特定的 ip 開放特定的 port
這邊是針對 sql server 開放
# firewall-cmd --add-rich-rule="rule family="ipv4" source address="1.1.1.1" port port="1433" protocol="tcp" accept" --permanent

如果要移除 rich rule
# firewall-cmd --permanent --remove-rich-rule 'rule family="ipv4" source address="1.1.1.1" port protocol="tcp" port="1433" accept'

PS. webmin 看不到 rich rule, 所以需要用 cmd 才能設定

Comments

Popular posts from this blog

mac 安裝 mtr

Howto use Postman test Cors