LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-11-2016, 01:01 PM   #1
postcd
Member
 
Registered: Oct 2013
Posts: 527

Rep: Reputation: Disabled
How to ban myself if i load webpage more than 1 times at a time?


Hello,

im trying to achive that more than 1 simultaneous connections from one /24 subnet is rejected by netfilter

But i cant manage to get rejected when Loading hosted website simultaneously several times

Quote:
# iptables -L INPUT
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:http state RELATED,ESTABLISHED
REJECT tcp -- anywhere anywhere tcp dpt:http flags:FIN,SYN,RST,ACK/SYN #conn/24 > 1 reject-with icmp-port-unreachable
DROP tcp -- anywhere anywhere tcp dpt:http flags:FIN,SYN,RST,ACK/SYN #conn/32 > 150
(based on commands from http://unix.stackexchange.com/a/143715)

OpenVZ VPS
CentOS 6.x
2.6.32-042stab093.5

perl /etc/csf/csftest.pl
Quote:
Testing ip_tables/iptable_filter...OK
Testing ipt_LOG...OK
Testing ipt_multiport/xt_multiport...OK
Testing ipt_REJECT...OK
Testing ipt_state/xt_state...OK
Testing ipt_limit/xt_limit...OK
Testing ipt_recent...OK
Testing xt_connlimit...OK
Testing ipt_owner/xt_owner...OK
Testing iptable_nat/ipt_REDIRECT...OK
Testing iptable_nat/ipt_DNAT...OK
What is wrong please? Thank you
 
Old 08-11-2016, 03:38 PM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Not sure abut the rules you have above but this one seems to work:

Code:
iptables -A INPUT -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -m connlimit --connlimit-above 1 -j REJECT --reject-with icmp-host-prohibited
 
Old 08-16-2016, 09:33 AM   #3
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Rule order is everything in iptables.

Rule 1 accepts all traffic to the http port

Your blocking rule is never tested as rule one matches first.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] linux functions, from time to time giving series of three beeps, repeated three times Yury_T Linux - General 7 11-19-2014 02:27 PM
load photos in webpage Pedroski Linux - Newbie 2 06-09-2014 05:29 PM
opening 1 webpage calls the perl cgi script 3 times ? 5883 Linux - Software 2 06-25-2013 12:28 AM
Webpage access at specific times management program for Ubuntu zivs Linux - Software 3 05-28-2010 04:44 PM
Webpage load time Windows=0,6sec Linux=+30sec !!!! RedDwarf Linux - Networking 0 08-07-2004 10:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration