Skip to contentSkip to conversation

Forcing an RST

DISCUSSION James Strickland 3 participants 4 messages Feb 20, 2006

lore
Share & tools
lore
#0 lore raw

Hi. Is there a way so that when a packet reaches the filter table input chain with the Syn flag set, that i send out a response with RST?

ie: connections to my wan interface with Syn set (trying to establish) on port 80 get a RST response to the sender?

#1 lore raw

Hi James,

On Mon, Feb 20, 2006 at 12:45:20PM -0500, James Strickland told us:

Quoted 5 lines

Hi. Is there a way so that when a packet reaches the filter table input chain with the Syn flag set, that i send out a response with RST?

ie: connections to my wan interface with Syn set (trying to establish) on port 80 get a RST response to the sender?

iptables -A INPUT -i <your wan device> -p tcp --dport 80 \
         -j REJECT --reject-with tcp-reset

But this should be not too hard to find in any of the iptables tutorials out there ;-), e.g.

http://iptables-tutorial.frozentux.net/iptables-tutorial.html

have a nice day ;-)

Sven

Signature · 2 lines
Linux zion.homelinux.com 2.6.16-rc3-mm1_27 #27 Wed Feb 15 17:51:36 CET 2006 i686 athlon i386 GNU/Linux
 19:00:44 up 2 days, 23:16,  1 user,  load average: 0.07, 0.14, 0.18
#2 lore raw
In reply to James Strickland
Quoted 8 lines · James Strickland

Hi. Is there a way so that when a packet reaches the filter table input chain with the Syn flag set, that i send out a response with RST?

ie: connections to my wan interface with Syn set (trying to establish) on port 80 get a RST response to the sender?

Use -p tcp --syn -j REJECT --with tcp-reset

#3 lore raw
Quoted 4 lines · Steven M Campbell
Quoted 3 lines · James Strickland

Hi. Is there a way so that when a packet reaches the filter table input chain with the Syn flag set, that i send out a response with RST?

Quoted 9 lines
Quoted 5 lines

ie: connections to my wan interface with Syn set (trying to establish) on port 80 get a RST response to the sender?

Use -p tcp --syn -j REJECT --with tcp-reset

heh, both of us got it wrong, sven missed the syn bit, I missed the port 80

-p tcp --syn --dport 80 -j REJECT --with tcp-reset