如何搭建CSI环境

如果命令git clone git://wl.fi/srv/git/hostap-07.git 显示fatal:unable to look up wi.fi(port9418) (name or service not known)

就可以在window下下载该包http://hostap.epitest.fi/cgit/hostap-07/或者http://hostap.epitest.fi/cgit

第一步:

使用命令sudo visudo

把文本中的%admin ALL=(ALL)ALL改成%admin ALL=NOPASSWD: ALL

第二步:

         使用命令gedit  /etc/modprobe.d/blacklist.conf

         将一下内容添加进入该文件

# blacklistmodules under active development

         blacklistiwlwifi

         blacklistmac80211

         blacklistcfg80211

 

第三步:

sudo apt-get -yinstall git-core kernel-package fakeroot build-essential ncurses-dev

sudo apt-get -yinstall libnl-dev libssl-dev        #Install some necessary libraries

sudo apt-get -yinstall iw

 

第四步:

   下载以下几个包,下载可能比较麻烦,速度比较慢,以及下好了在软件包文件夹下

git clone -bcsitool-stable git://github.com/dhalperi/linux-80211n-csitool.git

git clone git://github.com/dhalperi/linux-80211n-csitool-supplementary.git

下载完后包一般会在/home/linux文件夹中,我的Ubuntu的名字是linux。如果使用已经下载好的包就应该把这些软件包拷贝到该文件夹下

然后运行以下命令

cdlinux-80211n-csitool                      #Go into the kernel src directory

make oldconfig                                     # Use ouroptimized kernel config

make menuconfig                                # Enable yoursystem-specific hardware

make -j3 bzImagemodules               # -j3 here is 3-wayparallelism, try #cores+1

sudo makeinstall modules_install  # INSTALL

sudo mkinitramfs-o /boot/initrd.img-`cat include/config/kernel.release`\

         `catinclude/config/kernel.release`         #create ramdisk used to boot

该命令中的`catinclude/config/kernel.release`是把cat include/config/kernel.release命令直接在terminal运行,将运行得到的结果替换sudomkinitramfs -o /boot/initrd.img-`cat include/config/kernel.release`   `cat include/config/kernel.release` 中的`catinclude/config/kernel.release`即可,接下来的有类似的都用同样的方法解决

sudo update-grub                       # Only needed the firsttime for a new version

makeheaders_install      # creates a copy ofthe linux-headers in ./usr/include/

sudo mkdir/usr/src/linux-headers-`cat include/config/kernel.release`

sudo cp -rfusr/include /usr/src/linux-headers-`cat include/config/kernel.release`/include

然后重启电脑,进入新产生的~+”系统。

 

第五步:

         先进入linux-80211n-csitool-supplementary/firmware/.

然后接着一下步骤

# backuporiginal firmware, good for reference

sudo cp/lib/firmware/iwlwifi-5000-2.ucode /lib/firmware/iwlwifi-5000-2.ucode.orig

sudo mv/lib/firmware/iwlwifi-5000-5.ucode /lib/firmware/iwlwifi-5000-5.ucode.orig

(可能没有,但没事)

# copy ours inseparately, keeping name for reference

sudo cp iwlwifi-5000-2.ucode.sigcomm2010/lib/firmware/

# install ours

sudo cpiwlwifi-5000-2.ucode.sigcomm2010 /lib/firmware/iwlwifi-5000-2.ucode

 

第六步:

         下载host0.7包,如果下载不了的话,软件包文件夹中有

        git clonegit://w1.fi/srv/git/hostap-07.git

         然后

         cdhostap-07/hostapd

cp <hostap-dotconfig> .config                   #Our hostap config from linux-80211n-csitool-supplementary/hostap-config-files/

make

cp<hostapd.conf-test> hostapd.conf               #Install the vanilla hostap conf we provide

 

第七步:

cd ~/linux-80211n-csitool-supplementary/netlink            # We assume you install into yourhome directory

make                                                                #hopefully the make succeeds!

# If not, figureout why it didn't compile. Did you install the Linux headers above?

第八步:

sudo modprobeiwlwifi   # did it work?  Do you see logs about iwlwifi in the dmesg?

sudo iwlistscanning    # did it work?  Did you get access points?

sudo~/hostap-07/hostapd/hostapd ~/hostap-07/hostapd/hostapd.conf

# did it work?if you're in a busy network you should see probe requests going by

# also, go to amachine you control and scan

# go to amachine you control and associate sudo iwconfig wlan0 essid csitool-test

# ... etc

cp<hostapd.conf-real> hostapd.conf

第九步:

sudo rmmodiwlwifi mac80211 cfg80211                           #remove the modules

sudo modprobe iwlwifi connector_log=0x1                       # load the modules and set userspacebeamforming logging

<first,associate and set up IP to an AP that will send you HT packets>

cd~/linux-80211n-csitool-supplementary/netlink

sudo./log_to_file tmp.dat

ping <AP IPaddress>

以后每次收集数据,只要用第九步就行了

注意:(测试时,最好拔掉网线,等wifi连上,两个终端都会显示收到数据的情况)

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值