Config OpenWrt on WNDR3700v4

Http proxy for opkg:
Add following line in OPKG-Configuration via LuCI Web
option http_proxy http://172.24.61.252:8080/

Enable USB Storage
Install kmod-usb-storage
Install kmod-fs-ext4
Install kmod-fs-msdos
Install kmod-nls-utf8
Install block-mount

Install openwrt onto WNDR3700v4 from factory image

Download openwrt image
openwrt-ar71xx-nand-wndr3700v4-ubi-factory
https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/nand/

Install with update feature from web interface

 

Issue of of 2014.10.2 version

Unable to use the 128MB flash space.

 

Status of 2014.10.2 version

System
Hostname OpenWrt
Model NETGEAR WNDR3700v4
Firmware Version OpenWrt Barrier Breaker 14.07 / LuCI Trunk (0.12+svn-r10530)
Kernel Version 3.10.49

uninstal DD-WRT from WNDR3700 v4

Download factory image WNDR3700v4-V1.0.1.32 from netgear web site
Flash back via TFTP method

http://forum1.netgear.com/showthread.php?t=53239

– plug the PC into LAN port 1
– set the pc to a static IP of 192.168.1.2
– power on the router
– press and hold the RESET button as soon as the switch LEDs light up.
– keep holding RESET until the power LED begins to flash orange and then green.
– only the power LED is flashing green (and of course port 1), release RESET and than
-tftp -i -v 192.168.1.1 PUT <filename>

Install dd-wrt onto wndr3700 v4

Hardware:                       2.4G/5G Wifi,  USB,  128MB RAM/128B NAND

Version Installed:             DD-WRT v24-sp2 (01/04/15) std – build 25760

Feature Integrated:

FreeRadius,                   PPPoE Server / Relay
PPTP Server / Client,     OpenVPN Server / Client
USB:                               Printer,  Storage,     USB Over IP
FTP Server,                    DLNA Server,          Samba Server
SIP Proxy,                       Http Server (Lighttpd)
Mikrotik MAC Telnet,      IP over DNS Tunneling (nstx)
SNMP,                            VNC Repeat,          Zabbix client

 

Add 32G USB key with following partition setting:

Part1 LABEL=”EXEC”   SIZE=2G   TYPE=”ext4″ With Journal

Part2  LABEL=”DATA”   SIZE=30G  TYPE=”ext4″ Without Journal

 

SSH into the route and execute:

umount /dev/sda1
umount /dev/sda2
mkdir /mnt/exec
mkdir /mnt/data
mount /dev/sda1 /mnt/exec
mount /dev/sda2 /mnt/data
cp -r -p  /opt /mnt/exec/
cp -r -p  /etc /mnt/exec/
cp -r -p /www /mnt/exec/
cp -r -p /jffs /mnt/exec/

Startup Script:
umount /dev/sda1
umount /dev/sda2
cp -r -p /tmp /tmp/mnt
mkdir /mnt/exec
mkdir /mnt/data
mount /dev/sda1 /mnt/exec
mount /dev/sda2 /mnt/data
mount –bind /mnt/exec/www /www
mount –bind /mnt/exec/opt /opt
mount –bind /mnt/exec/etc /etc
mount –bind /mnt/exec/jffs /jffs
mv /tmp/mnt/tmp /mnt/exec/
mount –bind /mnt/exec/tmp /tmp

usbip

http://sourceforge.net/projects/usbip/

http://usbip.sourceforge.net/

https://www.usenix.org/legacy/events/usenix05/tech/freenix/hirofuchi/hirofuchi.pdf

http://wiki.openwrt.org/doc/howto/usb.iptunnel

https://github.com/spurious/usbip-windows-mirror/blob/master/driver/README

 http://www.xrdp.org/index.php?option=com_content&view=article&id=15:usb-redirection&catid=2:documents&Itemid=7

 https://www.kernel.org/doc/readme/tools-usb-usbip-README

 

 

Open Source OS

https://reactos.org/

 

Not open source

https://www.virtualhere.com/

http://www.virtual-serial-port.org/products/usb-over-network/

http://www.usb-over-network.com/usb-over-network.html

Block IP Addr

How To List Your Existing IP Address Rules

iptables -L

How To Help

iptables -h

How do I block an IP address ?

iptables -A INPUT -s xx.xx.xx.xx -j DROP

How To Block A Range of IP Addresses ?

iptables -A INPUT -s xx.xx.xx.xx/8 -j DROP

How can I block a particular PORT for a particular IP ?

iptables -A INPUT -s IP-ADD -p tcp --destination-port portnumber -j DROP
iptables -A INPUT -s xx.xx.xx.xx -p tcp --destination-port 25 -j DROP

 How to start/stop iptables

         /etc/init.d/iptables stop/etc/init.d/iptables start

How do I unblock an IP address ?
iptables -D INPUT -s IP-ADDR -j DROP

 How do I save iptables ?

       /etc/rc.d/init.d/iptables save
       service iptables save
*****************************************************
Script for Debian 6
  /etc/init.d/save_iptables
  /etc/init.d/load_iptables
  /usr/sbin/blockip
  /etc/network/if-pre-up.d/load_iptables  -> /etc/init.d/load_iptables
  How to Block IP:
  blockip  103.41.124.64
  cat /usr/sbin/blockip
       #!/bin/sh
       if  [  $# -eq 0 ];then
          echo “Usage:  $0 ip_addr”
          exit
       fi
       echo “ip address $1 will be blocked”
       iptables -A INPUT -s $1 -j DROP
       /etc/init.d/save_iptables
      clear
      iptables -L
   cat /etc/init.d/save_iptables
   #!/bin/sh
   /sbin/iptables-save > /etc/iptables
  cat /etc/init.d/load_iptables
  #!/bin/sh
  /sbin/iptables-restore < /etc/iptables

WNDR3700V4

WNDR3700 v4:
Atheros AR9344 560MHz + AR9582 [an 2×2:2] + AR9344 [bgn 2×2:2]
128MiB RAM + 128MiB NAND
1 WAN + 4 LAN (GBit) + 1 USB 2.0

WNDR4300 v1
3×3 5GHz (AR9580 instead of AR9582)

TP-LINK TL-WDR4300 v1.0-v1.7
Similar as WNDR4300
8 MiB NAND
2 USB

DDWRT:
http://www.dd-wrt.com/wiki/index.php?title=TP-Link_TL-WDR4300&redirect=no

OpenWRT:
http://wiki.openwrt.org/toh/netgear/wndr3700

Netgear GPL:
http://kb.netgear.com/app/answers/detail/a_id/2649/related/1

wiki
https://wikidevi.com/wiki/Netgear_WNDR3700v4

Reset to OEM image:
Enter into TFTP mode
tftp -i 192.168.1.1 put WNDR3700-V1.0.4.68NA.img
http://www.dd-wrt.com/phpBB2/viewtopic.php?t=79802

Install windows7 onto iscsi target: Server Setup

A PC (IP=192.168.127.88) with ubuntu/debian installed is used as:

TFTP server

        HTTP Server

        CIFS Server

        ISCSI Server (Target)

 

TFTP server

#  Setup tftp server

apt-get install tftpd-hpa

/etc/init.d/tftpd-hpa start

 

#  Testing tftp server

apt-get install tftp

uname -a >/srv/tftp/test

tftp 127.0.0.1

>get test

>quit

diff test /srv/tftp/test

 

# Install syslinux 4.x  (SYSLINUX 4.0.1 debian-20100714)

apt-get install syslinux

cp /usr/lib/syslinux/pxelinux.0 /srv/tftp/

# copy other interested support files
cp /usr/lib/syslinux/menu.c32 /srv/tftp
cp /usr/lib/syslinux/memdisk /srv/tftp
cp /usr/lib/syslinux/mboot.c32 /srv/tftp
cp /usr/lib/syslinux/chain.c32 /srv/tftp
mkdir -pv /srv/tftp/pxelinux.cfg

To simplify the script across ubuntu and debian,  create the /tftp linkto the actual tftp root directory (/srv/tftp in case)

 

 

Install windows7 onto iscsi target: Route

A tp-link TL-841N route with ddwrt firmware (build 24160) is used in the test:

Route Config:

Route IP = 192.168.127.2

DNSMasq  = Enable

Local DNS = Enable

No DNS Rebind = Enable

Additional DNSMasq Options

dhcp-boot=pxe/pxelinux.0,lzheng-ubuntu-10,192.168.127.88
dhcp-option=44,172.24.63.201,172.24.63.202         dhcp-option=6,172.24.63.212,172.24.63.211,172.24.63.163,172.24.63.161,172.24.63.162

 

************************************************************************

Note

      dhcp-boot,               specified pxe boot file and the tftp server

dhcp-option=44,       specified wins server

dhcp-option=6,       specified upstream DNS server