iptables scripting to block ports for a specific IP

2 posts / 0 new
Last post
digger2one
digger2one's picture
iptables scripting to block ports for a specific IP

I need help and I’m not sure if I am on the right track. I want to block all ports for one specific IP address. Only the TCP port 5223 should be open. The reason for is that I don’t want that my kids are using the internet all night long with their mobile phones. They have computers and with them it is much easier to filter unwanted content and websites. Could someone explain me how can I handle this with a iptables script?

I’m using a Netgear WNR3500L v2 with installed TomatoUSB by shabby Version 1.28

Is the following script correctly and workable?

iptables -I FORWARD -s 192.168.1.27 -p tcp --dport 1:5222 -j DROP

iptables -I FORWARD -s 192.168.1.27 -p tcp --dport 5234:65535 -j DROP

Many thanks for help ;-)

subzero79
subzero79's picture
You can use the access

You can use the access restriction section in tomato. Filter by day, hour and content.