内网环境中测试服务器上的接口出现连接不上的情况,返回信息如下:
Unable to connect to remote host: Connection refused
服务器系统是ubuntu16.04,使用sudo ufw disable关闭了防火墙还是不行,实际上是由于iptables的原因
根据下面这篇文章介绍的方法
https://blog.csdn.net/zuifeng503/article/details/8209441
使用下面的命令关闭iptables之后就好了
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -F