Hello,
I'm posting here since I failed to configure advanced dynamic rules on IPFW. I run an application on my server that uses only UDP (single port 31578). I'm suffering from various attacks since a few days from kids flooding myappz application port with malformed UDP packets or random UDP packet sizes. Those attacks are not very powerful since it seems to come from a single connection with limited upload bandwidth ( < 100 KB/s). Banning their IP is not the solution since they have dynamic IPs but also use a third party service to hide their IP.
So it makes me think that IPFW with dynamic rules would be the best way to keep valid data packets and drop the others by doing the following:
The following configuration doesn't work as expected since when my application is under attack, my clients' ping have high value. I believe the dynamic rules and pipe was used for the entire traffic while I was expecting to use one pipe per IP.
I'm posting here since I failed to configure advanced dynamic rules on IPFW. I run an application on my server that uses only UDP (single port 31578). I'm suffering from various attacks since a few days from kids flooding my
So it makes me think that IPFW with dynamic rules would be the best way to keep valid data packets and drop the others by doing the following:
- Pass UDP packets to a pipe with very limited bandwidth if they match port 31578.
- If an UDP packet comes from the inside (means my application answered to a valid data), it will installs a dynamic rule to leave restrictions on this particular IP only.
Code:
ipfw pipe 1 config mask src-ip 0xffffffff bw 3Kbit/s
ipfw pipe 2 config mask src-ip 0xffffffff bw 100Kbit/s
ipfw add check-state
ipfw add pipe 2 udp from any to me in dst-port 31578
ipfw add allow udp from any to me out dst-port 31578 keep-state
ipfw add pipe 1 udp from any to me in dst-port 31578
The following configuration doesn't work as expected since when my application is under attack, my clients' ping have high value. I believe the dynamic rules and pipe was used for the entire traffic while I was expecting to use one pipe per IP.