CentOS系统中安装PF_Ring的步骤和出现的问题

 (一)Centos中安装PF_Ring的步骤
1.下载和安装svn
    sudo yum install subversion
2.下载PF_Ring代码
    svn co https://svn.ntop.org/svn/ntop/trunk/PF_RING/
3.进入PF_RING(源码根目录)
   make
4. 更加不同的提示,下载相应的软件包
   如编译问题
5. cd PF_RING/kernel          make
6. insmod PF_RING/kernel/pf_ring.ko transparent_mode=1,使PF_Ring生效(每次开机,都必须运行此句,才能够生效)
7.  cd PF_RING/userland/examples
8. sudo ./alldevs
   1. eth0 (PF_RING)
   2. usbmon1 (USB bus number 1)
   3. usbmon2 (USB bus number 2)
   4. any (Pseudo-device that captures on all interfaces)
   5. lo (No description available)
  9. sudo ./pfwrite -i eth0 -w data.txt

  10. cat data.txt将显示保存的内容


(二)编译可能出现的问题问题
 1. ./runlex.sh: line 83: flex: command not found;
     ./runlex.sh: line 118: flex: command not found
     answer: sudo yum install flex
 2. make[2]: yacc: Command not found          

 answer:sudo yum install bison
 3. cannot find -lnuma
    answer:sudo yum install numactl-devel
 4. grammar.c:(.text+0x44e): undefined reference to `pcap_lex'
   answer:
   (1) cd /userland/lib./
   configure
   make sudo make install
   cd ../libpcap./
   configure
    make
(2) sudo yum remove libpcap
(3) make clean

(三)运行问题
  1. eth0 (No description available)
2. usbmon1 (USB bus number 1)
3. usbmon2 (USB bus number 2)
4. any (Pseudo-device that captures on all interfaces)
因为没有注册,需要在终端命令行运行:sudo insmod pf_ring.ko

(四)调试问题

   1.No symbol table is loaded. Use the "file" command.  或者 eclipse debug No source available for main()

answer:将CFLAGS     =  ${O_FLAG} -Wall ${INCLUDE} ${DNA_DEFINE} -D HAVE_ZERO -D ENABLE_BPF -D HAVE_LIBNUMA -O2  #-g

改为CFLAGS     =  ${O_FLAG} -Wall ${INCLUDE} ${DNA_DEFINE} -D HAVE_ZERO -D ENABLE_BPF -D HAVE_LIBNUMA -O2 -g

   2.gdb --version error

answer:没有安装gdb,使用yum install gdb安装

  3.调试的时候总会停留在main函数入口处

answer:将stop on startup at处的勾去掉

      CentOS系统中安装PF_Ring的步骤和出现的问题_第1张图片

你可能感兴趣的:(PF_Ring学习笔记)