宿主机mac os无法连接到虚拟机centos

来源:互联网 发布:在淘宝进货实体店买 编辑:程序博客网 时间:2024/06/15 18:32

宿主机:

Mac OS 10.9.2

虚拟机:

[root@localhost ~]# cat /etc/redhat-release 

CentOS release 6.4 (Final)

[root@localhost ~]# uname -a

Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

虚拟机是通过vagrant up启动的

端口映射已经在Vagrantfile里配置

   config.vm.network :forwarded_port, guest: 80, host: 9098


并且打开局域网内可以访问

   config.vm.network :public_network

问题:

宿主机无法连接到虚拟机。


解决方法:
关闭虚拟机的防火墙

[root@localhost ~]# service iptables stop

iptables: Flushing firewall rules:                         [  OK ]

iptables: Setting chains to policy ACCEPT: filter          [  OK ]

iptables: Unloading modules:                               [  OK ]


0 0
原创粉丝点击