抓包性能问题

抓包性能问题解决

在linux平台高并发的抓包时,需要安装内核驱动模块pf_ring以提高网络数据包捕获效率。

1、获取mirrors-PF-RING-6.0.3-stable.zip压缩包并解压

2、使用uname -a命令查看内核版本,若为2.6.32,则可以使用以下命令直接安装

[root@localhost ~]# cd PF_RING/kernel
[root@localhost kernel]# sudo insmod pf_ring.ko transparent_mode=1

若内核版本不为2.6.32,则需要重新编译pf_ring并安装。切换至root用户后使用如下命令:

[root@localhost ~]# cd PF_RING/kernel
[root@localhost kernel]# ./configure
[root@localhost kernel]# make
[root@localhost kernel]# insmod pf_ring.ko transparent_mode=1

3、当PF_RING激活时,会创建/proc/net/pf_ring目录,使用cat命令查看pf_ring的属性信 息:

[root@localhost ~]# cat /proc/net/pf_ring/info
PF_RING Version          : 6.0.3 (:)
Total rings              : 1

Standard (non DNA/ZC) Options
Ring slots               : 4096
Slot version             : 16
Capture TX               : Yes [RX+TX]IP Defragment            : No
Socket Mode              : Standard
Total plugins            : 0
Cluster Fragment Queue   : 0
Cluster Fragment Discard : 0

4、为了使每次系统启动时都能正确加载pf_ring,切换至root用户,使用以下命令:

[root@localhost ~]# cd PF_RING/kernel
[root@localhost kernel]# echo "depmod $(pwd)/pf_ring.ko" >> /etc/profile
[root@localhost kernel]# echo "modprobe pf_ring transparent_mode=1" >> /etc/profile
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值