安裝iptables
yum install iptables-services.x86_64 -y
systemctl enable iptables
關閉firewalld
systemctl stop firewalld
systemctl disable firewalld
編輯規則
vi /etc/sysconfig/iptables
限制主機去訪問某個ip (該功能在firewalld上沒有找到實現方法)
-I OUTPUT -d 10.1.1.1 -j DROP
限制某個ip訪問主機
-I INPUT -s 10.1.1.1 -j ACCEPT
開啓某個端口
-A INPUT -p tcp -m tcp --dport 1521 -j ACCEPT