LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1014|回复: 12

linux跟window同样设置,但是linux就是上不到网~~`

[复制链接]
发表于 2006-5-7 23:15:27 | 显示全部楼层 |阅读模式
我刚刚遇到一个奇怪的问题~~
就是在window下可以上网,在linux下不可以~~
IP,netmask, route, DNS我都查过,都是一样,就是在linux上不了。。。但是我在linux可以ping通dns,奇怪……
大家有什么办法呢??帮我想想~~~
发表于 2006-5-8 01:05:46 | 显示全部楼层
有没有开防火墙?
回复 支持 反对

使用道具 举报

发表于 2006-5-8 08:45:05 | 显示全部楼层
Linux是固定IP还是通过DHCP得到的IP?
试试
/etc/init.d/networking restart
再看看.
DNS居然没有将ping禁了!
回复 支持 反对

使用道具 举报

发表于 2006-5-8 13:32:28 | 显示全部楼层
ifconfig
route -n
cat /etc/resolv.conf

将这些信息贴出来
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-5-8 13:42:13 | 显示全部楼层
Post by springwind426
ifconfig
route -n
cat /etc/resolv.conf

将这些信息贴出来



我的ip是网多的192.168.1.4
我查过iptables -L为空
IP是静态的,我也试过/etc/init.d/networking restart之类的,还试过手动再改一次IP,route,dns

ifconfig里看到的IP,route -n的路由和/etc/resolv.conf里的DNS全都跟window一样~~我查过很多次的,我刚装的系统是ubuntu 6.06 beta

因为DNS是202.X.x.x是外网的,我能ping通就是说ip and route都没有问题,但是DNS就是解释不了域名,在window里就可以,查了很多次/etc/resolv.conf了,烦。。。
回复 支持 反对

使用道具 举报

发表于 2006-5-8 14:18:42 | 显示全部楼层
你是说你能通过IP访问网站,但是不能通过域名访问吗?

把/etc/network/interfaces文件贴上来看看。
回复 支持 反对

使用道具 举报

发表于 2006-5-8 15:00:02 | 显示全部楼层
把DNS服务器地址改成内网的网关地址,应该就可以了.
我的RH9上上是这样的.
不过俺是电信的ADSL
回复 支持 反对

使用道具 举报

发表于 2006-5-8 15:44:46 | 显示全部楼层
能够ping通外网的DNS,应该说明你的网络是正常的。

你运行nslookup www.linuxsir.cn看看有什么情况。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-5-8 19:18:59 | 显示全部楼层
root@khchan:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
root@khchan:~# cat /etc/resolv.conf
nameserver 202.96.128.86
nameserver 202.96.134.133
root@khchan:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0A:E4:29:A5:98
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20a:e4ff:fe29:a598/64 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:50 errors:0 dropped:0 overruns:0 frame:0
          TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3267 (3.1 KiB)  TX bytes:3393 (3.3 KiB)

lo        Link encapocal 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:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:700 (700.0 b)  TX bytes:700 (700.0 b)

root@khchan:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.1.4
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 202.96.128.86 202.96.134.133

root@khchan:~# 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
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0


root@khchan:~# ping 202.96.128.86
PING 202.96.128.86 (202.96.128.86) 56(84) bytes of data.
64 bytes from 202.96.128.86: icmp_seq=1 ttl=242 time=195 ms
64 bytes from 202.96.128.86: icmp_seq=2 ttl=242 time=225 ms
64 bytes from 202.96.128.86: icmp_seq=3 ttl=242 time=191 ms
64 bytes from 202.96.128.86: icmp_seq=4 ttl=242 time=209 ms


nslookup www.linuxsir.cn 没有反应~~~
真是头昏
回复 支持 反对

使用道具 举报

发表于 2006-5-8 19:24:05 | 显示全部楼层
202.96.128.86 是你的 DNS?怎么这么慢啊
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表