LinuxSir.cn,穿越时空的Linuxsir!

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

请大家诊断──系统启动,不能自动无线上网问题!!!!!──附有详细描述!

[复制链接]
发表于 2009-4-15 14:24:19 | 显示全部楼层 |阅读模式
1.Thinkpad T22  , cisco pcmcia aironet 350和内置的pci mini 3com ,系统为全新安装的Lenny!   ──eth0为 3com,eth1为无线。
2.环境是通过路由,固定IP,无线上网。

问题描述:1、启动后,显示,网络连上,有信号!就是不能上网。

                     2、经过下列操作

                           /etc/init.d/networking stop   
                           ifup  eth1   
      
                           就可以上网了。

                    3、试过: ifdwon eth1,ifup eth1,不能上网

下列为配置文件内容:

一、/etc/network/interfaces :
# The loopback network interface

auto lo
iface lo inet loopback

#######################################

# The primary network interface

allow-hotplug eth0
iface eth0 inet static
        address 192.168.1.8
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        
        dns-nameservers 192.168.1.1


# The pcmica wireless network interface

allow-hotplug eth1
iface eth1 inet static
        address 192.168.1.6
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
      
        dns-nameservers 192.168.1.1

wireless-essid ljshdfhsakh
wireless-key DSDFSF77DFSSAA4E607E5DS67DFS7   restricted



二、配制文件的内容/etc/init.d/networking  :


PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"

[ -x /sbin/ifup ] || exit 0

. /lib/lsb/init-functions

process_options() {
    [ -e /etc/network/options ] || return 0
    log_warning_msg "/etc/network/options still exists and it will be IGNORED! Read README.Debian of netbase."
}

check_network_file_systems() {
    [ -e /proc/mounts ] || return 0

    exec 9<&0 < /proc/mounts
    while read DEV MTPT FSTYPE REST; do
        case $DEV in
        /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
            log_warning_msg "not deconfiguring network interfaces: network devices still mounted."
            exit 0
            ;;
        esac
        case $FSTYPE in
        nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
            log_warning_msg "not deconfiguring network interfaces: network file systems still mounted."
            exit 0
            ;;
        esac
    done
    exec 0<&9 9<&-
}
case "$1" in
start)
        process_options

        log_action_begin_msg "Configuring network interfaces"
        if ifup -a; then
            log_action_end_msg $?
        else
            log_action_end_msg $?
        fi
        ;;

stop)
        check_network_file_systems

        log_action_begin_msg "Deconfiguring network interfaces"
        if ifdown -a --exclude=lo; then
            log_action_end_msg $?
        else
            log_action_end_msg $?
        fi
        ;;

force-reload|restart)
        process_options

        log_action_begin_msg "Reconfiguring network interfaces"
        ifdown -a --exclude=lo || true
        if ifup -a --exclude=lo; then
            log_action_end_msg $?
        else
            log_action_end_msg $?
        fi
        ;;

*)
echo "Usage: /etc/init.d/networking {start|stop|restart|force-reload}"
        exit 1
        ;;
esac

exit 0
 楼主| 发表于 2009-4-15 20:24:30 | 显示全部楼层
两网卡IP,不能设置为同一网段!!!
回复 支持 反对

使用道具 举报

发表于 2009-4-15 22:13:53 | 显示全部楼层
你的无线的interface要改为dhcp方式,我的理解是你是固定ip上网的用户,用了路由器,那么路由器是固定ip连接的,但是你的电脑和路由器一般默认应该是dhcp方式,所以你的eth0、eth1最好是改为dhcp方式。你不会把路由器里的自动ip地址分配设为static吧,那你太有才了。
回复 支持 反对

使用道具 举报

发表于 2009-4-15 22:16:55 | 显示全部楼层
Post by asdfg777;1974867
两网卡IP,不能设置为同一网段!!!


这个好像要看在什么环境下,一般情况下是没问题的,网段是可以相同的,只是地址不能相同就行。
回复 支持 反对

使用道具 举报

发表于 2009-4-15 22:45:07 | 显示全部楼层

前一段时间将好弄过

回复 支持 反对

使用道具 举报

发表于 2009-4-16 09:01:43 | 显示全部楼层
Post by asdfg777;1974867
两网卡IP,不能设置为同一网段!!!

错!
Post by favoyun
你的无线的interface要改为dhcp方式,我的理解是你是固定ip上网的用户,用了路由器,那么路由器是固定ip连接的,但是你的电脑和路由器一般默认应该是dhcp方式,所以你的eth0、eth1最好是改为dhcp方式。你不会把路由器里的自动ip地址分配设为static吧,那你太有才了。  

你也很有才!


lz 你还有关键的信息没贴出来。第二步前后 ifconfig eth1, route -n, cat /etc/resolv.conf 的信息都贴出来看看。还有你的路由器在局域网段是否用了 dhcp?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-4-16 13:09:33 | 显示全部楼层
/etc/resolv.conf   :  
  nameserver  192.168.1.1

ifconfig eth1       :

eth1      Link encap:Ethernet  HWaddr 12:ER:TY:YU:RE
          inet addr:192.168.1.6  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:564 errors:5 dropped:0 overruns:0 frame:5
          TX packets:585 errors:12 dropped:0 overruns:0 carrier:12
          collisions:6 txqueuelen:1000
          RX bytes:409961 (400.3 KiB)  TX bytes:78343 (76.5 KiB)
          Interrupt:3 Base address:0x100

route -n :

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-4-16 13:27:44 | 显示全部楼层
请大家都 来帮忙!!!!
另发现:
系统系统后,用:ifdown eth0,也能正常上网了!!
回复 支持 反对

使用道具 举报

发表于 2009-4-16 23:39:34 | 显示全部楼层
Post by asdfg777;1975245
请大家都 来帮忙!!!!
另发现:
系统系统后,用:ifdown eth0,也能正常上网了!!


我一直用这种方法,呵呵。
回复 支持 反对

使用道具 举报

发表于 2009-4-17 08:44:27 | 显示全部楼层
你只贴了第二步之后的 route -n, 第二步之前的也贴出来。

eth0 接到哪个网络?

可能你的缺省路由走的是 eth0:
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

修改一下让它走 eth1.

route del -net 0/0 gw 192.168.1.1 dev eth0
route add -net 0/0 gw 192.168.1.1 dev eth1

你这样试试。我手头没有环境无法试验。
回复 支持 反对

使用道具 举报

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

本版积分规则

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