Blocking all traffic except HTTP HTTPS and MSN with iptables

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
liverpoolatnight
DD-WRT User


Joined: 29 May 2008
Posts: 243
Location: United Kingdom

PostPosted: Mon Feb 08, 2010 22:59    Post subject: Blocking all traffic except HTTP HTTPS and MSN with iptables Reply with quote
I have done it now if your intressed heres my config:

This will block all traffic except HTTP HTTPS and MSN (Windows Live Messenger)

iptables -I FORWARD -s 192.168.1.2 -p tcp --dport 1:79 -j REJECT --reject-with tcp-reset
iptables -I FORWARD -s 192.168.1.2 -p tcp --dport 80 -j ACCEPT
iptables -I FORWARD -s 192.168.1.2 -p tcp --dport 81:442 -j REJECT --reject-with tcp-reset
iptables -I FORWARD -s 192.168.1.2 -p tcp --dport 443 -j ACCEPT
iptables -I FORWARD -s 192.168.1.2 -p tcp --dport 444:1682 -j REJECT --reject-with tcp-reset
iptables -I FORWARD -s 192.168.1.2 -p tcp --dport 1683 -j ACCEPT
iptables -I FORWARD -s 192.168.1.2 -p tcp --dport 1684:9999 -j REJECT --reject-with tcp-reset

Just replace 192.168.1.2 with the ip you wont to block

Heres what you do to block a RANGE of users
192.168.1.1-192.168.1.101

http://www.dd-wrt.com/wiki/index.php/Iptables_command
_________________

_________________
TP-Link TL-WDR3600 v1 [EU]: r36330 (07/16/18 )
D-Link DIR-615 D2 [EU]: r36330 (07/16/18 )
Mikrotik RB750r2 (OpenWrt 17.01.4)
EE BrightBox 1 aka A4001N (OpenWrt 17.01.4)
Sagemcom FAST@5364 (VDSL2,FTTC (Fibre to the Cabinet) Synced 65/17

Twitter: @francisuk1989
---------------------------------
Found a bug? Report it http://svn.dd-wrt.com
DD-WRT Official FB Group: https://www.facebook.com/groups/493762527744455
Sponsor
whomever21
DD-WRT Novice


Joined: 25 Jul 2008
Posts: 4

PostPosted: Thu Feb 11, 2010 12:49    Post subject: block local traffic to a specific port Reply with quote
i'm trying to do something slightly different. I want to block a computer on my local network from another computer on the same network. i've tried a dozen different things, but so far no luck.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum