LinuxSir.cn,穿越时空的Linuxsir!

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

Gentoo无线上网的问题(已解决)

[复制链接]
发表于 2009-5-18 18:30:13 | 显示全部楼层 |阅读模式
现在的条件是:

路由器是用WEP加密的, 每台电脑使用固定的IP来上网(我的是192.168.1.137),   已知我的本本在Windows下和Ubuntu下是可以通过无线上网,可在Gentoo下可以看得到路由器,去死活也上不了网,(192.168.1.104是我的网关)
[code]
PING 192.168.1.104 56(84) bytes of data.
From 192.168.1.137 icmp_seq=1 Destination Net Unreachable
From 192.168.1.137 icmp_seq=2 Destination Net Unreachable
From 192.168.1.137 icmp_seq=3 Destination Net Unreachable
From 192.168.1.137 icmp_seq=4 Destination Net Unreachable
[/code]

#iwlist eth1 scanning
  1. eth1      Scan completed :
  2.           Cell 01 - Address: 00:23:CD:59:9C:4A
  3.                     ESSID:"TP-LINK_599C4A"
  4.                     Mode:Managed
  5.                     Frequency:2.437 GHz (Channel 6)
  6.                     Quality:5/5  Signal level:-41 dBm  Noise level:-93 dBm
  7.                     Encryption key:on
  8.                     Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
  9.                               12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
  10.                               48 Mb/s; 54 Mb/s
复制代码


#iwconfig
  1. eth1      IEEE 802.11bg  ESSID:"TP-LINK_599C4A"  Nickname:""
  2.           Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: 52:EA:D0:CB:2D:87   
  3.           Bit Rate=54 Mb/s   Tx-Power:32 dBm   
  4.           Retry min limit:7   RTS thr:off   Fragment thr:off
  5.           Power Managementmode:All packets received
  6.           Link Quality=5/5  Signal level=-57 dBm  Noise level=-92 dBm
  7.           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
  8.           Tx excessive retries:0  Invalid misc:0   Missed beacon:0
复制代码


#ifconfig
  1. eth1      Link encap:Ethernet  HWaddr 00:21:00:42:7e:ee  
  2.           inet addr:192.168.1.137  Bcast:192.168.1.255  Mask:255.255.255.0
  3.           inet6 addr: fe80::221:ff:fe42:7eee/64 Scope:Link
  4.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  5.           RX packets:0 errors:0 dropped:0 overruns:0 frame:9859
  6.           TX packets:39 errors:5 dropped:0 overruns:0 carrier:0
  7.           collisions:0 txqueuelen:1000
  8.           RX bytes:0 (0.0 B)  TX bytes:2250 (2.1 KiB)
  9.           Interrupt:17

  10. lo        Link encap:Local Loopback  
  11.           inet addr:127.0.0.1  Mask:255.0.0.0
  12.           inet6 addr: ::1/128 Scope:Host
  13.           UP LOOPBACK RUNNING  MTU:16436  Metric:1
  14.           RX packets:717602 errors:0 dropped:0 overruns:0 frame:0
  15.           TX packets:717602 errors:0 dropped:0 overruns:0 carrier:0
  16.           collisions:0 txqueuelen:0
  17.           RX bytes:207159407 (197.5 MiB)  TX bytes:207159407 (197.5 MiB)
复制代码


#route
  1. Kernel IP routing table
  2. Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
  3. 192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
  4. loopback        MyGentoo.Lenovo 255.0.0.0       UG    0      0        0 lo
  5. default         192.168.1.104   0.0.0.0         UG    2004   0        0 eth1
复制代码


