How to open port 2195 in iptables CentOS 6 for activating the APNS

二次信任 提交于 2019-12-03 07:01:03

问题


I tried this solution:

iptables -I OUTPUT -p tcp --dport 2195 -j ACCEPT
/etc/init.d/iptables stop
/etc/init.d/iptables start

but still can't access the port.

If there are more ports that I have to open for APNS let me know.


回答1:


How about:

iptables -A INPUT -p tcp --dport 2195 -j ACCEPT
service iptables restart

This may help too.




回答2:


See my anwser here: https://stackoverflow.com/a/25229943/1472048

For CentOS 7, you should use "firewall-cmd" command like so:

firewall-cmd --add-port=2195/tcp --permanent

iptables is not recommended if you use the firewalld service.




回答3:


It didn't work for me completely, since my last rule was DROP ALL which basically negated all I added to iptables after.

It might be useful to use the -I switch:

iptables -I INPUT 1 -p tcp --dport 2195 -j ACCEPT

The INPUT 1 - means 1st Input rule instead of appending, to put rule in front of drop all




回答4:


Try the following command, it worked for me:

$ sudo iptables -A INPUT -p tcp --jport 2195 -j ACCEPT

$ sudo /etc/init.d/iptables save



来源:https://stackoverflow.com/questions/13606582/how-to-open-port-2195-in-iptables-centos-6-for-activating-the-apns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!