Publicado en English

How to keep P2P users out of your network with openwrt

Say that you have a open wireless network connection and you have some users that use P2P programs to download stuff. The main problem with P2P programs is the number o connections that try to open on the ADSL router so the NAT table gets full pretty quickly.

# Ban. Add mac to the forward table if the number of connecions get 100

for ip in $(grep "br-lan" /proc/net/arp | awk '{print $1}'); do

cont=$(grep -c "$ip" /proc/net/ip_conntrack);
mac=$(grep "$ip" /proc/net/arp| awk '{print $4}');

if [ "$cont" -gt "100" ] ;then
echo iptables -A forwarding_rule -m mac --mac-source $mac -j DROP;
logger "$ip $mac $cont";

so create a entry on /etc/crontabs/root

# run this script every hour
0,10,20,30,40,50 * * * * /etc/ban > /dev/null
0 * * * * /etc/unban > /dev/null

Publicado en English

How to clean up a guest user under windows xp

Using the shtasks utility create a task to run a clean script.

schtasks /create /tn limpieza /tr c:\limpieza.bat /sc onstart /ru System

Here is the limpieza.bat script:

RD /S /Q  «C:\Documents And Settings\Invitado»

If  you want an user to autologon check this info:



REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d Invitado /f