Posted: Fri Mar 04, 2011 16:25 Post subject: Need software (tcpdump/Netflow exporter) on DIR-615 D3
Hi,
i need to get tcpdump and softflowd (or another NetFlow exporter) running on my D-Link DIR-615 (HwRev: D3). The current firmware installed is "DD-WRT v24-sp2 (02/17/11) std". It is completely ok for me to just get an executable that i can copy into the /tmp partition. This is just for evaluation purposes.
My problems currently are:
1.) The (only) DD-WRT firmware that runs on this device is the standard (std) one. That means no ipkg or jffs2. That also means my device is not supported by the stable branch, yet.
2.) I do not know how to cross-compile for this architecture. It looks like the mipsel executables (e.g. from WRT54 ipkgs) do not work. Subproblem: I also got stuck trying to setup a toolchain for compiling the complete DD-WRT from scratch.
3.) I failed to use the firmware-mod-kit. It stops with "Error: filesystem not extracted properly. firmware image format not compatible?" and does not produce a rootfs directory in the working dir.
I'd appreciate any pointers to either a pre-compiled program or a guide how to setup a cross-compilation toolchain.
I'd also take a firmware image with tcpdump/softflowd included. Btw. i do not need Wireless support at all!
I just need the WAN and two LAN ports, NAT and ssh.
broadcom binaries should run well on the unit. however, you may need some extra library files. a good start is to extract some pre-compiled files from a mega firmware and try to run them on your unit. "export LD_LIBRARY_PATH=XXXXXXXXXXx"quite useful in this case.
btw: you probably need files from a K26 mega firmware.
Posted: Fri Mar 04, 2011 17:54 Post subject: Great idea, that pu me on the right track.
Hi,
thanks jnjn. That helped and put me on the right track. What i need to to is a crude hack and needs to be exercised with caution, but it works:
1.) get a mega firmware image (i opted for the dd-wrt.v24_mega_generic.bin from Asus WL500G Premium v2)
2.) disassemble it with the firmware-mod-kit
3.) copy the tcpdump binary from working_dir/rootfs/usr/sbin to the DIR-615 (into /tmp). If you execute it now it complains about a missing symbol named 'mmap64'. Most likely not the only one it misses. Therefore next step:
4.) locate the library that provides this symbol. The easiest way was to execute the following in working_dir/rootfs:
Here is a simpler/safer alternative approach to getting around the limitations of a DIR-615, which I developed for my D4 but should work also for a D3 (and can be easily adapted by changing only 2 lines [beneath the comments] for other routers with similar restrictions, or other packages required).
Add the code below to the Startup Script (Administration-Commands):
Code:
cat > /tmp/tcpdump-install.sh << 'EOF'
#!/bin/sh
# Set the correct OpenWRT packages repository for router model and CPU chipset
repository=http://downloads.openwrt.org/attitude_adjustment/12.09/ramips/rt305x/packages
mkdir /tmp/inst
# List package(s) to install from the repository, in sequence (no .ipk extension)
for package in libpcap_1.1.1-2_ramips tcpdump_4.2.1-3_ramips
do
cd /tmp/inst
wget $repository/$package.ipk
tar -zxvf $package.ipk
tar -zxvf control.tar.gz
cd ..
tar -zxvf /tmp/inst/data.tar.gz
done
rm -rf inst
chmod 777 /tmp
EOF
chmod +x /tmp/tcpdump*.sh
This creates an install script on reboot that can then be executed via telnet/ssh with:
Code:
/tmp/tcpdump-install.sh
tcpdump can then be run as follows (supplying additional options as required):