Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
265 lines (165 sloc) 6.3 KB


Here are the installations steps for Gentoo Linux.

Install the following utilities and libs:

	emerge git
	emerge rpm
	emerge subversion
	emerge libpcap
	emerge sys-process/numactl

Install Proplib

Download proplib-0.6.3.tar.xz

	tar xvf ./proplib-0.6.3.tar.xz
	cd ./proplib-0.6.3
	make install

Install libcdb

  • Download libcdb.tar.gz or

     git clone
  • Download the patch libcdb_alexk.patch

  • Execute the following commands:

     cd ./libcdb
     cat libcdb_alexk.patch | patch -p1
     export LIBDIR=lib
     export INCDIR=include
     export DESTDIR=/usr/local
     make all
     make install

Install qsbr

  • Download libqsbr.tar.gz

  • Download the patch libqsbr_alexk.patch

  • Execute the following commands:

     tar xzvf libqsbr.tar.gz
     cd ./libqsbr/src
     cat libqsbr_alexk.patch | patch -p1
     export LIBDIR=lib
     export INCDIR=include/qsbr
     export DESTDIR=/usr/local
     make all
     make install

Install bpfjit

  • Download bpfjit.tar.gz

  • Download sljit-0.92.tgz

  • Execute the following commands:

     tar xzvf ./bpfjit.tar.gz
     tar xzvf ./sljit-0.92.tgz
     cd ./bpfjit/sljit/
     cp -rpn ../../sljit-0.92/* ./
     cd ..
  • Edit ./SPECS/libbpfjit.spec and delete or comment the following lines:

  • Run

     make rpm
     rpm --nodeps -ihv RPMS/x86_64/libbpfjit-0.1-1.x86_64.rpm

Install NPF

  • Clone NPF (

     git clone -b alexk
  • Download city.h, then

     cp city.h /usr/local/include/
  • Install jemalloc

     emerge jemalloc
  • Run the following commands:

     cd npf/src
     export LIBDIR=/usr/lib64
     export INCDIR=/usr/local/include
     export MANDIR=/usr/local
     make install

Install DPDK

Configure linux kernel

  • Make sure the following options are enabled:

      UIO support
         Device Drivers -> Userspace I/O drivers -> Generic driver for PCI 2.3 and PCI Express cards
            symbol UIO_PCI_GENERIC
         File systems -> Pseudo filesystems -> /proc file system support      
        File systems -> Pseudo filesystems
      HPET and HPET_MMAP
         Device Drivers -> Character devices -> HPET - High Precision Event Timer
  • Turn on linux boot time options:

    • If you use grub edit /boot/grub/grub.conf and appent the following options:

        intel_idle.max_cstate=1 isolcpus=1,2,3 default_hugepagesz=2M hugepagesz=2M hugepages=3072
    • Note: You might want to isolate a different set of cores or reserve different amount of ram for huge pages depending of the hardware configuration of your server. The rule here is that you should isolate all cores you're going to use in the router's traffic forwarding process unless the perfomance is not a goal.

  • Configure hugepages

    • reboot you machine and check that hugepages are available and free

        grep -i huge /proc/meminfo
    • you should get something like this:

        HugePages_Total:    3072
        HugePages_Free:     3072
        HugePages_Rsvd:        0
        HugePages_Surp:        0
        Hugepagesize:       2048 kB
    • Make a mount point for hugepages

        mkdir /mnt/huge
    • Create a mount point entry in the /etc/fstab

        huge         /mnt/huge   hugetlbfs pagesize=2M   0       0
    • Mount hugepages

        mount huge
  • download dpdk 17.11.1 (LTS)

      tar xvf dpdk-17.11.1.tar.xz
      cd ./dpdk-stable-17.11.1

Patch DPDK

Download the patches:

Apply the patches:

	cat ./eal_log.patch | patch -p1
	cat ./bond_fix_mtu.patch | patch -p1
	cat ./bond_lacp_fix_mempool_size.patch | patch -p1
	cat ./ip_fragmentation_table.patch | patch -p1
	cat ./bond_add_remove_mac_addr.patch | patch -p1

Run the following commands:

	make install T=x86_64-native-linuxapp-gcc

Install TheRouter

Install dependencies

  • Quagga

     emerge -v quagga
  • Download quagga sources quagga-1.0.20160315.tar.xz

     tar xvf ./quagga-1.0.20160315.tar.xz
  • PCRE2

     emerge libpcre2
  • libcuckoo

     git clone
     cd libcuckoo
     autoreconf -fis
     make install

Download TheRouter


Install TheRouter

  • Run the following commands:

     tar xvf ./
     cd ./

Configure dpdk ports

  • Define $RTE_SDK variable

      export RTE_SDK=/path_to_dpdk
  • Load drivers

      modprobe uio
      insmod $RTE_SDK/x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
      # loading kni module 
      insmod $RTE_SDK/x86_64-native-linuxapp-gcc/kmod/rte_kni.ko
  • Bind your NIC's to DPDK by using $RTE_SDK/usertools/

      $RTE_SDK/usertools/ --bind=igb_uio 0000:02:00.0
      $RTE_SDK/usertools/ --bind=igb_uio 0000:02:00.1

Run TheRouter

  • Prepare configuration files. For configuration examples and options see the page Configure TheRouter

    • create router.conf

        nano /etc/router.conf
    • create npf conf

        nano /etc/npf.conf
  • run the router

     /usr/local/sbin/ /etc/router.conf