cat  /etc/conf.d/net
  1. # Regardless of which DHCP client you prefer, you configure them the
  2. # same way using one of following depending on which interface modules
  3. # you're using.
  4. config_eth0=( "dhcpcd" )

  5. # For passing custom options to dhcpcd use something like the following.  This
  6. # example reduces the timeout for retrieving an address from 60 seconds (the
  7. # default) to 10 seconds.
  8. dhcpcd_eth0="-t 5"


  9. #无线网络配置
  10. modules=( "wpa_supplicant" )
  11. wpa_supplicant_eth1="-Dwext"
  12. #modules=( "iwconfig" )
  13. #key_ESSID1=" [1] s:1234567890 key [1] enc open"
  14. #preferred_aps=( "ESSID1" )
  15. #wpa_supplicant_eth1="-Dwext -ieth1 -c/etc/wpa_supplicant/wpa_supplicant.conf"

  16. config_eth1=( "192.168.1.137" )
  17. routes_eth1=( "default via 192.168.1.104" )

  18. #essid_eth1="TP-LINK-599C4A"
  19. #key_ESSID="s:1234567890 "
  20. #config_002100427eee=( "192.168.1.137 netmask 255.255.255.0 broadcast 192.168.1.
  21. 104" )
  22. #dns_servers_002100427eee=( "60.12.6.10" "192.168.2.250" )
  23. dns_servers_0023CD599C4A=( "60,12.6.10" "192.168.2.250" )
复制代码


cat/etc/wpa_supplicant/wpa_supplicant.conf

  1. # This is a network block that connects to any unsecured access point.
  2. # We give it a low priority so any defined blocks are preferred.

  3. ctrl_interface=/var/run/wpa_supplicant
  4. ctrl_interface_group=wheel

  5. ap_scan=1

  6. network={
  7.   ssid="TP-LINK_599C4A"
  8.   key_mgmt=NONE
  9.   wep_key0="1234567890"
  10.   wep_tx_keyidx=0
  11.   priority=5
  12.   }
复制代码


在unbuntu下可以上网的配置:
cat /etc/network/interfaces
  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).

  3. # The loopback network interface
  4. auto lo
  5. iface lo inet loopback

  6. # The primary network interface
  7. auto eth0
  8. iface eth0 inet dhcp

  9. iface eth1 inet static
  10. address 192.168.1.137
  11. netmask 255.255.255.0
  12. gateway 192.168.1.104
  13. wireless-key 1234567890
  14. wireless-essid TP-LINK_599C4A
  15. auto eth1
复制代码


Ubuntu下用的是network manager的吧,因为我的Gentoo没有安装gnome和kde,不知如何用network manager,如果能不用network manager就可以上网那就最好了,各位有什么主意??这可折磨我很久了!!
发表于 2009-5-18 18:46:12 | 显示全部楼层
wicd挺好用的啊
回复 支持 反对

使用道具 举报

发表于 2009-5-18 22:29:28 | 显示全部楼层
networkmanager不依赖gnome和kde,只要gnome的一个组件,policykit-gnome
回复 支持 反对

使用道具 举报

发表于 2009-5-18 22:29:45 | 显示全部楼层
装NetworkManager好象要用gnome的USE才在托盘有个图标,启动用
$ sudo /etc/init.d/NetworkManager start
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-19 10:20:11 | 显示全部楼层
晕呀~~

现在情况是别的机可以ping得到本机,而本机去不能ping到其它的机子,这是什么原因呢?
回复 支持 反对

使用道具 举报

发表于 2009-5-19 14:06:04 | 显示全部楼层
#iwconfig
   eth1:   Mode:Ad-Hoc

#iwlist
   eth1:   Mode:Managed

检查这里。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-20 12:27:34 | 显示全部楼层
Post by yetop;1988833
#iwconfig
   eth1:   Mode:Ad-Hoc

#iwlist
   eth1:   Mode:Managed

检查这里。


设置为一样了还是不行呢
回复 支持 反对

使用道具 举报

发表于 2009-5-20 13:52:18 | 显示全部楼层
你装一个 wicd 吧。别折腾了。
要不就去看看 iwconfig 的man,这个东西怎么用。
回复 支持 反对

使用道具 举报

发表于 2009-5-20 16:33:17 | 显示全部楼层
搂住仔细研读一下安装手册吧,我的gentoo也是无限 wep加密,但是没用什么network manager。

我只是按照安装手册做的。(甚至没用到手册后面的高级网络部分)
回复 支持 反对

使用道具 举报

