How do I block repepating requests? Should I do it with Apache2 config or .htaccess?
I want to block the same repeating requests to my website. For example, someone hits “Refresh” button 3 times, so I want the same requests following from that user to be auto blocked. I know I can do that with PHP or whatever server-side programming language is used, but is there any “portable” solution independent of the website, like Apache2 config or iptables rule? Are there any other methods of such basic protection? Asked by [...]
Continue Reading »Iptables port forward tftpd
i need to forward incoming port 69 to port 2112 with iptables on linux. i don’t need any NAT etc. just accept incoming connections to port 2112 like it be 69 pot. Thank you! Asked by Raspizdyay As well as the port forwarding, you also need an extra module loaded to handle tracking tftp connections. This can be done in testing by simply running modprobe nf_conntrack_tftp Making it permanent depends on the distro in use, [...]
Continue Reading »Hostname forward to port
I would like to know how to do the following. I would like so, when you connect to a domain example.com – it’ll forward that to lets say 15.46.43.33:26046 (This is for a game, not Apache). Is this possible with IPTables, or any other software for Linux (CentOS 6.2)? – Appreciate it Asked by Daniel I think you need a domain (example.com in your example) and a DNS A record to associate the hostname to [...]
Continue Reading »Allow accessing to the port :8080 in iptable
I need to access to my website on port :8080 But for a reason, I can’t : That’s what looks like my iptable -L https://gist.github.com/28e7a48d91e933c6f377 After searching on serverfault, I’ve just added : iptables -I INPUT 1 -i lo -p tcp –dport 8080 -j ACCEPT With no effet (even after a iptable restart) How to allow access of the port 8080 please (both locally and externally because of the setting i’m going to put for [...]
Continue Reading »iptables: Allow port range but deny to certain IP
I am running a server which needs UDP ports 1000:11000 opened, as well as TCP 10011 and 30033 open to function. I have a set of iptables rules set to allow SSH and those ports, and intentionally left out 2010 as I am getting attacked on that port. The server does not block the incoming IP even when told to do so. The IP that needs to be denied is: 194.97.114.3. My iptables script: service [...]
Continue Reading »iptables rules to counter the most common DoS attacks? [closed]
Recently I’ve got a lot of small scale DoS attacks. I am wondering what iptables rules should I use to counter the most common DoS attacks, and generally secure my web server. The web server sports Varnish -> nginx/php5 -> memcached -> mysql I tried some generic receipts but they also block access to my database server which sits at a remote server, so I just flushed the suggested rules, and now feel a bit [...]
Continue Reading »Rate-Limit affects All clients or single IP?
Well up-til now I’ve considered iptables rate-limit commands with the “recent” module to work for each IP Address. For example rate-limit rule of 20k/s will trigger only if a single IP exceeds 20k/s rate and not if 4 different IPs exceed 5k/s rate. Please correct me if I considered this wrong as I’ve only used these rules for TCP/ UDP. But today I tried similar rules for ICMP and applied 4/s Input/Output. But then on [...]
Continue Reading »service iptables * doesn’t display message
Running service iptables (start|stop|restart) isn’t displaying the usual [FAILED]|[SUCCESS] messages I’m used to on previous machines. This is a new server, but I’ve updated everything via yum (I’m running CentOS 6.2). This isn’t really a problem, per se, but it’s slightly bugging me. Anyone know what’s up? EDIT: Also, it seems I don’t have an /etc/sysconfig/iptables This is strange. Asked by Rob What you are seeing is normal for the case of a missing /etc/sysconfig/iptables [...]
Continue Reading »Sendmail doesn’t work with iptables, even though smtp and dns are allowed
I have sendmail installed on Ubuntu 10.04 solely for the use of the php mail() function. This works fine unless iptables is running (I’ve been using sendmail myemailaddress@domain.com to test this). I think that I have allowed SMTP and DNS (the script I am using to test iptables rules is below, in my version are the actual IPs of my hosts nameservers), but to no avail! iptables –flushiptables -A INPUT -p tcp –dport 22 -j [...]
Continue Reading »Packets being dropped by iptables
I am trying to create a Software Access Point in linux. I followed the blog here. Steps I performed: Started dhcp server on wlan0. Properly configured hostapd.conf Enabled packet forwarding & masquerading. Two commands executed regarding iptables: iptables –table nat –append POSTROUTING –out-interface eth0 -j MASQUERADE iptables –append FORWARD –in-interface wlan0 -j ACCEPT I enabled logging on iptables & I get this in everything.log Jun 29 19:42:03 MBP-archlinux kernel: [10480.180356] IN=eth0 OUT=wlan0 MAC=c8:bc:c8:9b:c4:3c:00:13:80:40:cd:80:08:00 SRC=195.143.92.150 DST=10.0.0.3 [...]
Continue Reading »


