python程序中Connect error: No route to host(errno:113) 连接错误解决办法--关闭iptables防火墙

来源:互联网 发布:网络中py是什么意思 编辑:程序博客网 时间:2024/05/21 10:53

两台机器进行socket通信时,可能在连接时出现错误:

connect error: No route to host(errno:113)

出错原因:server端的防火墙设置了过滤规则

解决办法:使用iptables关闭server端的防火墙

1.暂时关闭

$sudo service iptables stop

2.打开

$sudo service iptables start

3.永久打开和关闭

$sudo chkconfig iptables on

$sudo chkconfig iptables off

0 0
原创粉丝点击