iptables 规则

安装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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章