SSH&在VM,telnet和curl之间运行ping不起作用

时间:2015-08-28 18:00:26

标签: curl nginx tcp centos chef

我有两台运行CentOS 6.7的VM的VMWare Fusion,我试图在它们上部署Chef(服务器和工作站)。两个虚拟机之间的Ping和ssh工作正常,但是当我去knife client list时,它说它无法找到到主机的路由。 Curl和telnet也不起作用。一些信息:在OS X Yosemite上运行的VMWare Fusion,禁用防火墙,两个VM上的网络设置都与我的Mac"共享。服务器上的nestat -puntal | grep nginx产量:

tcp        0      0 0.0.0.0:9680                0.0.0.0:*                   LISTEN      1091/nginx
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1091/nginx
tcp        0      0 0.0.0.0:9683                0.0.0.0:*                   LISTEN      1091/nginx
tcp        0      0 0.0.0.0:443                 0.0.0.0:*                   LISTEN      1091/nginx

ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0C:29:5A:9E:EE
          inet addr:172.16.20.131  Bcast:172.16.20.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe5a:9eee/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:231 errors:0 dropped:0 overruns:0 frame:0
          TX packets:114 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:29039 (28.3 KiB)  TX bytes:14305 (13.9 KiB)

错误:

[root@chefworkstation ~]# knife client list
ERROR: Errno::EHOSTUNREACH: No route to host - connect(2) for "chefsrv1" port 443

[root@chefworkstation ~]# curl chefsrv1
curl: (7) couldn't connect to host

[root@chefworkstation ~]# ping chefsrv1
PING chefsrv1.localdomain (172.16.20.131) 56(84) bytes of data.
64 bytes from 172.16.20.131: icmp_seq=1 ttl=64 time=0.685 ms
64 bytes from 172.16.20.131: icmp_seq=2 ttl=64 time=0.335 ms
64 bytes from 172.16.20.131: icmp_seq=3 ttl=64 time=0.319 ms

1 个答案:

答案 0 :(得分:0)

有点蛮力解决方案,但我已禁用iptable_filter模块并已禁用selinux。立即行动。