VMware7下guest与host无法互通

在WinXPsp3(DeepInLite版本)上安装了VMware Workstation7.0,使用bridged网络模式,安装ubuntu9.10,安装完成后guest可以正常上网,host与guest可以互相ping通,但是host与guest之间却无法进行正常的网络通信,表现为:在host上无法ssh到guest(已排除guest没有启动sshd服务,及防火墙配置等问题);在guest上无法访问host的apache网页服务。

经过各种抓包测试,发现问题在路由配置上,host主机的初始路由配置如下:

===========================================================================
Interface List
0x1 ……………………… MS TCP Loopback interface
0x2 …00 1d 92 ac 74 ca …… Realtek RTL8168/8111 PCI-E Gigabit Ethernet NIC
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.0.1   192.168.0.178       10
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      192.168.0.0    255.255.255.0    192.168.0.178   192.168.0.178       10
    192.168.0.178  255.255.255.255        127.0.0.1       127.0.0.1       10
    192.168.0.255  255.255.255.255    192.168.0.178   192.168.0.178       10
        224.0.0.0        240.0.0.0    192.168.0.178   192.168.0.178       10
  255.255.255.255  255.255.255.255    192.168.0.178   192.168.0.178       1
Default Gateway:       192.168.0.1
===========================================================================
Persistent Routes:
  None

使用如下命令

route -p add 192.168.0.0 mask 255.255.255.0 192.168.0.1

增加添加路由(-p参数保证重启后依然有效),结果如下:

===========================================================================
Interface List
0x1 ……………………… MS TCP Loopback interface
0x2 …00 1d 92 ac 74 ca …… Realtek RTL8168/8111 PCI-E Gigabit Ethernet NIC
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.0.1   192.168.0.178       10
        127.0.0.0        255.0.0.0        127.0.0.1       127.0.0.1       1
      192.168.0.0    255.255.255.0    192.168.0.178   192.168.0.178       10
      192.168.0.0    255.255.255.0      192.168.0.1   192.168.0.178       1
    192.168.0.178  255.255.255.255        127.0.0.1       127.0.0.1       10
    192.168.0.255  255.255.255.255    192.168.0.178   192.168.0.178       10
        224.0.0.0        240.0.0.0    192.168.0.178   192.168.0.178       10
  255.255.255.255  255.255.255.255    192.168.0.178   192.168.0.178       1
Default Gateway:       192.168.0.1
===========================================================================
Persistent Routes:
  None

这样,在host上就可以正常ssh连接到guest了!

更换Ubuntu更新源

默认的更新源实在太慢了,不到5k的速度,随便装个东东就得以小时计,对于享受惯了ADSL下载的我,开始思变。。

先ping了官方中文源cn.archive.ubuntu.com,发现他的老窝是shlug.org,原来是上海Linux User Group提供的,估计太多人都用这个默认源,已经不堪重负了,又或者他们是电信机房,俺是联通的宽带。。

换更新源吧,“系统管理”->“软件源”->“选择最佳服务器”,一通ping,选中了tw.archive.ubuntu.com,果真是宝岛台湾啊,下载速度立刻达到了150k+

不过台湾服务器缺少一些zh_CN的翻译源,看来本土还是有自己的优势,一番google,搜到了ubuntu官方wiki文章《如何使用我们推荐的源》,发现终于得道,不仅有手工修改ubuntu源的abc教程,还有国内若干更新服务器列表,有163、sohu、及若干大学的,应该是相当全了。

同时发现,Mirrors.shlug.org(Ubuntu China Official Mirror)果然就是电信线路,难怪我这慢的这么匪夷所思呢。。

最后记个笔记:

# 1. 备份源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
# 2. 编辑/etc/apt/sources.list,替换掉文件中的内容
# 3. 刷新列表
sudo apt-get update