首页 > Linux操作系统 > Linux操作系统 > linux firwwall
重要摘录:
If you are using the server as an Oracle database server, you will probably want to make sure the SSH and Oracle listener ports are accessible. You could lock these down to specific source IP addresses, but for a quick setup, you could just do the following, where "1521" is the port used for the listener.
# systemctl start firewalld.service # systemctl enable firewalld.service # firewall-cmd --permanent --zone=public --add-port=22/tcp # firewall-cmd --permanent --zone=public --add-port=1521/tcp # firewall-cmd --reload # firewall-cmd --permanent --zone=public --list-ports 1521/tcp 22/tcp #
如果你想使用自己的 iptables 和 ip6tables 静态防火墙规则, 那么请安装 iptables-services 并且禁用 firewalld ,启用 iptables 和ip6tables:
yum install iptables-services systemctl mask firewalld.service systemctl enable iptables.service systemctl enable ip6tables.service
静态防火墙规则配置文件是 /etc/sysconfig/iptables 以及 /etc/sysconfig/ip6tables .
注: iptables 与 iptables-services 软件包不提供与服务配套使用的防火墙规则. 这些服务是用来保障兼容性以及供想使用自己防火墙规则的人使用的. 你可以安装并使用 system-config-firewall 来创建上述服务需要的规则. 为了能使用 system-config-firewall, 你必须停止 firewalld.
为服务创建规则并停用 firewalld 后,就可以启用 iptables 与 ip6tables 服务了:
systemctl stop firewalld.service systemctl start iptables.service systemctl start ip6tables.service
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29519108/viewspace-1802280/ ,如需转载,请注明出处,否则将追究法律责任。