大佬教程收集整理的这篇文章主要介绍了linux – 如何通过iptables允许传出连接?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我知道它不起作用,因为当我这样做时:
root@server1 [~]# telnet myserver2.com 2194 Trying 123.123.123.98... telnet: connect to address 123.123.123.98: Connection timed out telnet: Unable to connect to remote host: Connection timed out
server1# iptables -L -n Chain INPUT (policy DROp) ... ... Chain FORWARD (policy DROp) target prot opt source desTination Chain OUTPUT (policy DROp) ... Chain LOCALINPUT (1 references) target prot opt source desTination ... Chain LOCALOUTPUT (1 references) target prot opt source desTination ... Chain LOGDROPIN (1 references) target prot opt source desTination DROP all -- 0.0.0.0/0 0.0.0.0/0 Chain LOGDROPOUT (1 references) target prot opt source desTination DROP all -- 0.0.0.0/0 0.0.0.0/0
iptables -A OUTPUT -p tcp -d <server2ip> --dport 2194 -j ACCEPT
要允许在TCP端口2194上从server1到server2的传入连接,请在server2上使用此连接:
iptables -A INPUT -p tcp -s <server1ip> --dport 2194 -j ACCEPT
以上是大佬教程为你收集整理的linux – 如何通过iptables允许传出连接?全部内容,希望文章能够帮你解决linux – 如何通过iptables允许传出连接?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。