08月23, 2017

firewalld防火墙使用

# 查看配置结果,验证配置
firewall-cmd --list-all
# 限定ssh/22服务只能从内网10.169.138.158访问
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.169.138.158/24" service name="ssh" accept"
# 允许192.168.142.166访问6379端口
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="6379" accept"
# 限定udp/161端口只能从内网10.169.138.158访问
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.169.138.158/24" destination address="10.46.128.24/24" port port="161" protocol="udp" accept"

本文链接:https://blog.jnliok.com/post/linux-firewalld.html

-- EOF --

Comments