I have D-Link Router DSL-2730U that support busybox OS and iptables version 1.4.0
I managed successfully to block the host for being connect to the internet using the following command
block by ip address
iptables -I FORWARD -d 192.168.1.6 -j DROP
Or By mac source
iptables -I FORWARD -m mac --mac-source bc:20:a4:ff:79:80 -j DROP
The only problem now i have is trying to limit transfer speed rate (upload & download) to be only serve 30/kbps by MAC Address using iptables
I tried to make iptables rule like
iptables -I FORWARD -m mac --mac-source bc:20:a4:ff:79:80 -m state --state RELATED,ESTABLISHED -m limit --limit 100/second --limit-burst 30 -j ACCEPT
But it didn't work
Note : this router cannot modify , delete or add any files . i cannot make a bash or script file inside the router run , and unfortunately the iptables connlimit module not supported in this iptables version too
--mac-source
) an alternative to a destination rule (-d
)... You can limit the bandwidth with traffic shaping (tc
), too, but ifconnlimit
isn't available that raises the question whethertc
is. – Hauke Laging Feb 08 '15 at 11:23--limit
doesn't do what you appear to think it does, and you can't limit traffic speed withiptables
. Instead usetc
to manage traffic shaping. Have a search for myshaper, amongst other utilities. – Chris Davies Feb 08 '15 at 13:14iptables
, by simple expedient of dropping packets that would push you over the set rate. It is not as precise astc
, because of how dropped TCP packets interact with various resending and congestion avoidance algorithms, but it guarantees you won't go over the limit. – Davor Cubranic May 07 '20 at 17:49tc
, you can find myshaper.sh at http://www.tldp.org/HOWTO/ADSL-Bandwidth-Management-HOWTO/implementation.html – Davor Cubranic May 07 '20 at 17:52