天天看點

主機和虛拟機能互相ping通但是不能複制

1.本機能ping通虛拟機 2.虛拟機也能ping通本機 3.虛拟機能通路自己的web 4.本機無法通路虛拟己的web 

後來發現是防火牆将80端口屏蔽了的緣故。

檢查是不是伺服器的80端口被防火牆堵了,可以通過指令:

telnet {伺服器ip}80 來測試。 

解決方法如下: /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT 然後儲存: /etc/rc.d/init.d/iptables save 重新開機防火牆 /etc/init.d/iptables restart 

CentOS防火牆的關閉,關閉其服務即可:

檢視CentOS防火牆資訊:

/etc/init.d/iptables status 

關閉CentOS防火牆服務:

/etc/init.d/iptables stop 

永久關閉防火牆:

chkconfig --level 35 iptables off 

最後,打開主機浏覽器,輸入虛拟機地方,就可以通路虛拟機的WEB伺服器了!

繼續閱讀