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

 

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