免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 7496 | 回复: 10
打印 上一主题 下一主题

[C++] 请教一个VMWare虚拟Debian可以ping通域名但不能apt-get的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-01-24 10:49 |只看该作者 |倒序浏览
20可用积分
大家好,我用VMware虚拟了一个Debian5,但现在出了一点问题。

虚拟机网络采用NAT方式,之前是可以apt-get软件的,很顺畅。
但不知道怎么回事,从昨天起,就没法apt-get任何软件了,提示连接不上;

我ping域名,如 mirrors.geekbone.org,都是可以ping通的;
但是用debian自带的浏览器打开网页,却无法打开;

我现在最想解决的是,如何让我能正常的apt-get软件,你知道的,debian上不了网很痛苦;

/etc/apt/sourcelist里面的每个域名都是可以ping通的,就是无法get软件;

请帮忙定位一下可能的原因,谢谢!
-------------------------------------------------------------------------------------
root@debian[/]apt-get install tcpdump
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  tcpdump
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 306kB of archives.
After this operation, 631kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  tcpdump
Install these packages without verification [y/N]? y
Err http://mirrors.geekbone.org lenny/main tcpdump 3.9.8-4
  Could not connect to mirrors.geekbone.org:80 (222.73.255.64), connection timed out
Failed to fetch http://mirrors.geekbone.org/debi ... mp_3.9.8-4_i386.deb  Could not connect to mirrors.geekbone.org:80 (222.73.255.64), connection timed out
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

--------------------------------------------------------------------------------------------------------
root@debian[/]nslookup mirrors.geekbone.org
Server:         192.168.80.2
Address:        192.168.80.2#53

Non-authoritative answer:
Name:   mirrors.geekbone.org
Address: 222.73.255.64
----------------------------------------------------------------------------------------------------------

root@debian[/]ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0c:29:d1:35:69
          inet addr:192.168.80.128  Bcast:192.168.80.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fed1:3569/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:995 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1166 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:81481 (79.5 KiB)  TX bytes:166784 (162.8 KiB)
          Interrupt:19 Base address:0x2024

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:66 errors:0 dropped:0 overruns:0 frame:0
          TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5104 (4.9 KiB)  TX bytes:5104 (4.9 KiB)
---------------------------------------------------------------------------------------

root@debian[/]ping mirrors.geekbone.org
PING mirrors.geekbone.org (222.73.255.64) 56(84) bytes of data.
64 bytes from 222.73.255.64: icmp_seq=1 ttl=128 time=132 ms
64 bytes from 222.73.255.64: icmp_seq=2 ttl=128 time=110 ms
64 bytes from 222.73.255.64: icmp_seq=3 ttl=128 time=94.0 ms
64 bytes from 222.73.255.64: icmp_seq=4 ttl=128 time=67.6 ms
64 bytes from 222.73.255.64: icmp_seq=5 ttl=128 time=153 ms
^C
--- mirrors.geekbone.org ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4019ms
rtt min/avg/max/mdev = 67.671/111.753/153.771/29.865 ms

论坛徽章:
0
2 [报告]
发表于 2011-01-24 11:10 |只看该作者
DNS设置对吗?你检查下,跟你本机的对比下吧........

论坛徽章:
0
3 [报告]
发表于 2011-01-24 11:12 |只看该作者
或者你选择用host-only,动态获取IP地址,当然这个之前先把虚拟工具装上...

论坛徽章:
0
4 [报告]
发表于 2011-01-24 11:19 |只看该作者
回复 2# lsupper


上面的信息可以看出,DNS是没问题的,已经解析到IP了;

论坛徽章:
0
5 [报告]
发表于 2011-01-24 11:19 |只看该作者
回复 3# lsupper


    公司电脑上外网有很多限制,只能通过NAT了。

论坛徽章:
0
6 [报告]
发表于 2011-01-24 11:50 |只看该作者
WARNING: The following packages cannot be authenticated!
  tcpdump

sudo apt-get -y --force-yes install


ping通但打不开它的页面,可能是防火墙或者selinux的原因,把它们关了试试

论坛徽章:
0
7 [报告]
发表于 2011-01-24 11:55 |只看该作者
ping是ip层的,http,apt-get等跑在4层,中间的两层最多的就是防火墙设置

论坛徽章:
0
8 [报告]
发表于 2011-01-24 13:59 |只看该作者
回复 4# insnowind


    可以ping通不代表DNS正确! 不信你试试把你主机的DNS设置错误的,你也可以ping到baidu,但是IE就上不了网了!

论坛徽章:
0
9 [报告]
发表于 2011-01-24 14:32 |只看该作者
看DNS设置好着没有

论坛徽章:
0
10 [报告]
发表于 2011-01-24 14:40 |只看该作者
重装。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP