I'm make a shell script have some rules to limit connection on port Then it's effect badly on my vps
Script :
#!/bin/bash
# Window of time in seconds
SECS=60
# Max connections per IP
MAXCONN=5
iptables -A INPUT -p tcp --syn --dport 5222 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --syn --dport 5222 -m state --state NEW -m recent --update --seconds ${SECS} --hitcount ${MAXCONN} -j REJECT
iptables -A INPUT -p tcp --syn --dport 5223 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --syn --dport 5223 -m state --state NEW -m recent --update --seconds ${SECS} --hitcount ${MAXCONN} -j REJECT
iptables -A INPUT -p tcp --syn --dport 5224 -m state --state NEW -m recent --set
iptables -A INPUT -p tcp --syn --dport 5224 -m state --state NEW -m recent --update --seconds ${SECS} --hitcount ${MAXCONN} -j REJECT
And I need to remove all this rules
How can I do this?
To run this command to flush all the rules:
This command will print all the rules:
Following command is to save firewall change