Skip to content

Instantly share code, notes, and snippets.

@nickwallen
Last active May 23, 2017 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickwallen/24616cb3b15adb08ed43c83877a610df to your computer and use it in GitHub Desktop.
Save nickwallen/24616cb3b15adb08ed43c83877a610df to your computer and use it in GitHub Desktop.

Setup Vagrant

vagrant init suse/sles12-sp1
vagrant up --provider virtualbox
vagrant ssh

Install repository

zypper ar -f http://download.opensuse.org/distribution/12.1/repo/oss/ opensuse-oss
zypper ar -f http://download.opensuse.org/distribution/12.1/repo/non-oss/ opensuse-non-oss
zypper refresh
zypper update

Enable THP

echo always > /sys/kernel/mm/transparent_hugepage/enabled
echo 4096 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
mkdir -p /mnt/hugepages
mount -t hugetlbfs nodev /mnt/hugepages

Validate THP

sles11-sp3:~ # grep Huge /proc/meminfo
AnonHugePages:         0 kB
HugePages_Total:     4096
HugePages_Free:      4096
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB

Dependencies

zypper install flex bison libpcap-devel zlib openssl \
   libopenssl-devel python python-devel python-pip \
   swig cmake ncurses-devel python-curses cyrus-sasl \
   cyrus-sasl-devel cyrus-sasl-gssapi kernel-source gcc5 gcc5-c++

Install PF Ring

Add the following to the pfring_mod.c source file.

#define SPEED_UNKNOWN        -1
wget https://github.com/ntop/PF_RING/archive/6.6.0.tar.gz -O - | tar -xz
cd PF_RING-6.6.0

cd kernel
make && make install

cd ../userland/lib
./configure --prefix=/usr/local/pfring
make 
make install

cd ../libpcap
./configure --prefix=/usr/local/pfring
make
make install

cd ../tcpdump-4.1.1
./configure --prefix=/usr/local/pfring
make install

cd ../../kernel
make && make install

Validate PF Ring

modprobe pf_ring
lsmod | grep pf_ring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment