编译PF_RING问题
问题1:./runlex.sh: line 83: flex: command not found;
./runlex.sh: line 118: flex: command not found
回答: sudo yuminstall flex
问题2:make[2]: yacc: Command not found
answer:sudo yum install bison
问题3:cannot find -lnuma
answer:sudo yum install numactl-devel
对于RedHat 6.3版本需要从网上下载:numactl-devel-2.0.7-3.el6.x86_64.rpm
问题4:grammar.c:(.text+0x44e): undefined reference to `pcap_lex'
answer: 删除掉老的libpcap 1.0.0之前的版本。
#rpm -aq | grep libpcap 如果存在则删除它
#yum remove libpcap
问题5:insmod: error inserting 'pf_ring.ko': -1 Unknown symbol in module
解决:没有卸载当前的网卡驱动,导致新的驱动加载不了,因此需要先卸载网卡驱动后再重新进行加载。
问题6: --nodefs: unknown option
解决:rpm --nodeps -e libpcap
配置PF_RING
1.加载ixgbe驱动,我们发现设置InterruptThrottleRate为4000是最优的。
modprobe ixgbe InterruptThrottleRate=4000
2.加载PF_RING驱动,使用透传模式2,并且设置合理的缓冲区大小。
modprobe pf_ring.ko transparent_mode=2min_num_slots=16384
3.优化以太网设备,关闭影响吞吐量的选项。使用合适的接口替代eth3。
ethtool -C eth3 rx-usecs 1000
ethtool -C eth3 adaptive-rx off
ethtool -K eth3 tso off
ethtool -K eth3 gro off
ethtool -K eth3 lro off
ethtool -K eth3 gso off
ethtool -K eth3 rx off
ethtool -K eth3 tx off
ethtool -K eth3 sg off
4.设置CPU的亲和力
为了让Snort达到5Gbps吞吐量,我们需要更好的硬件(24核CPU Intel X567),使用PF_RING NAPI或DNA进行加速,选择使用Silicom网卡。
禁用TX捕获:insmodpf_ring.ko enable_tx_capture=0
增加ring slots数量,使用透传模式1:insmod pf_ring.ko enable_tx_capture=0transparent_mode=1 min_num_slots=16384
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-11/109580.htm
