• Ubuntu server 配置 TL-WN821N 无线网卡


    公司的服务器安装了ubuntu server 12.04 后有时候拷贝文件会卡住.,怀疑是主板网卡问题.

    所以买了一张PCI的网卡后无法驱动,再换无线USB网卡.

    选配了TL-WN821N  这款.

    弄了一下配置后成功上网.

    把配置分析给大家.


    root@lejin:/home/yuanwei# vim /etc/network/interfaces


    auto lo
    iface lo inet loopback
    auto wlan0
    iface wlan0 inet static
    address         192.168.1.18
    gateway         192.168.1.1
    netmask         255.255.255.0
    network         192.168.1.0
    broadcast       192.168.1.255
    wpa-driver      wext
    wpa-ssid  LovDream_public
    wpa-ap-scan     1
    wpa-proto       RSN
    wpa-pairwise    CCMP
    wpa-group       CCMP
    wpa-key-mgmt    WPA-PSK
    wpa-psk da7f876751e3762b82da361c4c4311e507cfb3e014605f160dcf1b86f790574f 

    其中

    wpa-psk da7f876751e3762b82da361c4c4311e507cfb3e014605f160dcf1b86f790574f 生成方法如下:

    wpa_passphrase ssid  password


    vim /etc/wpa_supplicant.conf 

    ctrl_interface=/var/run/wpa_supplicant
    ctrl_interface_group=0
    ap_scan=1
    network={
            ssid="LovDream_public"
            pairwise=CCMP TKIP
            group=CCMP TKIP WEP104 WEP40
            proto=WPA
            key_mgmt=WPA-PSK
            priority=1
            
            psk=da7f876751e3762b82da361c4c4311e507cfb3e014605f160dcf1b86f790574f
    }
    ~     

    可能有些配置重复了.  等后面再修改.


    修改后重启服务

    root@lejin:/etc/network# /etc/init.d/networking restart
     * Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
     * Reconfiguring network interfaces...                                                                                              ioctl[SIOCSIWENCODEEXT]: Invalid argument
    ioctl[SIOCSIWENCODEEXT]: Invalid argument
    RTNETLINK answers: File exists
    Failed to bring up wlan0.
                                   

    报错. 那重启服务器.后OK了.

    root@lejin:/home/yuanwei# ifconfig
    lo        Link encap:本地环回  
              inet 地址:127.0.0.1  掩码:255.0.0.0
              inet6 地址: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  跃点数:1
              接收数据包:4 错误:0 丢弃:0 过载:0 帧数:0
              发送数据包:4 错误:0 丢弃:0 过载:0 载波:0
              碰撞:0 发送队列长度:0 
              接收字节:240 (240.0 B)  发送字节:240 (240.0 B)


    wlan0     Link encap:以太网  硬件地址 0c:82:68:44:33:ae  
              inet 地址:192.168.1.18  广播:192.168.1.255  掩码:255.255.255.0
              inet6 地址: fe80::e82:68ff:fe44:33ae/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  跃点数:1
              接收数据包:3905 错误:0 丢弃:0 过载:0 帧数:0
              发送数据包:2152 错误:0 丢弃:0 过载:0 载波:0
              碰撞:0 发送队列长度:1000 
              接收字节:4814979 (4.8 MB)  发送字节:244538 (244.5 KB)


    root@lejin:/home/yuanwei# iwconfig
    eth0      no wireless extensions.


    lo        no wireless extensions.


    wlan0     IEEE 802.11bgn  ESSID:"LovDream_public"  
              Mode:Managed  Frequency:2.437 GHz  Access Point: 1C:FA:68:B8:9F:7C   
              Bit Rate=18 Mb/s   Tx-Power=20 dBm   
              Retry  long limit:7   RTS thr=2347 B   Fragment thr:off
              Encryption key:off
              Power Management:off
              Link Quality=67/70  Signal level=-43 dBm  
              Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
              Tx excessive retries:0  Invalid misc:42   Missed beacon:0


    实际测试下:

    root@lejin:/home/yuanwei# apt-get update
    命中 http://cn.archive.ubuntu.com precise Release.gpg
    命中 http://cn.archive.ubuntu.com precise-updates Release.gpg
    命中 http://cn.archive.ubuntu.com precise-backports Release.gpg
    命中 http://cn.archive.ubuntu.com precise Release    
    命中 http://cn.archive.ubuntu.com precise-updates Release
    命中 http://cn.archive.ubuntu.com precise-backports Release                                      
    命中 http://cn.archive.ubuntu.com precise/main Sources                    
    命中 http://cn.archive.ubuntu.com precise/restricted Sources
    命中 http://cn.archive.ubuntu.com precise/universe Sources
    命中 http://cn.archive.ubuntu.com precise/multiverse Sources
    命中 http://cn.archive.ubuntu.com precise/main amd64 Packages
    命中 http://cn.archive.ubuntu.com precise/restricted amd64 Packages
    命中 http://cn.archive.ubuntu.com precise/universe amd64 Packages
    命中 http://cn.archive.ubuntu.com precise/multiverse amd64 Packages
    命中 http://cn.archive.ubuntu.com precise/main i386 Packages
    命中 http://cn.archive.ubuntu.com precise/restricted i386 Packages
    命中 http://cn.archive.ubuntu.com precise/universe i386 Packages
    命中 http://cn.archive.ubuntu.com precise/multiverse i386 Packages
    命中 http://cn.archive.ubuntu.com precise/main TranslationIndex
    命中 http://cn.archive.ubuntu.com precise/multiverse TranslationIndex
    命中 http://cn.archive.ubuntu.com precise/restricted TranslationIndex
    命中 http://cn.archive.ubuntu.com precise/universe TranslationIndex
    命中 http://cn.archive.ubuntu.com precise-updates/main Sources
    命中 http://cn.archive.ubuntu.com precise-updates/restricted Sources
    命中 http://cn.archive.ubuntu.com precise-updates/universe Sources
    命中 http://cn.archive.ubuntu.com precise-updates/multiverse Sources
    命中 http://cn.archive.ubuntu.com precise-updates/main amd64 Packages
    命中 http://cn.archive.ubuntu.com precise-updates/restricted amd64 Packages
    命中 http://cn.archive.ubuntu.com precise-updates/universe amd64 Packages
    命中 http://cn.archive.ubuntu.com precise-updates/multiverse amd64 Packages
    命中 http://cn.archive.ubuntu.com precise-updates/main i386 Packages
    命中 http://cn.archive.ubuntu.com precise-updates/restricted i386 Packages
    命中 http://cn.archive.ubuntu.com precise-updates/universe i386 Packages
    命中 http://cn.archive.ubuntu.com precise-updates/multiverse i386 Packages
    命中 http://cn.archive.ubuntu.com precise-updates/main TranslationIndex
    命中 http://cn.archive.ubuntu.com precise-updates/multiverse TranslationIndex
    命中 http://security.ubuntu.com precise-security Release.gpg
    命中 http://cn.archive.ubuntu.com precise-updates/restricted TranslationIndex
    命中 http://cn.archive.ubuntu.com precise-updates/universe TranslationIndex
    命中 http://cn.archive.ubuntu.com precise-backports/main Sources
    命中 http://cn.archive.ubuntu.com precise-backports/restricted Sources
    命中 http://cn.archive.ubuntu.com precise-backports/universe Sources
    命中 http://cn.archive.ubuntu.com precise-backports/multiverse Sources
    命中 http://cn.archive.ubuntu.com precise-backports/main amd64 Packages
    命中 http://cn.archive.ubuntu.com precise-backports/restricted amd64 Packages
    命中 http://cn.archive.ubuntu.com precise-backports/universe amd64 Packages
    命中 http://cn.archive.ubuntu.com precise-backports/multiverse amd64 Packages
    命中 http://cn.archive.ubuntu.com precise-backports/main i386 Packages
    命中 http://cn.archive.ubuntu.com precise-backports/restricted i386 Packages
    命中 http://cn.archive.ubuntu.com precise-backports/universe i386 Packages
    命中 http://cn.archive.ubuntu.com precise-backports/multiverse i386 Packages
    命中 http://cn.archive.ubuntu.com precise-backports/main TranslationIndex
    命中 http://cn.archive.ubuntu.com precise-backports/multiverse TranslationIndex
    命中 http://cn.archive.ubuntu.com precise-backports/restricted TranslationIndex
    命中 http://cn.archive.ubuntu.com precise-backports/universe TranslationIndex
    命中 http://cn.archive.ubuntu.com precise/main Translation-zh_CN
    命中 http://cn.archive.ubuntu.com precise/main Translation-en
    命中 http://cn.archive.ubuntu.com precise/multiverse Translation-zh_CN
    命中 http://cn.archive.ubuntu.com precise/multiverse Translation-en
    命中 http://cn.archive.ubuntu.com precise/restricted Translation-zh_CN
    命中 http://cn.archive.ubuntu.com precise/restricted Translation-en
    命中 http://cn.archive.ubuntu.com precise/universe Translation-zh_CN
    命中 http://cn.archive.ubuntu.com precise/universe Translation-en
    命中 http://cn.archive.ubuntu.com precise-updates/main Translation-zh_CN
    命中 http://security.ubuntu.com precise-security Release
    命中 http://cn.archive.ubuntu.com precise-updates/main Translation-en
    命中 http://cn.archive.ubuntu.com precise-updates/multiverse Translation-zh_CN
    命中 http://cn.archive.ubuntu.com precise-updates/multiverse Translation-en
    命中 http://cn.archive.ubuntu.com precise-updates/restricted Translation-zh_CN
    命中 http://cn.archive.ubuntu.com precise-updates/restricted Translation-en
    命中 http://cn.archive.ubuntu.com precise-updates/universe Translation-zh_CN
    命中 http://cn.archive.ubuntu.com precise-updates/universe Translation-en
    命中 http://cn.archive.ubuntu.com precise-backports/main Translation-en
    命中 http://cn.archive.ubuntu.com precise-backports/multiverse Translation-en
    命中 http://cn.archive.ubuntu.com precise-backports/restricted Translation-en
    命中 http://cn.archive.ubuntu.com precise-backports/universe Translation-en
    命中 http://security.ubuntu.com precise-security/main Sources
    命中 http://security.ubuntu.com precise-security/restricted Sources
    命中 http://security.ubuntu.com precise-security/universe Sources
    命中 http://security.ubuntu.com precise-security/multiverse Sources
    命中 http://security.ubuntu.com precise-security/main amd64 Packages
    命中 http://security.ubuntu.com precise-security/restricted amd64 Packages
    命中 http://security.ubuntu.com precise-security/universe amd64 Packages
    命中 http://security.ubuntu.com precise-security/multiverse amd64 Packages
    命中 http://security.ubuntu.com precise-security/main i386 Packages
    命中 http://security.ubuntu.com precise-security/restricted i386 Packages
    命中 http://security.ubuntu.com precise-security/universe i386 Packages
    命中 http://security.ubuntu.com precise-security/multiverse i386 Packages
    命中 http://security.ubuntu.com precise-security/main TranslationIndex
    命中 http://security.ubuntu.com precise-security/multiverse TranslationIndex
    命中 http://security.ubuntu.com precise-security/restricted TranslationIndex
    命中 http://security.ubuntu.com precise-security/universe TranslationIndex
    命中 http://security.ubuntu.com precise-security/main Translation-en
    命中 http://security.ubuntu.com precise-security/multiverse Translation-en
    命中 http://security.ubuntu.com precise-security/restricted Translation-en
    命中 http://security.ubuntu.com precise-security/universe Translation-en
    正在读取软件包列表... 完成


    参考:

    http://ubuntuforums.org/showthread.php?t=318539

    http://ubuntuforums.org/archive/index.php/t-202834-p-2.html


    http://raynix.info/archives/1894

  • 相关阅读:
    成熟到优秀的瓶颈问题
    今天我们为什么不成功
    将HTML标签变为小写
    2010世界杯 排阵型 猜比分
    又一款 jQuery 头图切换形式
    整理下工作环境的相应资源
    prototype 的ajax
    即时点选的菜单
    如何禁止一个输入框输入
    基于jQuery的仿FLASH 菜单
  • 原文地址:https://www.cnblogs.com/yuzaipiaofei/p/4124103.html
Copyright © 2020-2023  润新知