OpenWrt APU4 - jhu-information-security-institute/NwSec GitHub Wiki

Prerequisites

  • mSATA hard-disk (installed in mini-PCIE slot)
  • Wifi adapter (installed in mini-PCIE slot)
  • USB to serial adapter (this device is headless)
  • x2 Kingston DataTraveler 100G3 USB3.0 16GB thumb drives (note: this device has compatibility issues with USB thumb drives and this one is confirmed to work)
  • Wired ethernet connected to internet
  • Wired ethernet connected to development machine

Initial install sequence (is a super PITA)

  • It is necessary to initially use the serial console terminal interface
  • Boot the APU4 with live Debian image (see here) on USB thumb drive
  • Install Debian on the APU4 mSATA
  • Boot Debian on the APU4 mSATA
  • Build OpenWrt as described below, or install the latest generic-ext4-combined.img.gz for PC BIOS systems here
  • Copy the generated openwrt-x86-64-combined-ext4.img.gz into OpenWrt using a USB thumb drive
  • Extract the image and dd it to the mSATA device
  • Power down the APU4 and boot it using a Debian live USB thumb drive
  • Use parted to resize the root file system to the available remaining size of the mSATA drive
  • Reboot the APU4

Upgrade install sequence

  • Log in to the LuCI web interface
  • There is a firmware upgrade section under Administration that allows for uploading+programming of updated images

Build OpenWrt

  • See the Dockerfile in the repo

Setup OpenWrt

  1. /etc/config has many configuration files

Setup Softflowd

  1. Install softflowd using $ opkg install softflowd
  2. Edit /etc/config/softflowd:
    
     config softflowd
     option enabled        '1'
     option interface      'tap0'
     option pcap_file      ''
     option timeout        'maxlife=60'
     option max_flows      '8192'
     option host_port      '172.16.0.20:2055'
     option pid_file       '/var/run/softflowd.pid'
     option control_socket '/var/run/softflowd.ctl'
     option export_version '5'
     option hoplimit       ''
     option tracking_level 'full'
     option track_ipv6     '0'
     option sampling_rate  '5'
     
  3. Start the service: $ /etc/init.d/softflowd start
  4. Check whether it is running by looking for softflowd in results from ps
⚠️ **GitHub.com Fallback** ⚠️