[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 关于开机自动连接无线路由的问题



harry 写道:
> 我的 /etc/network/interfaces 文件内容设置如下:
>
> auto lo
> iface lo inet loopback
>
> iface wlan0 inet static
> address 192.168.1.100
> netmask 255.255.255.0
> gateway 192.168.1.1
> wireless-key s:gecko
> wireless-essid harry
>
> auto wlan0
>
> 现在有2个问题,一个是开机后不是每次都能连上无线路由,有时行有时不行,
> 如果连不上 我执行一次 /ett/init.d/networking restart 才可以
>
> 第二个问题是,即使连上了无线路由,/etc/resolv.conf 里面不会自动写入 dns,我手动在里面写好
> nameserver后,下次启动后不管有没有连上无线路由,这个文件里的内容又被清空了。
>   
首先是这个问题,按照debian参考手册的做法(http:
//www.debian.org/doc/manuals/reference/ch-
gateway.zh-cn.html#s-net-ifupdown),应当是这样。

     iface eth0 inet static
             address 192.168.0.111
             netmask 255.255.255.0
             gateway 192.168.0.1
             dns-search somedomain.org
             dns-nameservers 195.238.2.21 195.238.2.22

原理似乎是启动无线接口后自动重写/etc/resolv.conf
> 大家帮我看下,我哪里有设置错误吗?
>
> --
> harry
> My Blog: http://harryxu.cn/blog
>   

从第二个问题反推的话,我认为你的无线其实是连接上的,只是在后面的某个步骤
被关闭了。可能的原因有设备驱动重载,其他管理器接管初始化等等。你可以检查
/etc/rc2.d(Debian默认是这个),在networking的后面加入一个临时脚本,检验
网络是否可用,可以验证我的猜测。变更这个脚本的位置,大致能定位出是什么关
闭了你的网络。


Reply to: