LinuxSir.cn,穿越时空的Linuxsir!

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

Ubuntu下采用adsl猫+路由器上网问题

[复制链接]
发表于 2005-5-9 22:13:31 | 显示全部楼层 |阅读模式
路由器采用dhcp
/etc/network/interfaces 中:

auto eth0
iface eth0 inet dhcp

/etc/resolv.conf 中:

nameserver 192.168.2.1 #路由器地址

无法解析地址
需要打开路由器192.168.2.1配置页面,随便设置个参数apply一下,才能正常上网。

何故》》?
发表于 2005-5-9 22:36:12 | 显示全部楼层
DNS;你别指定路由。。你自己添加一个当地的DNS服务器IP就行了。
DHCP:是可以自动添加DNS的。。你无需指定到路的地址。
回复 支持 反对

使用道具 举报

发表于 2005-5-9 22:37:48 | 显示全部楼层
DNS;你别指定路由。。你自己添加一个当地的DNS服务器IP就行了。
DHCP:是可以自动添加DNS的。。你无需指定到路的地址。


我觉的还是自己手动指定IP及网关来的直接。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-5-9 22:48:01 | 显示全部楼层
时好时坏

我指定IP也不行
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-5-9 22:49:44 | 显示全部楼层
或许是route的问题

root@ubuntu:/etc/network # cat 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

     auto eth0
     iface eth0 inet dhcp

#iface eth0 inet static
#     address 192.168.2.100
#     network 192.168.2.0
#     netmask 255.255.255.0
#     broadcast 192.168.2.255
#     gateway 192.168.2.1

     auto eth1
     iface eth1 inet static
     address 192.168.1.1
     network 192.168.1.0
     netmask 255.255.255.0
     broadcast 192.168.1.255
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
#mapping hotplug
#       script grep
#       map eth0
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-5-9 22:52:35 | 显示全部楼层
正常上网时
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
default         .               0.0.0.0         UG    0      0        0 eth0
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-5-9 22:54:07 | 显示全部楼层
Post by 食古不化
正常上网时
$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
default         .               0.0.0.0         UG    0      0        0 eth0


无法上网时,我记得 route时,第三行 (default的那行)不一样。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-5-10 01:19:12 | 显示全部楼层
重新开机后,有很短的一段时间可以连接,因为可以update。
但很快就不行了,浏览器和update时都在解析域名时化很长时间,但最后仍无法解析。
还是要先登入192.168.2.1(路由器管理界面)然后设置个选项apply后,立刻就能连接了。

想不通。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-5-10 03:07:59 | 显示全部楼层
去掉了ipv6去掉了另一块网卡的配置

改为固定IP
# cat 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

     auto eth0
#     iface eth0 inet dhcp

      iface eth0 inet static
      address 192.168.2.100
#     network 192.168.2.0
      netmask 255.255.255.0
#     broadcast 192.168.2.255
      gateway 192.168.2.1

还是如故

需先预热?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-5-10 12:29:34 | 显示全部楼层
在M$下也偶尔出现无法解析的情况,但是BT还在下(它直接用IP地址),说明网络没有问题。一会就好,能上了。
是路由器配置不当?
我用的是 SMC 7004ABR路由器。连接方式为
电话线——>ADSL猫——>路由器——>交换机——>C
我的电脑是从路由器的四个口中直接接过来的。
在M$下也配置成直接指定IP方式(原来是dhcp方式)。
回复 支持 反对

使用道具 举报

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

本版积分规则

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