关于Leic

Software Architect Embbed Software

iptables

Iptables 指南 1.1.19
http://man.lupaworld.com/content/network/iptables-tutorial-cn-1.1.19.html

Linux数据包路由原理、Iptables/netfilter入门学习
http://itindex.net/detail/49448-linux-%E6%95%B0%E6%8D%AE%E5%8C%85-%E8%B7%AF%E7%94%B1

Iptables入门教程
http://drops.wooyun.org/tips/1424

linux防火墙iptables常用规则
http://www.xker.com/page/e2012/0926/120758.html

NAT – Network Address Translation
http://www.karlrupp.net/en/computer/nat_tutorial

Quick HOWTO : Ch14 : Linux Firewalls Using iptables

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables#.VMnDgyz2CXQ

Build openjdk 7 on ubuntu 10.10

sudo apt-get install git mercurial zip bzip2 unzip tar gawk
sudo apt-get install ccache make gcc g++ ca-certificates ca-certificates-java
sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev
sudo apt-get install libasound2-dev libcups2-dev libfreetype6-dev
sudo apt-get install build-essential ruby-dev pkg-config
sudo apt-get install openjdk-6-jdk
sudo apt-get install fpm

mkdir /build/openjdk
cd /build/openjdk
git clone https://github.com/hgomez/obuildfactory.git

XBUILD=true ./obuildfactory/openjdk7/linux/standalone-job.sh

# List output file
ls OBF_DROP_DIR/openjdk7/
j2re-image-x86_64-u80-b05-20150127.tar.bz2
j2sdk-image-x86_64-u80-b05-20150127.tar.bz2

 

# Install to /opt/openjdk7
sudo mkdir /opt/openjdk7
cd /opt/openjdk7
sudo tar xvfj /build/openjdk/OBF_DROP_DIR/openjdk7/j2sdk-image-x86_64-u80-b05-20150127.tar.bz2

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