今天要试一下本本上的无线网卡,在windows上是可以work的,于是切换到solaris下,我装的solaris版本是nevada-B84.
[aubrey-sz330@~]cat /etc/release Solaris Express Community Edition snv_84 X86 Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 25 February 2008
|
系统boot起来后,看看网络设备情况:
# ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1 inet6 ::1/128 |
faint, 找都找不到. 好吧,先看看是啥网卡:
# /usr/X11/bin/scanpci | grep Wireless Intel Corporation PRO/Wireless 3945ABG Network Connection
|
哦,还好,3945 solaris已经支持了, 网络设备名为wpix. OK,来plumb一下:
# ifconfig wpi0 plumb (什么什么没有link,忘了具体的提示了)
|
Oops,原来我把radio关掉了,打开radio,sys-unconfig重起吧
# sys-unconfig (重起后wpi0找到,需要配置如下几个东西: --> 静态ip,因为dhcp找不到地址的,solaris都不知道连哪个AP呢 --> name server选择dns --> 设置name server的地址,可以在windows机器上看到 --> 好像还有个domain name要设置)
|
ok, 系统又boot起来了,再看看网络设备啥情况:
# ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 wpi0: flags=201000803<UP,BROADCAST,MULTICAST,IPv4,CoS> mtu 1500 index 2 inet 192.168.1.108 netmask ffffff00 broadcast 192.168.1.255 ether 0:19:d2:8c:c6:4c lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1 inet6 ::1/128 |
嗯,不错,这回有了,ping 一下路由器看看
# ping 192.168.1.1 (等了n久不睬我) ^C #
|
要开始做wifi配置了,先来search一下
# wificonfig -i wpi0 scan essid bssid type encryption signallevel TP-LINK_6 00:19:e0:b1:7b:58 access point wep 5 linksys 00:18:39:8e:c1:46 access point none 9 .... .... D-LINK 00:1a:70:e5:3a:69 access point wep 3 |
Wow,我们家附近的AP还真不少,不过偶的linksys没有加密.
为我的无线AP创建一个profile吧
# wificonfig createprofile linksys essid=linksys encryption=none |
如果加密了也很easy,这么配置就可以了
# wificonfig createprofile linksys essid=linksys encryption=wep wepkey1=<yourkey> |
然后连一把
# wificonfig -i wpi0 connect linksys wificonfig: connecting to profile 'linksys' |
本本上的WLAN的灯亮了,莫非连上了?
# ping 192.168.1.1 192.168.1.1 is alive |
不错,真的连上了,哈哈。
迫不及待的打开firefox,输入www.google.com,连不上..., 看来高兴得太早了,咋回事?
先ping一下name server看看:
[aubrey-sz330@~]cat /etc/resolv.conf domain sh.intel.com nameserver 202.158.161.1 nameserver 202.158.161.2
# ping 202.158.161.1 ICMP Host Unreachable from gateway aubrey-sz330 (192.168.1.108) for icmp from aubrey-sz330 (192.168.1.108) to 202.158.161.1
|
ICMP Unreachable???莫非不知道怎么出去?没有路由?看看:
# netstat -r
Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ---------- --------- 192.168.1.0 aubrey-sz330 U 1 14 wpi0 localhost localhost UH 1 303 lo0 |
嗯,果然没有default的gateway,加一下好了
# route add default 192.168.1.1 add net default: gateway 192.168.1.1 |
再看看路由:
# netstat -rn
Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ---------- --------- default 192.168.1.1 UG 1 1 192.168.1.0 192.168.1.108 U 1 14 wpi0 127.0.0.1 127.0.0.1 UH 1 303 lo0 |
好了,这下有了, 再来试试name service
# nslookup www.google.com Server: 202.158.161.1 Address: 202.158.161.1#53
Non-authoritative answer: www.google.com canonical name = www.l.google.com. www.l.google.com canonical name = www-china.l.google.com. Name: www-china.l.google.com Address: 64.233.189.99 Name: www-china.l.google.com Address: 64.233.189.104 |
OK, 可以了,firefox打开后,可以看到google的logo了,:D
[note]: 如果nslookup已经可以work了,但是firefox还是不能上网的话,这个时候你ping一下www.google.com会跟你抱怨unknown host,这说明你的/etc/nsswitch.conf这个文件有问题,
你要做的就是
#cp /etc/nsswitch.dns /etc/nsswitch.conf
|
然后重起,然后就可以上网了,嘿嘿!