Conceptronic C54BRS4A 2.0/Serial info

General information
Thanks to Teo Ramirez (Spain) teoDELETEramirezMEgmail.com

uname
Linux (none) 2.4.25-LSDK-5.0.0-RC5 #1 mar jul 5 23:14:58 UTC 2011 mips unknown
 * 1) uname -a

cpuinfo
system type            : Atheros AR531X_COBRA processor              : 0 cpu model              : unknown V6.4 BogoMIPS               : 183.50 wait instruction       : no microsecond timers      : yes tlb_entries            : 16 extra interrupt vector : yes hardware watchpoint    : no VCED exceptions         : not available VCEI exceptions        : not available
 * 1) cat /proc/cpuinfo

mtd
dev:   size   erasesize  name mtd0: 00200000 00010000 "spiflash" mtd1: 00137000 00010000 "rootfs" mtd2: 001d0000 00010000 "upgrade" mtd3: 00010000 00010000 "rgdb" mtd4: 00020000 00010000 "RedBoot" mtd5: 00010000 00010000 "Board/RadioCfg" mtd6: 00200000 00010000 "flash"
 * 1) cat /proc/mtd

free
total        used         free       shared      buffers Mem:       14160        13144         1016            0         1032 Swap:           0            0            0 Total:       14160        13144         1016
 * 1) free

meminfo
total:   used:    free:  shared: buffers:  cached: Mem: 14499840 13746176   753664        0  1056768  4452352 Swap:       0        0        0 MemTotal:       14160 kB MemFree:           736 kB MemShared:           0 kB Buffers:          1032 kB Cached:           4348 kB SwapCached:          0 kB Active:           3860 kB Inactive:         3164 kB HighTotal:           0 kB HighFree:            0 kB LowTotal:        14160 kB LowFree:           736 kB SwapTotal:           0 kB SwapFree:            0 kB
 * 1) cat /proc/meminfo

loadavg
1.07 1.10 1.07 2/209 8630
 * 1) cat loadavg
 * 2) 1 min, 5 min, 15 min, running/total last proc.

uptime
21:56:32 up 2:48, load average: 2.97, 2.76, 2.64
 * 1) uptime, while heavy traffic and "devsniffing":

/proc/sys/net/ipv4
tcp_timestamps                    icmp_echo_ignore_broadcasts tcp_window_scaling                icmp_ignore_bogus_error_responses tcp_sack                          route tcp_retrans_collapse              igmp_max_memberships ip_forward                        inet_peer_threshold ip_default_ttl                    inet_peer_minttl ip_autoconfig                     inet_peer_maxttl ip_no_pmtu_disc                   inet_peer_gc_mintime ip_nonlocal_bind                  inet_peer_gc_maxtime tcp_syn_retries                   tcp_orphan_retries tcp_synack_retries                tcp_fack tcp_max_orphans                   tcp_reordering tcp_max_tw_buckets                tcp_ecn ipfrag_high_thresh                tcp_dsack ipfrag_low_thresh                 tcp_mem ip_dynaddr                        tcp_wmem ipfrag_time                       tcp_rmem tcp_keepalive_time                tcp_app_win tcp_keepalive_probes              tcp_adv_win_scale tcp_keepalive_intvl               icmp_ratelimit tcp_retries1                      icmp_ratemask tcp_retries2                      tcp_tw_reuse tcp_fin_timeout                   tcp_frto tcp_tw_recycle                    tcp_low_latency tcp_abort_on_overflow             ipfrag_secret_interval tcp_stdurg                        neigh tcp_rfc1337                       conf tcp_max_syn_backlog               netfilter ip_local_port_range               ip_conntrack_max icmp_echo_ignore_all
 * 1) ls /proc/sys/net/ipv4

ps
PID Uid     VmSize Stat Command 1 0          160 S   init 2 0              SW  [keventd] 3 0              RWN [ksoftirqd_CPU0] 4 0              SW  [kswapd] 5 0              SW  [bdflush] 6 0              SW  [kupdated] 7 0              SW  [mtdblockd] 51 0          648 S   xmldb -n wrgg19_conceptronic_c54brs4a -t 178 0           96 D   ifconfig eth0 hw ether 00:80:5a:5c:XX:XX up  213 0           240 S   fresetd 306 0          280 S   wlxmlpatch 384 0          208 S   portt 602 0          240 S   telnetd -l /usr/sbin/login -u admin:(TELNET_PASS) -i br0 640 0          200 S   -sh 646 0          224 S   /usr/sbin/login admin (TELNET_PASS) 647 0          200 S   sh -c /bin/sh 648 0          260 S   /bin/sh 25616 0          224 S   /usr/sbin/login admin (TELNET_PASS) 25618 0          200 S   sh -c /bin/sh 25619 0          252 S   /bin/sh 17408 0          312 S   udhcpc -i vlan2 -p /var/run/udhcpc-vlan2.pid -s /var/ 18076 0          296 S   udhcpd /var/run/udhcpd-br0.conf 18077 0          252 S   dhcpxmlpatch -f /var/run/udhcpd-br0.lease 18103 0          220 S   sh /var/run/http-loop.sh 18117 0           776 S   httpd -s wrgg19_conceptronic_c54brs4a -f /var/etc/htt 18246 0          328 S   dnrd -s 8.8.4.4 -c off 18284 0          256 S   dyndns -S 2 -u (MY_DYNDNS_NAME) -p (MY_DYNDNS_PASS) -i 29534 0          244 S   syslogd -F sysact -F attack -F notice 29542 0          168 S   klogd -l br0 -w vlan2 31497 0          172 R   ps
 * ps

/var/etc/httpd.cfg
Umask 026
 * 1) cat /var/etc/httpd.cfg

Tuning { NumConnections 15 BufSize 12288 InputBufSize 4096 ScriptBufSize 4096 NumHeaders 100 Timeout 60 ScriptTimeout 60 MaxUploadSize 3735552 }

PIDFile /var/run/httpd.pid LogGMT On

Control { Types { text/html { html htm } text/xml { xml } text/plain { txt } image/gif { gif } image/jpeg { jpg } text/css { css } application/ocstream { * } }       Specials { Dump { /dump } CGI { cgi } Imagemap { map } Redirect { url } Internal { _int } }       External { /sbin/atp { php } /sbin/xgi { xgi bin } /sbin/sgi { sgi } }       IndexNames { index.html } }

Server { Interface br0 Virtual { AnyHost Control { Realm "" UserFile /var/etc/httpasswd Error401File /www/sys/not_auth.php

SessionControl On                       SessionIdleTime 3600 SessionMax 8 SessionFilter { php xgi _int cgi } ErrorFWUploadFile      /www/sys/wrongImg.htm ErrorCfgUploadFile     /www/sys/wrongConf.htm InfoFWRestartFile      /www/sys/restart.htm InfoCfgRestartFile     /www/sys/restart2.htm Alias / Location /www

}               Control { Alias /var Location /var/www }

Control { Alias /HNAP1 Location /www/HNAP1 External { /usr/sbin/hnap { hnap } }                       IndexNames { index.hnap } }       } }

Server { Interface br0 Port 1900 ServerName "Linux, UPnP/1.0, C54BRS4A Ver 2.00" Address 239.255.255.250 # UPnP broadcase UDPServer On       Virtual { AnyHost Control { Alias / Location /www/upnp External { /usr/sbin/upnpdev { * } }               }        } }

Server { Interface br0 Port 49152 ServerName "Linux, UPnP/1.0, C54BRS4A Ver 2.00" Virtual { AnyHost Control { Alias / Location /htdocs/upnp External { /usr/sbin/upnpdev { upnp } }               }        } } Server { Interface vlan2 Port 8000 Virtual { AnyHost Control { Realm "" UserFile /var/etc/httpasswd Error401File /www/sys/not_auth.php

SessionControl On                       SessionIdleTime 3600 SessionMax 8 SessionFilter { php xgi _int cgi } ErrorFWUploadFile      /www/sys/wrongImg.htm ErrorCfgUploadFile     /www/sys/wrongConf.htm InfoFWRestartFile      /www/sys/restart.htm InfoCfgRestartFile     /www/sys/restart2.htm Alias / Location /www

}               Control { Alias /var Location /var/www }       } }

Boot scripts
In /etc/init.d/rcS

/etc/init.d/S03config
/etc/init.d/S03config links to /etc/scripts/config.sh	#!/bin/sh nvram=`cat /etc/config/nvram` image_sign=`cat /etc/config/image_sign` case "$1" in	start)		echo "Mounting proc and var ..."		mount -t proc none /proc		mount -t ramfs ramfs /var		mkdir -p /var/etc /var/log /var/run /var/state /var/tmp /var/etc/ppp /var/etc/config /var/dnrd /var/etc/iproute2		echo -n > /var/etc/resolv.conf		echo -n > /var/TZ		echo "127.0.0.1 hgw" > /var/hosts		echo "*************** |  SYS:001" > /var/log/messages		echo "Inserting modules ..." > /dev/console		insmod /lib/modules/sw_tcpip.o		insmod /lib/modules/ifresetcnt.o		# wireless driver		insmod /lib/modules/wlan.o		insmod /lib/modules/wlan_xauth.o		insmod /lib/modules/wlan_wep.o		insmod /lib/modules/wlan_tkip.o		insmod /lib/modules/wlan_scan_sta.o		insmod /lib/modules/wlan_scan_ap.o		insmod /lib/modules/wlan_ccmp.o		insmod /lib/modules/wlan_acl.o		insmod /lib/modules/ath_hal.o		insmod /lib/modules/ath_rate_atheros.o		# insert module ath_dfs.o for madwifi driver v5.2.0.112		test -f /lib/modules/ath_dfs.o && insmod /lib/modules/ath_dfs.o # get the country code for madwifi, default is fcc. ccode=`rgcfg getenv -n $nvram -e countrycode` [ "$ccode" = "" ] && ccode="840" insmod /lib/modules/ath_ahb.o countrycode=$ccode wlanconfig ath0 create wlandev wifi0 wlanmode ap		env_wlan=`rgcfg getenv -n $nvram -e wlanmac` [ "$env_wlan" = "" ] && env_wlan="00:13:10:d1:00:02" ifconfig ath0 hw ether $env_wlan insmod /lib/modules/ar231x_gpio.o # prepare db... echo "Start xmldb ..." > /dev/console xmldb -n $image_sign -t > /dev/console & sleep 1 /etc/scripts/misc/profile.sh get /etc/templates/timezone.sh set /etc/templates/logs.sh		# bring up network devices env_wan=`rgcfg getenv -n $nvram -e wanmac` [ "$env_wan" = "" ] && env_wan="00:13:10:d1:00:01" ifconfig eth0 hw ether $env_wan up		rgdb -i -s /runtime/wan/inf:1/mac "$env_wan" TIMEOUT=`rgdb -g /nat/general/tcpidletimeout` [ "$TIMEOUT" = "" ] && TIMEOUT=7200 && rgdb -s /nat/general/tcpidletimeout $TIMEOUT echo "$TIMEOUT" > /proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established # Setup VLAN vconfig set_name_type VLAN_PLUS_VID_NO_PAD > /dev/console vconfig add eth0 1	> /dev/null 2>&1 vconfig add eth0 2	> /dev/null 2>&1 brctl addbr br0 	> /dev/console brctl stp br0 off	> /dev/console brctl setfd br0 0	> /dev/console # Start up LAN interface & httpd ifconfig br0 0.0.0.0 up			> /dev/console /etc/templates/webs.sh start	> /dev/console ;;	stop)		umount /tmp		umount /proc		umount /var		;;	esac

/etc/init.d/S10system.sh
/etc/init.d/S10system.sh links to> /etc/scripts/system.sh	#!/bin/sh case "$1" in	start)		echo "start fresetd ..."		> /dev/console		fresetd &		echo "start scheduled ..."		> /dev/console		/etc/templates/scheduled.sh start	> /dev/console		echo "setup layout ..."			> /dev/console		/etc/scripts/layout.sh start	> /dev/console		echo "start LAN ..."			> /dev/console		# SEE BELLOW		/etc/templates/lan.sh start		> /dev/console		echo "enable LAN ports ..."		> /dev/console		# SEE BELLOW		/etc/scripts/enlan.sh			> /dev/console		echo "start WLAN ..."			> /dev/console		/etc/templates/wlan.sh start	> /dev/console		echo "start Guest Zone"			> /dev/console		/etc/templates/gzone.sh start > /dev/console		/etc/templates/enable_gzone.sh start	> /dev/console		echo "start RG ..."				> /dev/console		/etc/templates/rg.sh start		> /dev/console		echo "start DNRD ..."			> /dev/console		/etc/templates/dnrd.sh start	> /dev/console		# start telnet daemon MOVED		#/etc/scripts/misc/telnetd.sh	> /dev/console # Start UPNPD if [ "`rgdb -i -g /runtime/router/enable`" = "1" ]; then echo "start UPNPD ..." > /dev/console /etc/templates/upnpd.sh start	> /dev/console fi echo "start WAN ..." > /dev/console /etc/scripts/misc/setwantype.sh	> /dev/console /etc/templates/wan.sh start		> /dev/console echo "start LLD2D ..." > /dev/console /etc/templates/lld2d.sh start	> /dev/console if [ "`rgdb -i -g /runtime/func/neaps`" = "1" ]; then echo "start Neaps ..." > /dev/console /etc/templates/neaps.sh start	> /dev/console fi if [ "`rgdb -i -g /runtime/func/lpd`" = "1" ]; then echo "start lpd ..." > /dev/console /etc/templates/lpd.sh start		> /dev/console fi echo "start igmpproxy ..." /etc/templates/igmpproxy.sh start > /dev/console if [ -f /etc/templates/smbd.sh ]; then echo "start smbtree search ..." /etc/templates/smbd.sh smbtree_start > /dev/console echo "start smbmount ..." /etc/templates/smbd.sh smbmount_start > /dev/console fi if [ -f /etc/templates/ledctrl.sh ]; then echo "Change the STATUS LED..." /etc/templates/ledctrl.sh STATUS GREEN > /dev/console fi if [ -f /etc/scripts/misc/profile_ca.sh ]; then echo "get certificate file ..." > /dev/console /etc/scripts/misc/profile_ca.sh start	> /dev/console fi if [ -f /etc/templates/wimax.sh ]; then echo "start wimax connection ..." /etc/templates/wimax.sh start > /dev/console fi # ONCE CONFIGURED var/etc/httpasswd BY PROFILE, # START TELNET WITH SAME ADMIN/PASSWORD WITH SAME DATA THAN WEB CONFIG /etc/scripts/misc/telnetd.sh	> /dev/console # START FTP DAEMON #/etc/scripts/misc/ftpd.sh	> /dev/console # AWAITING FOR INCOMING LIVE CONFIG, /etc/scripts/misc/remotecmd.sh	> /dev/console ;;	stop)		if [ -f /etc/templates/wimax.sh ]; then		echo "stop wimax connection ..."		/etc/templates/wimax.sh stop > /dev/console		fi		echo "stop igmpproxy ..."		/etc/templates/igmpproxy.sh stop > /dev/console		if [ "`rgdb -i -g /runtime/func/lpd`" = "1" ]; then		echo "stop lpd ..."				> /dev/console		/etc/templates/lpd.sh stop		> /dev/console		fi		if [ "`rgdb -i -g /runtime/func/neaps`" = "1" ]; then		echo "stop Neaps ..."			> /dev/console		/etc/templates/neaps.sh stop	> /dev/console		fi		echo "stop LLD2D ..."			> /dev/console		/etc/templates/lld2d.sh stop	> /dev/console		echo "stop WAN ..."				> /dev/console		/etc/templates/wan.sh stop		> /dev/console		if [ "`rgdb -i -g /runtime/router/enable`" = "1" ]; then		echo "stop UPNPD ..."			> /dev/console		/etc/templates/upnpd.sh stop	> /dev/console		fi		echo "stop DNRD ..."			> /dev/console		/etc/templates/dnrd.sh stop		> /dev/console		echo "stop RG ..." > /dev/console /etc/templates/rg.sh stop		> /dev/console echo "stop Guest Zone ..." > /dev/console /etc/templates/enable_gzone.sh stop > /dev/console /etc/templates/gzone.sh stop	> /dev/console echo "stop WLAN ..." > /dev/console /etc/templates/wlan.sh stop		> /dev/console echo "stop LAN ..." > /dev/console /etc/templates/lan.sh stop		> /dev/console echo "reset layout ..." > /dev/console /etc/scripts/layout.sh stop		> /dev/console echo "stop scheduled ..." > /dev/console /etc/templates/scheduled.sh stop		> /dev/console echo "stop fresetd ..." > /dev/console # KILL ONLY FTP DAEMON killall stupid-ftpd killall fresetd ;;	restart)		sleep 3		$0 stop		$0 start		;;	*) echo "Usage: system.sh {start|stop|restart}" ;;	esac exit 0

/etc/scripts/layout.sh
/etc/scripts/layout.sh start generates /var/run/layout_start.sh		#!/bin/sh echo [$0] $1 ... > /dev/console echo Start router layout ... echo "WRITE 29 24 1"   > /proc/driver/ae531x echo "WRITE 29 25 1"   > /proc/driver/ae531x echo "WRITE 29 26 1"   > /proc/driver/ae531x # parece q encienden/apagan echo "WRITE 29 27 1"   > /proc/driver/ae531x echo "WRITE 29 28 2"   > /proc/driver/ae531x echo "WRITE 29 30 2"   > /proc/driver/ae531x echo "WRITE 29 23 07c2" > /proc/driver/ae531x echo "WRITE 30 1 2f00" > /proc/driver/ae531x echo "WRITE 30 2 0030" > /proc/driver/ae531x echo "WRITE 30 9 1089" > /proc/driver/ae531x ifconfig vlan1 up		ifconfig vlan2 up		brctl addif br0 ath0 brctl addif br0 vlan1 brctl setbwctrl br0 ath0 900 ifconfig br0 up		rgdb -i -s /runtime/router/enable 1

/etc/templates/lan.sh generates	/var/run/lan_start.sh		#!/bin/sh echo [$0] ... > /dev/console echo "Start LAN (br0/192.168.0.2/255.255.255.0)..." > /dev/console ifconfig br0 192.168.0.2 netmask 255.255.255.0 echo "Start DHCP server (br0) ..." > /dev/console echo -n > /var/run/udhcpd-br0.lease udhcpd /var/run/udhcpd-br0.conf & dhcpxmlpatch -f /var/run/udhcpd-br0.lease & echo $! > /var/run/dhcppatch-br0.pid hostname if [ -f /usr/sbin/igmpproxy ]; then echo "Start igmp ..." > /dev/console /etc/templates/igmpproxy.sh start fi

/etc/scripts/enlan.sh		#!/bin/sh ##define IP_CTRL_SOFTWARE_RESET       0x8000 #define	PHY_SW_RST	0x8000 echo "WRITE 0 0 8000" > /proc/driver/ae531x echo "WRITE 1 0 8000" > /proc/driver/ae531x echo "WRITE 2 0 8000" > /proc/driver/ae531x echo "WRITE 3 0 8000" > /proc/driver/ae531x /etc/templates/wlan.sh echo [$0] $1 ... > /dev/console TEMPLATES="/etc/templates/wifi" case "$1" in start|restart)	[ -f /var/run/wlan_stop.sh ] && sh /var/run/wlan_stop.sh > /dev/console   rgdb -A $TEMPLATES/wlan_run.php -V generate_start=1 > /var/run/wlan_start.sh    rgdb -A $TEMPLATES/wlan_run.php -V generate_start=0 > /var/run/wlan_stop.sh    sh /var/run/wlan_start.sh > /dev/console	;; stop) if [ -f /var/run/wlan_stop.sh ]; then sh /var/run/wlan_stop.sh > /dev/console rm -f /var/run/wlan_stop.sh	fi ;;	echo "$0 [start|stop|restart]" > /dev/console ;; esac /var/run/wlan-start.sh echo [$0] ... > /dev/console echo Start WLAN interface ath0 ... > /dev/console iwpriv ath0 mode 2 iwpriv ath0 pureg 0 #pure g mode iwpriv ath0 wmm 1 iwpriv ath0 doth 0 # 802.11h Support 1=Enable/0=Disable iwconfig ath0 channel 5 iwpriv ath0 bintval 100 iwconfig ath0 rts 2346 iwconfig ath0 frag 2346 iwpriv ath0 dtim_period 1 iwpriv ath0 hide_ssid 0 iwconfig ath0 rate auto iwconfig ath0 txpower 17 echo "To set txrate to (0M). set txpower to (17db)" iwpriv ath0 protmode 0 iwpriv ath0 xr 0 echo 1 > /proc/net/br_forward_br0 iwpriv ath0 ap_bridge 1 # allow connected clients to access each other. iwpriv ath0 maccmd 3 #clear the mac list iwpriv ath0 maccmd 0 echo Start WLAN interface ath0 ... > /dev/console iwpriv ath0 authmode 1 iwconfig ath0 key s:"(MY PASS)" [1] iwconfig ath0 essid "WLAN_22" ifconfig ath0 up sleep 1
 * 1) !/bin/sh
 * 1) cat wlan_start.sh WEP, NO FILTER MAC
 * 2) !/bin/sh

Default config
Mac:

It went unbootable when I set up 7D:4A:07:D3:A0:6C as wifi0 MAC. While in recovery mode, it identified as D-Link_53:11:01 (00:80:c8:53:11:01)

defaultvalue.xml contents:   2 				 0 					 1500 					 1 					 1500 					 2 					 1 					 0 					 0 					 1 					 1492 					 2 					 1 					 0 					 0 					 1 					 1400 					 2 					 1 					 0 					 0 					 1 					 1400 		 192.168.0.1 255.255.255.0 			 1 				 1 					 192.168.0.100 					 192.168.0.199 					 255.255.255.0 					 604800 						 1 		 2 		 1 			 1 			 0 			192.168.0.0 1 			 1 			 1 			 1 			 1 			 1 			 0 			 1 			 0 			 1 			 1 			 0 			 8080 			 0 			 0 			 0 			 0 		 1 		 1 		 0 		1 0 		 28 		 0 			2.conceptronic.pool.ntp.org</ip> 86400 		 c54brs4a 300 		 en 		 826 admin admin 0 		 1 		 C54BRS4A 0 		 6 		 0 		 0 			 64 			 2 			 1 		 0 		 3 		 100 		 2346 		 2346 		 0 		 2 		 0 		 1 		 1 			 0 			<xr>0</xr> 0 			 0 				 1812 		 1 </wrgg19_conceptronic_c54brs4a>

Route/Bridge layout
There are 3 'hidden pages' which are supposed to change this, but I've never tried, though: dev_bridge_dhcp.php dev_bridge_static.php dev_router_lan.php If you are willing to give them a try, please be careful, you could get your device bricked.

Also, the scripts above seem interesting:

/etc/scripts/layout.sh echo [$0] $1 ... > /dev/console case "$1" in start)	[ -f /var/run/layout_stop.sh ] && sh /var/run/layout_stop.sh > /dev/console	rgdb -A /etc/scripts/layout_run.php -V generate_start=1 > /var/run/layout_start.sh	rgdb -A /etc/scripts/layout_run.php -V generate_start=0 > /var/run/layout_stop.sh	sh /var/run/layout_start.sh > /dev/console	;; stop) [ -f /var/run/layout_stop.sh ] && sh /var/run/layout_stop.sh > /dev/console rm -f /var/run/layout_stop.sh	;; echo "Usage: $0 {start|stop}" ;; esac
 * 1) !/bin/sh

/etc/scripts/layout_run.php echo [$0] $1 ... > /dev/console <? /* vi: set sw=4 ts=4: */ require("/etc/templates/troot.php"); /*	echo "config vlan ..." > /dev/console # PHY 29, MII [28-24] - VLAN ID of Port [4-0] echo "WRITE 29 24 3" > /proc/driver/ae531x echo "WRITE 29 25 3" > /proc/driver/ae531x echo "WRITE 29 26 3" > /proc/driver/ae531x echo "WRITE 29 27 3" > /proc/driver/ae531x echo "WRITE 29 28 5" > /proc/driver/ae531x # PHY 29, MII 30 - default VLAN ID of Port 5 (cpu) echo "WRITE 29 30 5" > /proc/driver/ae531x # PHY 29, MII 23[10 to 6] - remove VLAN tags for Port [4-0] # bit  5432 1098 7654 3210 # value 0000 0111 1100 0010 = 07c2 # bit  15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 # value 0  0  0  0  0 1  1 1 1 1 0 0 0 0 1 0 = 07c2 # [1] add tags for Port 5 (cpu) echo "WRITE 29 23 07c2" > /proc/driver/ae531x # PHY 30, MII 2[13:8] - VLAN3 output port mask echo "WRITE 30 2 2f30" > /proc/driver/ae531x # PHY 30, MII 3[13:8] - VLAN5 output port mask echo "WRITE 30 3 303f" > /proc/driver/ae531x # PHY 30, MII 9 # bit  2 1098 7654 3210 # value 1 0000 1000 1001 = 0x1089 # bit  12 11 10 9 8 7 6 5 4 3 2 1 0 # value 1  0  0 0 0 1 0 0 0 1 0 0 1 = 0x1089 # [12 to 8] Set Port [4-0] as WAN port # [7] Enable tag VLAN function # [3] Enable router function # [2 to 0] LAN group number echo "WRITE 30 9 1089" > /proc/driver/ae531x $mii_dev = "/proc/driver/ae531x"; $bridge = query("/bridge"); if ($bridge!=1)	{ $router_on = 1; } else			{ $router_on = 0; }
 * 1) !/bin/sh

if ($router_on==1) {	if ($generate_start==1) {		echo "echo Start router layout ...\n"; if (query("/runtime/router/enable")==1) {			echo "echo Already in router mode!\n"; exit; }		echo "echo \"WRITE 29 24 1\"   > ".$mii_dev."\n"; echo "echo \"WRITE 29 25 1\"   > ".$mii_dev."\n"; echo "echo \"WRITE 29 26 1\"   > ".$mii_dev."\n"; echo "echo \"WRITE 29 27 1\"   > ".$mii_dev."\n"; echo "echo \"WRITE 29 28 2\"   > ".$mii_dev."\n"; echo "echo \"WRITE 29 30 2\"   > ".$mii_dev."\n"; echo "echo \"WRITE 29 23 07c2\" > ".$mii_dev."\n"; #^bit  15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 # value 0  0  0  0  0 1  1 1 1 1 0 0 0 0 1 0 = 07c2 # [10 to 6] - remove VLAN tags for Port [4-0] # [1] add tags for Port 5 (cpu) echo "echo \"WRITE 30 1 2f00\" > ".$mii_dev."\n"; echo "echo \"WRITE 30 2 0030\" > ".$mii_dev."\n"; echo "echo \"WRITE 30 9 1089\" > ".$mii_dev."\n"; echo "ifconfig vlan1 up\n"; echo "ifconfig vlan2 up\n"; echo "brctl addif br0 ath0\n"; echo "brctl addif br0 vlan1\n"; echo "brctl setbwctrl br0 ath0 900\n"; echo "ifconfig br0 up\n"; echo "rgdb -i -s /runtime/router/enable 1\n"; }	else {		echo "brctl delif br0 vlan1\n"; echo "brctl delif br0 ath0\n"; echo "ifconfig vlan1 down\n"; echo "ifconfig vlan2 down\n"; echo "rgdb -i -s /runtime/router/enable \"\"\n"; } } else {	if ($generate_start==1) {		echo "echo Start bridge layout ...\n"; if (query("/runtime/router/enable")==0) {			echo "echo Already in bridge mode!\n"; exit; }		echo "echo \"WRITE 29 24 1\"   > ".$mii_dev."\n"; #NIC is aside the antenna echo "echo \"WRITE 29 25 1\"   > ".$mii_dev."\n"; echo "echo \"WRITE 29 26 1\"   > ".$mii_dev."\n"; echo "echo \"WRITE 29 27 1\"   > ".$mii_dev."\n"; #Nic is aside the WAN port echo "echo \"WRITE 29 28 1\"   > ".$mii_dev."\n"; echo "echo \"WRITE 29 30 1\"   > ".$mii_dev."\n"; echo "echo \"WRITE 29 23 07c0\" > ".$mii_dev."\n"; #^bit  15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 # value 0  0  0  0  0 1  1 1 1 1 0 0 0 0 0 0 = 07c0 # [10 to 6] - remove VLAN tags for Port [4-0] # [1] add tags for Port 5 (cpu) echo "echo \"WRITE 30 9 0000\" > ".$mii_dev."\n"; echo "brctl addif br0 eth0\n"; echo "brctl addif br0 ath0\n"; echo "brctl setbwctrl br0 ath0 900\n"; echo "ifconfig br0 up\n"; echo "rgdb -i -s /runtime/router/enable 0\n"; }	else {		echo "echo Stop bridge layout ...\n"; echo "brctl delif br0 ath0\n"; echo "brctl delif br0 eth0\n"; echo "rgdb -i -s /runtime/router/enable \"\"\n"; } } ?>

Isolate a LAN port
LAN ports used to be assigned to vlan1. Let's change one of them: vconfig add eth0 6 # don't use vlan 3-5 ifconfig vlan6 up echo "WRITE 29 24 6" > /proc/driver/ae531x # Rear port 4 goes to vlan6 brctl addif br0 vlan6 # if you don't add it to the brigde, that IP will have no networking route add -host 192.168.0.102 dev vlan6 now, route should give out sort of this: Kernel IP routing table Destination    Gateway         Genmask         Flags Metric Ref    Use Iface 192.168.0.102  *               255.255.255.255 UH    0      0        0 vlan6 192.168.0.0    *               255.255.255.0   U     0      0        0 br0 77.27.16.0     *               255.255.248.0   U     0      0        0 vlan2 239.0.0.0      *               255.0.0.0       U     0      0        0 br0 default        1.16.27.77.dyna 0.0.0.0         UG    0      0        0 vlan2
 * 1) ^ note that I'm running one more brigde in my computer, between the router and my ISP.

Duplicate traffic
Actually, this will not work unless you patch the kernel with and added feature, although there is an easier working way of "teeing", but only UPD (use google);

Esto no funciona sin parchear el núcleo.

Con esto ya basta ejecutar el siguiente comando en el sistema remoto para para retransmitir con iptables [28] hacia nuestro sistema de monitorización: iptables -t mangle -I FORWARD -j ROUTE -- gw 192.168.100.21 -- tee Sin embargo, si deseamos ver todo el tráﬁco que se intenta enviar un host concreto, en este caso 192.168.100.22, deberíamos hacer la retransmisión antes que en la subtabla FORWARD por si las reglas de ﬁltrado actuasen antes de dicha subtabla eliminando paquetes que el host está enviando: ı   a iptables -t mangle -I PREROUTING -s 192.168.0.102 -j ROUTE -- gw 192.168.0.104 -- tee iptables -t mangle -I POSTROUTING -d 1 92.168.0.102 -j ROUTE -- gw 192.168.0.104 -- tee

Assorted RGDB info

 * 1) rgdb -i -g /runtime/wan/inf:1/gateway < it gives out your ISP gateway

if( get("j",$_PREFIX."/wan/rg/inf:1/mode") == "5" )

$path = $prefix."/wan/rg/inf:1/l2tp/mode"; $l2tpMode = get("j",$path); $path = $prefix."/wan/rg/inf:1/l2tp/ip"; $l2tpIp = get("j",$path); $path = $prefix."/wan/rg/inf:1/l2tp/netmask"; $l2tpMask = get("j",$path); $path = $prefix."/wan/rg/inf:1/l2tp/gateway"; $l2tpGw = get("j",$path); $path = $prefix."/wan/rg/inf:1/l2tp/dns"; $l2tpDns = get("j",$path); $path = $prefix."/wan/rg/inf:1/l2tp/serverip"; $l2tpSrvIp = get("j",$path); $path = $prefix."/wan/rg/inf:1/l2tp/user"; $l2tpUser = get("j",$path); $path = $prefix."/wan/rg/inf:1/l2tp/password"; $l2tpPass = get("j",$path); $l2tpPass = $G_PASSWORD; $path = $prefix."/wan/rg/inf:1/l2tp/autoreconnect"; $l2tpAuto = get("j",$path); $path = $prefix."/wan/rg/inf:1/l2tp/ondemand"; $l2tpDemand = get("j",$path); $path = $prefix."/wan/rg/inf:1/l2tp/idletimeout"; $l2tpIdle = get("j",$path); $path = $prefix."/wan/rg/inf:1/l2tp/mtu";

$path = $prefix."/wan/rg/inf:1/dhcp/clonemac";

$path = $_PREFIX."/lan/ethernet/ip"; $lanIp = get("j", $path ); $path = $_PREFIX."/lan/ethernet/netmask"; $lanMask = get("j", $path ); $path = $_PREFIX."/sys/hostname"; $hostName = get("j", $path ); $path = $PREFIX."/dnsrelay/mode"; $dnsMode = get("j", $path ); $checkIP = get("j", "/lan/ethernet/ip"); $checkMask = get("j", "/lan/ethernet/netmask");


 * 1) rgdb -i -g /lan/ethernet/ip < it gives out the router's IP (LAN gateway)

$wanIp = get("h", "/wan/rg/inf:1/static/ip");

xmldbc -x /runtime/switch/port:1/linktype		"get:psts -i 3" xmldbc -x /runtime/switch/port:2/linktype		"get:psts -i 2" xmldbc -x /runtime/switch/port:3/linktype		"get:psts -i 1" xmldbc -x /runtime/switch/port:4/linktype		"get:psts -i 0" xmldbc -x /runtime/switch/wan_port				"get:psts -i 4"
 * 1) cable status

vlan2 br0 ath0
 * 1) rgdb -i -g /runtime/layout/wanif
 * 1) rgdb -i -g /runtime/layout/lanif
 * 1) rgdb -i -g /runtime/layout/wlanif