码迷,mamicode.com
首页 > 系统相关 > 详细

linux网络编程 no route to host 解决方案

时间:2016-10-30 23:49:12      阅读:452      评论:0      收藏:0      [点我收藏+]

标签:添加   table   arc   tar   参考   nec   common   rac   res   

linux网络编程 no route to host 解决方案 【整合资料】

 (2013-05-13 21:38:12)
标签: 

net

 

iptables

 

it

分类: Linux
参考资料
http://1413570.blog.51cto.com/1403570/792861
http://2614223.blog.51cto.com/2604223/764757

在vmvare里面配了两台mysql,发现用mysql连不上mysql服务器,用telnet登录mysql的3306端口,发现居然是no route to host;

[zhoulei@localhost ~]$ telnet 192.168.2.48 3306
Trying 192.168.2.48...
telnet: connect to address 192.168.2.48: No route to host
telnet: Unable to connect to remote host: No route to host

觉得甚是差异,估计是虚拟机装了有问题,就把虚拟机中的防火墙给清了一下,发现可行。

[zhoulei@localhost ~]$ sudo iptables -F



今天安装过vsftpd后,基本配置已经ok;在本地可以正常访问到
在其他server访问,提示
ftp: connect: No route to host
出现这个问题,首先是和vsftpd服务的配置无关,因为你本地已经可以正常访问到,首先考虑是防火墙是否添加21端口,
用命令iptables -L --line-num
发现已经添加了,此外,只能考虑是防火墙少了ftp的模块,导致出现的error
编辑vi /etc/sysconfig/iptables-config 
添加一行:IPTABLES_MODULES="ip_nat_ftp ip_conntrack_ftp"
之后重新启动iptables
[root@In-Server3 ~]# service iptables restart
Flushing firewall rules: [  OK  ]
Setting chains to policy ACCEPT: filter [  OK  ]
Unloading iptables modules: [  OK  ]
Applying iptables firewall rules: [  OK  ]
Loading additional iptables modules: ip_nat_ftp ip_conntrack_ftp [  OK  ]
ok,模块已经加载了了
再访问ftp服务
就ok了。。。。。。

linux网络编程 no route to host 解决方案

标签:添加   table   arc   tar   参考   nec   common   rac   res   

原文地址:http://www.cnblogs.com/adolfmc/p/6014185.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!