转载:Installing PF RING and nProbe on Fedora Core 4 (FC4)-阿里云开发者社区

开发者社区> 最美的回忆> 正文

转载:Installing PF RING and nProbe on Fedora Core 4 (FC4)

简介:
+关注继续查看
原文: 

Installing PF RING and nProbe on Fedora Core 4 (FC4)

## Install FC4. 
## Install FC4 updates. 

## Download Source for FC kernel 
Download source RPM for kernel running on system ("unname -r" will give 
you current version) 
(rpm contains vanilla kernel and FC patches). 

* Instructions below are taken the from Fedora Core Release Notes about 
kernel compiling 
Check there for definitive information (NMJ). 

- Install src with command "rpm -Uvh kernel-<version>.src.rpm" where version 
is the 
version from "uname -r" 

- Add Fedora patches to vanilla kernel 
cd /usr/src/redhat/SPECS 
rpmbuild -bp --target $(arch) kernel-2.6.spec 

- Move kernel to /usr/src 
mv /usr/src/redhat/BUILD/kernel-<version>/kernel-<version> /usr/src (Note: 
the two kernel-<version>s 

cd /usr/src 
ln -s ./linux-<version> linux 
cd /usr/src/linux 

## Installing PF_RING patches into kernel source 
Download PF_RING
CVSROOT=:pserver:anonymous[at]cvs.ntop.org:/export/home/ntop;export CVSROOT 
mkdir <directory to store PF_RING files> 
cd <directory to store PF_RING files> 
cvs login (password is "ntop") 
cvs checkout PF_RING 
cd PF_RING 

- Edit mkpatch.sh so Kernel version variables equal FC4 kernel version 
created above. 
i.e. if "uname -r" returns "2.6.14-1.1656_FC4", then: 
VERSION=2 
PATCHLEVEL=6 
SUBLEVEL=14 
EXTRAVERSION="-1.1656_FC4-PF_RING
- Run "mkpatch.sh" 
- Copy the compressed patch file created by mkpatch.sh in the directory 
"workspace" 
(i.e. linux-2.6.14-1.1656_FC4-PF_RING) to /usr/src 
- Run "zcat <patch file> | patch --dry-run -p0" to test for errors 
- Run "zcat <patch file> | patch -p0" to apply patches 

## Build Kernel 
* With exception of enabling PF_RING, Instructions below are taken the 
from Fedora 
Core Release Notes about kernel compiling. Check there for definitive 
information. 

cd /usr/src/linux 
Edit Makefile to set VERSION, PATCHLEVEL, and EXTRAVERSION 
Run "make menuconfig" 
Enable PF_RING under "Networking->Networking options". 
Enable 64 GB memory support under "Processor type and features->High 
Memory Support" 

make 
make modules_install 
make install (to install kernel in /boot and make compressed ram image 
(unique to FC)) 

Edit /boot/grub/grub.conf, set default time out to 10 seconds and change 
the default boot to the new kernel. 

Reboot and test that system boots new kernel successfully. You can always 
reboot and select the old 
kernel from the grub loader menu if the new kernel doesn't work. 

## Build PF_RING enabled libpcap 
- Copy /usr/src/linux/include/linux/ring.h to /usr/include/linux 
(For some reason this doesn't get done when compiling the kernel). 

- Compile libpfring (This is one of those new steps that was not 
documented). 
cd PF_RING/userland/libpfring 
make 
cp libpfring.a /usr/local/lib 
cp pfring.h /usr/local/include 

- Get version of libpcap specified version of PF_RING 
(Do an directory listing of PF_RING/userland to find version of libpcap 
to get 
It's currently 0.9.4, get it at http://www.tcpdump.org ). 
Untar libpcap source in PF_RING/userland 

- Copy pcap-int.h and pcap-linux.c from 
PF_RING/userland/libpcap<VERSION>-ring to directory 
PF_RING/userland/libpcap<VERSION>. 

- Use the following configure command to make sure libpcap can find the 
ring libraries 
./configure CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" 

- Build libpcap 
make 
make install 
(default install is into /usr/local/include and /usr/local/lib) 

- cd back to PF_RING/userland/pcount. Make and run pcount to test to test 
if libpcap is working. 
You won't see any output until you stop the program with <CTRL-C>. 
[root[at]nmj-test libpfring]# ./pcount 
Capturing from eth0 
(Wait a bit, and hit <CTRL-C>. You should see the following): 
========================= 
Absolute Stats: [19 pkts rcvd][0 pkts dropped] 
Total Pkts=19/Dropped=0.0 % 
19 pkts [7.8 pkt/sec] - 5159 bytes [0.02 Mbit/sec] 
========================= 
Actual Stats: 19 pkts [-1402903.2 ms][-0.0 pkt/sec] 
========================= 
[root[at]nmj-test pcount]# 

## Compile nProbe to use libpcap. 
- Untar nProbe 
- Run "autogen.sh" (generates configure stuff, don't know why) 
- ./configure CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib 
-lpfring" 
(again adding -lpfring is NOT documented). 

## Test running nprobe 
Watch the syslog file by running "tail -f /var/log/messages" 
Run nprobe 
Look for the following messages in to appear in /var/log/messages: 
Jan 27 14:15:47 nmj-test kernel: RING: successfully allocated 1024 KB 
[tot_mem=598076][order=8] 
Jan 27 14:15:47 nmj-test kernel: RING: allocated 7181 slots 
[slot_len=146][tot_mem=1048576] 
Jan 27 14:15:47 nmj-test kernel: device eth0 entered promiscuous mode 

## Other things you may want to consider to maximize performance. 
- Disable X (you can always start it by running the "startx" command). 
Edit /etc/inittab and comment out inittab entry that starts. 
- Disable graphical boot status 
Edit /boot/grub/grub.conf and remove "rhgb" option from grub.conf 
entries 
- Shutdown all unnecessary services 
- Review Firewall settings 

## Check the archives for ntop-misc mailing list, there is an e-mail about 
on how to 
make libpcap a shared library so it can be used with other applications 
that use libpcap 

(ethereal, snort). 

本文转自xiaotie博客园博客,原文链接http://www.cnblogs.com/xiaotie/archive/2006/04/20/379700.html如需转载请自行联系原作者


xiaotie 集异璧实验室(GEBLAB)

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
阿里云服务器怎么设置密码?怎么停机?怎么重启服务器?
如果在创建实例时没有设置密码,或者密码丢失,您可以在控制台上重新设置实例的登录密码。本文仅描述如何在 ECS 管理控制台上修改实例登录密码。
4068 0
阿里云服务器端口号设置
阿里云服务器初级使用者可能面临的问题之一. 使用tomcat或者其他服务器软件设置端口号后,比如 一些不是默认的, mysql的 3306, mssql的1433,有时候打不开网页, 原因是没有在ecs安全组去设置这个端口号. 解决: 点击ecs下网络和安全下的安全组 在弹出的安全组中,如果没有就新建安全组,然后点击配置规则 最后如上图点击添加...或快速创建.   have fun!  将编程看作是一门艺术,而不单单是个技术。
4485 0
使用OpenApi弹性释放和设置云服务器ECS释放
云服务器ECS的一个重要特性就是按需创建资源。您可以在业务高峰期按需弹性的自定义规则进行资源创建,在完成业务计算的时候释放资源。本篇将提供几个Tips帮助您更加容易和自动化的完成云服务器的释放和弹性设置。
7758 0
windows server 2008阿里云ECS服务器安全设置
最近我们Sinesafe安全公司在为客户使用阿里云ecs服务器做安全的过程中,发现服务器基础安全性都没有做。为了为站长们提供更加有效的安全基础解决方案,我们Sinesafe将对阿里云服务器win2008 系统进行基础安全部署实战过程! 比较重要的几部分 1.
5458 0
阿里云服务器安全组设置内网互通的方法
虽然0.0.0.0/0使用非常方便,但是发现很多同学使用它来做内网互通,这是有安全风险的,实例有可能会在经典网络被内网IP访问到。下面介绍一下四种安全的内网互联设置方法。 购买前请先:领取阿里云幸运券,有很多优惠,可到下文中领取。
9426 0
阿里云服务器如何登录?阿里云服务器的三种登录方法
购买阿里云ECS云服务器后如何登录?场景不同,阿里云优惠总结大概有三种登录方式: 登录到ECS云服务器控制台 在ECS云服务器控制台用户可以更改密码、更换系.
5730 0
腾讯云服务器 设置ngxin + fastdfs +tomcat 开机自启动
在tomcat中新建一个可以启动的 .sh 脚本文件 /usr/local/tomcat7/bin/ export JAVA_HOME=/usr/local/java/jdk7 export PATH=$JAVA_HOME/bin/:$PATH export CLASSPATH=.
2141 0
阿里云服务器ECS登录用户名是什么?系统不同默认账号也不同
阿里云服务器Windows系统默认用户名administrator,Linux镜像服务器用户名root
1131 0
2245
文章
0
问答
文章排行榜
最热
最新
相关电子书
更多
文娱运维技术
立即下载
《SaaS模式云原生数据仓库应用场景实践》
立即下载
《看见新力量:二》电子书
立即下载