发表于 2009-5-21 00:59:40 | 显示全部楼层
我的配置,楼主可以参考一下,不知是否有帮助!
  1. # This blank configuration will automatically use DHCP for any net.*
  2. # scripts in /etc/init.d.  To create a more complete configuration,
  3. # please review /etc/conf.d/net.example and save your configuration
  4. # in /etc/conf.d/net (this file :]!).
  5. # 设置DNS、NIS服务名字。
  6.   dns_domain_lo="Gentoo"
  7.   nis_domain_lo="Gentoo"
  8. #==============================================================================================================================#
  9. # 一、ADSL
  10. # ADSL宽带拨号网络设置。
  11. # config_eth0="adsl"
  12. # ............................................................................................................................ #
  13. # 二、局域网
  14. # 1.局域网自动获取IP设置。
  15. # modules="dhcpcd"                                        # Only needed if you have more than one DHCP module installed
  16. # config_eth0="dhcp"
  17. # dhcpcd_eth0="-t 10"                                        # Timeout after 10 seconds
  18. # dhcp_eth0="release nodns nontp nonis"                        # Only get an address
  19. # 2.局域网手动获取IP设置。
  20.   ifplugd_eth0="..."                                        # 监控一个有线网卡
  21.   modules="iproute2"
  22.   config_eth0="192.168.1.10/24"
  23.   config_eth0="192.168.1.10 netmask 255.255.255.0"
  24.   routes_eth0="default via 192.168.1.1"
  25.   dhcpcd_eth0="-t 5 -c resolv.conf -O ntp_servers"
  26.   dns_servers_eth0="202.96.128.86 202.96.128.166 211.162.62.2 211.162.62.61"
  27. # ............................................................................................................................ #
  28. # 三、GPRS
  29. # 西门子手机GPRS上网设置。
  30. # config_ppp0="ppp"
  31. # link_ppp0="/dev/ttyUSB0"
  32. # ............................................................................................................................ #
  33. # 四、WIFI
  34. # 1.ETH1_WIFI无线网络设置,使用wireless-tools。
  35. # ifplugd_eth1="--api-mode=wlan"                        # 监控无线网卡接入
  36. # iwconfig_eth1="mode managed"                                # using the host-ap driver
  37. # mac_eth1="00:11:22:33:44:55"                                # To set the MAC address of the interface       
  38. # modules_eth1="iwconfig"                                # wireless-tools
  39. # preferred_aps_eth1="Hooong"                                # 有时有多个AP可见,所以我们需要规定一个首选的连接次序
  40. # key_Hooong="[1] 1234567890 key [1] enc open"                # 为相应的ESSID AP配置WEP密钥
  41. # associate_order="forceany"                                # 细致调整AP选择,外加连接到任何其他可用的AP
  42. # blacklist_aps="ESSID1" "ESSID2"                        # 有时您根本不想连接到某些AP
  43. # unique_ap="yes"                                        # 是否允许每个卡都能连接到同一个无线AP
  44. # sleep_associate_eth1=60                                # Timeout after 60 seconds
  45. # config_wlan0="dhcp"
  46. # dhcpcd_wlan0="-t 10"                                        # Timeout after 10 seconds
  47. # dhcp_wlan0="release nodns nontp nonis"                # Only get an address
  48. # config_eth1="192.168.16.11/24"
  49. # config_eth1="192.168.16.11 netmask 255.255.255.0"
  50. # routes_eth1="default via 192.168.16.1"
  51. # dhcpcd_eth1="-t 5 -c resolv.conf -O ntp_servers"
  52. # dns_servers_eth1="208.67.220.220 208.67.222.222"
  53. # 2.ETH1 WIFI无线网络设置,使用wpa_supplicant。
  54.   ifplugd_eth1="--api-mode=wlan"                        # 监控无线网卡接入
  55.   iwconfig_eth1="mode managed"                                # using the host-ap driver
  56.   mac_eth1="00:11:22:33:44:66"                                # To set the MAC address of the interface       
  57.   modules_eth1="wpa_supplicant"                                # Prefer wpa_supplicant over wireless-tools
  58.   wpa_supplicant_eth1="-ieth1 -Dwext"                        # It's important that we tell wpa_supplicant which driver
  59.   wpa_timeout_eth1=60                                        # Timeout after 60 seconds
  60.   config_eth1="192.168.16.11/24"
  61.   config_eth1="192.168.16.11 netmask 255.255.255.0"
  62.   routes_eth1="default via 192.168.16.1"
  63.   dhcpcd_eth1="-t 5 -c resolv.conf -O ntp_servers"
  64.   dns_servers_eth1="208.67.220.220 208.67.222.222"
  65. # ............................................................................................................................ #
  66. # 3.WLAN0 WIFI无线网络设置,使用wireless-tools。
  67.   ifplugd_wlan0="--api-mode=wlan"                        # 监控无线网卡接入
  68. # iwconfig_wlan0="mode managed"                                # using the host-ap driver
  69.   mac_wlan0="00:11:22:33:44:77"                                # To set the MAC address of the interface       
  70.   modules_wlan0="iwconfig"                                # wireless-tools
  71.   preferred_aps="Hooong TP-Link dlin"                        # 有时有多个AP可见,所以我们需要规定一个首选的连接次序
  72.   key_Hooong="[1] 8888888888 key [1] enc open"                # 为相应的ESSID AP配置WEP密钥
  73.   key_TP-Link="[1] 1234567890 key [1] enc open"         # 为相应的ESSID AP配置WEP密钥
  74.   key_dlin="[1] 1122334455 key [1] enc open"                # 为相应的ESSID AP配置WEP密钥
  75.   associate_order="forceany"                                # 细致调整AP选择,外加连接到任何其他可用的AP
  76. # blacklist_aps="ESSID1" "ESSID2"                        # 有时您根本不想连接到某些AP
  77.   unique_ap="yes"                                        # 是否允许每个卡都能连接到同一个无线AP
  78.   sleep_associate_wlan0=60                                # Timeout after 60 seconds
  79.   config_wlan0="dhcp"
  80.   dhcpcd_wlan0="-t 10"                                        # Timeout after 10 seconds
  81.   dhcp_wlan0="release nodns nontp nonis"                # Only get an address
  82.   dns_servers_Hooong="210.21.4.130 210.56.57.58"        # 为相应的ESSID AP配置DNS解释服务器
  83. # config_wlan0="192.168.16.12/24"
  84. # config_wlan0="192.168.16.12 netmask 255.255.255.0"
  85. # routes_wlan0="default via 192.168.16.1"
  86. # dhcpcd_wlan0="-t 5 -c resolv.conf -O ntp_servers"
  87. # dns_servers_wlan0="208.67.220.220 208.67.222.222"
  88. # 4.WLAN0 WIFI无线网络设置,使用wpa_supplicant。
  89. # ifplugd_wlan0="--api-mode=wlan"                        # 监控无线网卡接入
  90. # iwconfig_wlan0="mode managed"                                # using the host-ap driver
  91. # mac_wlan0="00:11:22:33:44:88"                                # To set the MAC address of the interface       
  92. # modules_wlan0="wpa_supplicant"                        # Prefer wpa_supplicant over wireless-tools
  93. # wpa_supplicant_wlan0="-ieth1 -Dwext"                        # It's important that we tell wpa_supplicant which driver
  94. # wpa_timeout_wlan0=60                                        # Timeout after 60 seconds
  95. # config_wlan0="192.168.16.12/24"
  96. # config_wlan0="192.168.16.12 netmask 255.255.255.0"
  97. # routes_wlan0="default via 192.168.16.1"
  98. # dhcpcd_wlan0="-t 5 -c resolv.conf -O ntp_servers"
  99. # dns_servers_wlan0="208.67.220.220 208.67.222.222"
  100. # ............................................................................................................................ #
  101. # 五、网络桥接
  102. # VirtualBox 网络桥接设置。
  103. # config_eth0="null"
  104. # tuntap_vbox0="tap"
  105. # config_vbox0="null"
  106. # tunctl_vbox0="-u jiang"
  107. # config_br0="192.168.10.2 netmask 255.255.255.0"
  108. # routes_br0="default via 192.168.10.1"
  109. # bridge_br0="eth0 vbox0"
  110. # depend_br0()
  111. # {
  112. #        need net.eth0
  113. #        need net.vbox0
  114. # }
  115. # brctl_br0="setfd 0"
  116. #==============================================================================================================================#
复制代码
回复 支持 反对

使用道具 举报

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

本版积分规则

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