Git 无法连接到 github 端口 443 - 来自 vmware 中的 ubuntu,网络配置是网桥

Git Failed to connect to github port 443 - from ubuntu in vmware, network config is bridge

问:我在VmwarePlayer中安装了ubuntu14.10,主机是Win7,网络配置是Bridge。然后我尝试从 github 克隆,但无法连接到 github 443 错误。

Failed to connect to github.com port 443: Connection timed out

然后,我将网络配置改为NAT,从github克隆成功。

Cloning into 'docker'...
remote: Counting objects: 118355, done.
Receiving objects:  19% (22717/118355), 9.73 MiB | 77.00 KiB/s    s

不知道为什么在桥接模式下不能用

VMWare doc mentions:

If you want to connect to the Internet or other TCP/IP network using the host computer's dial-up networking or broadband connection and you are not able to give your virtual machine an IP address on the external network, NAT is often the easiest way to give your virtual machine access to that network.

NAT also allows you to connect to a TCP/IP network using a Token Ring adapter on the host computer.

Bridge 更适合访问 LAN (10.x.x.x),而不是 WAN(NAT 给你 192.168.x.x,主机充当网关)。通常是 "Host only".