免费注册 查看新帖 |

Chinaunix

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

配好网卡的ip.defaultrouter.dns却不能上网 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-09-05 15:53 |只看该作者 |倒序浏览
宿主机IP地址:192.168.2.100\r\n网关:            192.168.2.1\r\nDNS:202.96.134.133\r\n虚拟机vmware6.0,网卡选的是桥接模式安装的solaris10 配置好了ip地址,网关,和DNS却依然上不了网,何解?\r\n\r\n\r\nbash-3.00# more /etc/hosts\r\n#\r\n# Internet host table\r\n#\r\n127.0.0.1       localhost       loghost yang\r\n192.168.2.7                     loghost yang\r\n\r\nbash-3.00# more /etc/defaultrouter\r\n192.168.2.1\r\nbash-3.00# more  /etc/resolv.conf\r\nnameserver 202.96.134.133\r\nbash-3.00# ping 192.168.2.7\r\nICMP Host Unreachable from gateway localhost (127.0.0.1)\r\n for icmp from localhost (127.0.0.1) to loghost (192.168.2.7)\r\n\r\nbash-3.00# ping 192.168.2.1\r\nICMP Host Unreachable from gateway localhost (127.0.0.1)\r\n for icmp from localhost (127.0.0.1) to 192.168.2.1\r\nICMP Host Unreachable from gateway localhost (127.0.0.1)\r\n for icmp from localhost (127.0.0.1) to 192.168.2.1\r\n\r\n是上面的信息看好像是主机不可达,\r\nifconfig -a\r\nlo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1\r\n        inet 127.0.0.1 netmask ff000000\r\nvmxnet0: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2\r\n        inet 127.0.0.1 netmask ff000000 broadcast 127.255.255.255\r\n        ether 0:c:29:80:9d:26\r\n郁闷我的IP地址都设好了,为何又是127.0.0.1不明白了,还请各位大侠帮我看下?\r\n\r\n发现solaris 和linux有很大的区别,很多不一样.

论坛徽章:
0
2 [报告]
发表于 2007-09-05 15:54 |只看该作者
用nslookup看看能不能解析.

论坛徽章:
0
3 [报告]
发表于 2007-09-05 15:57 |只看该作者

回复 #2 风之幻想 的帖子

不能解析,问题我ping 网关返回信息有问题\r\nnslookup www.baidu.com\r\n;; connection timed out; no servers could be reached

论坛徽章:
0
4 [报告]
发表于 2007-09-05 15:58 |只看该作者
把你的netstat -rn输出一下.

论坛徽章:
0
5 [报告]
发表于 2007-09-05 16:01 |只看该作者

回复 #4 风之幻想 的帖子

# netstat -rn\r\n\r\nRouting Table: IPv4\r\n  Destination           Gateway           Flags  Ref   Use   Interface\r\n-------------------- -------------------- ----- ----- ------ ---------\r\n224.0.0.0            127.0.0.1            U         1      0 lo0\r\n127.0.0.1            127.0.0.1            UH        7    965 lo0\r\n没有我设置的IP地址是回环地址为何是这样

论坛徽章:
0
6 [报告]
发表于 2007-09-05 16:05 |只看该作者

回复 #6 风之幻想 的帖子

# route add default 192.168.2.1\r\nadd net default: gateway 192.168.2.1: Network is unreachable\r\n添加不了\r\n还有我设置的IP地址好像也没起作用?

论坛徽章:
0
7 [报告]
发表于 2007-09-05 16:15 |只看该作者
是上面的信息看好像是主机不可达,\r\nifconfig -a\r\nlo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1\r\n        inet 127.0.0.1 netmask ff000000\r\nvmxnet0: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2\r\n        inet 127.0.0.1 netmask ff000000 broadcast 127.255.255.255\r\n        ether 0:c:29:80:9d:26\r\n郁闷我的IP地址都设好了,为何又是127.0.0.1不明白了,还请各位大侠帮我看下?\r\n\r\n\r\n#ifconfig vmxnet0 up and try again\n\n[ 本帖最后由 Jion 于 2007-9-5 16:19 编辑 ]

论坛徽章:
0
8 [报告]
发表于 2007-09-05 16:41 |只看该作者
# ifconfig vmxnet0 192.168.2.7 netmask 255.255.255.0\r\n# ifconfig vmxnet0 up\r\n# ping -s 192.168.2.1\r\nPING 192.168.2.1: 56 data bytes\r\n64 bytes from 192.168.2.1: icmp_seq=0. time=5.38 ms\r\n64 bytes from 192.168.2.1: icmp_seq=1. time=0.793 ms\r\n64 bytes from 192.168.2.1: icmp_seq=2. time=0.312 ms\r\n64 bytes from 192.168.2.1: icmp_seq=3. time=0.341 ms\r\n\r\n刚才临时用命令重新设置可以了但是还是上不是网用nslookup\r\n# netstat -rn\r\n\r\nRouting Table: IPv4\r\n  Destination           Gateway           Flags  Ref   Use   Interface\r\n-------------------- -------------------- ----- ----- ------ ---------\r\n192.168.2.0          192.168.2.7          U         1      1 vmxnet0\r\n224.0.0.0            127.0.0.1            U         1      0 lo0\r\n127.0.0.1            127.0.0.1            UH        3   1551 lo0\r\nbash-3.00# nslookup www.google.com\r\n;; connection timed out; no servers could be reached

论坛徽章:
0
9 [报告]
发表于 2007-09-05 16:52 |只看该作者

回复 #10 ^日出东方^ 的帖子

show me the /etc/nsswitch.conf file, \r\nhost file dns

论坛徽章:
0
10 [报告]
发表于 2007-09-05 17:03 |只看该作者

回复 #11 Jion 的帖子

# cat /etc/nsswitch.conf\r\n#\r\n# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.\r\n# Use is subject to license terms.\r\n#\r\n# ident \"@(#)nsswitch.files     1.14    06/05/03 SMI\"\r\n\r\n#\r\n# /etc/nsswitch.files:\r\n#\r\n# An example file that could be copied over to /etc/nsswitch.conf; it\r\n# does not use any naming service.\r\n#\r\n# \"hosts:\" and \"services:\" in this file are used only if the\r\n# /etc/netconfig file has a \"-\" for nametoaddr_libs of \"inet\" transports.\r\n\r\npasswd:     files\r\ngroup:      files\r\nhosts:      files dns\r\nipnodes:    files\r\nnetworks:   files\r\nprotocols:  files\r\nrpc:        files\r\nethers:     files\r\nnetmasks:   files\r\nbootparams: files\r\npublickey:  files\r\n# At present there isn\'t a \'files\' backend for netgroup;  the system will\r\n#   figure it out pretty quickly, and won\'t use netgroups at all.\r\nnetgroup:   files\r\nautomount:  files\r\naliases:    files\r\nservices:   files\r\nprinters:       user files\r\n\r\nauth_attr:  files\r\nprof_attr:  files\r\nproject:    files\r\n\r\ntnrhtp:     files\r\ntnrhdb:     files\r\n我已设更过了有问题吗
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP