2

I have a Netgear DGN2200v2 router. I am trying to make advanced scripts for the router. Specifically, I want to detect people using eMule and Torrent, and then block them from accessing for 5 minutes, then give them access back. Also I would like to add a whitelist of MAC addresses where eMule and Torrent are allowed. (Not really important)

Also of course a way to semi-easily disable the script.

Is there any way to do it? I have no idea where to even start searching, and I have no idea if it's even possible to install custom software on the router.

FAILED ATTEMPT 1: openwrt isn't supported by my router

2

https://wiki.openwrt.org/toh/start supported per line 626

ipset create ban hash:net  maxelem 200000 timeout 300
ipset create whitemac hash:mac
ipset add whitemac 00:12:00:34:00:56 (add all macs one at time)
ipset save -f /somewhere/ipset.conf

on boot up you need

ipset restore -f /somewhere/ipset.conf

manually add addresses to block list

ipset add ban 1.1.1.1

You need iptables and ipset.

#mac white list
iptables -A INPUT -m set -j ACCEPT --match-set whitemac src
#add to block list if it matches ports
#I don't know which port emule uses, but you can look them up and
#add them, with commas separation instead of <ports>
iptables -A INPUT -m multiport --dports <ports> -j SET  --add-set ban src --timeout 300
#block traffic in the ban list.
iptables -A INPUT -m set -j DROP  --match-set ban src
| improve this answer | |
  • You found the wrong router, at line 636 (my router) it says unsupported. Any other way maybe? – Amit Gold Feb 27 '16 at 18:07
  • Hello? A little bit of support? – Amit Gold Mar 1 '16 at 8:06
  • @AmitGold Couldn't find a compatible firmware for your device. – cybernard Mar 1 '16 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.