免费注册 查看新帖 |

Chinaunix

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

[网络管理] 请问linux在VMware下为何不能上网? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-10-10 17:57 |只看该作者 |倒序浏览
我的是redhat9.0; ping 网关、自己的IP 还有局域网的机器都能通,就是访问不了外网,ping的时候是Network is unreachable 我的inconfig如下:
eth0 Link encap:Ethernet HWaddr 00:0C:29:1E:FF:78
inet addr:10.0.0.188 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1964 errors:0 dropped:0 overruns:0 frame:0
TX packets:1408 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:225769 (220.4 Kb) TX bytes:221542 (216.3 Kb)
Interrupt:10 Base address:0x1080

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:44 errors:0 dropped:0 overruns:0 frame:0
TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4508 (4.4 Kb) TX bytes:4508 (4.4 Kb)
请问是什么原因呢?

论坛徽章:
0
2 [报告]
发表于 2006-10-10 18:37 |只看该作者
route -n 的结果呢

论坛徽章:
0
3 [报告]
发表于 2006-10-10 18:48 |只看该作者

回复 2楼 langue 的帖子

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0  

情况大概就是这个样子,请问有什么好的办法吗,好像很多人有这个问题呀,

论坛徽章:
0
4 [报告]
发表于 2006-10-10 18:51 |只看该作者
默认路由没有加。你用一下:

route add default gw $路由或者网关的ip

把 $路由或者网关的ip 替换成网关地址。

呵呵,10.0.0.0/24 和 169.254.0.0/16 都是 IANA 规定的内部私有地址,访问外部因特网需要指定网关。公开地址需要指定路由。

[ 本帖最后由 langue 于 2006-10-10 18:52 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2006-10-10 19:11 |只看该作者

回复 4楼 langue 的帖子

非常感谢,解决了!!!!!!!

论坛徽章:
0
6 [报告]
发表于 2006-10-11 11:53 |只看该作者

新手求助!!!我也遇到vm不能上网的问题??

[root@RH root]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
[root@RH root]# route add default gw 192.168.1.1
[root@RH root]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0

我用浏览器上网时出现:
unknown host www.163.com.
请问是怎么回事??

论坛徽章:
1
2015元宵节徽章
日期:2015-03-06 15:50:39
7 [报告]
发表于 2006-10-11 15:09 |只看该作者
没有DNS
vi /etc/resolv.conf
     nameserver $DNSServer

论坛徽章:
0
8 [报告]
发表于 2006-10-26 12:42 |只看该作者

谢谢

我用了两天的时间在搞这个东西,真是太感谢你了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP