1.iptables
linux6版系统和7版系统都可以使用,
6版系统可以通过修改配置文件/etc/sysconfig/iptables;然后重启service iptables restart生效
7版系统没有iptables服务,只能通过命令生效
iptables -A INPUT -s 192.168.1.1/32 -p tcp --dport 1521 -j ACCEPT
2.firewalld
6版系统没有
7版系统
firewall-cmd --zone=public --add-rich-rule="rule family='ipv4' source address='192.168.1.2/32' port protocol='tcp' port='1-65535' accept" --permanent;
重新加载配置
firewall-cmd --reload;
查看所有规则
firewall-cmd --list-all;