媛媛*小怪兽
If you have choices,choose the best! If you have no choices,do the best! 人生就是不断在学习路上进步的!!!!!!

1、 vim /etc/sysconfig/iptables

2、在文件中添加允许访问当前服务器的某个端口的IP地址

实例中添加的是本机,以及本地局域网所有服务器都可以访问3306端口

-A INPUT -s 127.0.0.1/32 -p tcp -m tcp --dport 3306 -j ACCEPT
-A INPUT -s 10.211.92.0/24 -p tcp -m tcp --dport 3306 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3306 -j REJECT --reject-with icmp-port-unreachable

posted on 2019-02-25 10:05  媛味君  阅读(153)  评论(0)    收藏  举报