Undo iptables modification
use iptables -D ... to delete the entries.
iptables -D INPUT -p tcp --dport 22 -m state --state NEW -m recent --set --name SSH
iptables -D INPUT -p tcp --dport 22 -m state --state NEW -j SSH_WHITELIST
iptables -D INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --rttl --name SSH -j ULOG --ulog-prefix SSH_brute_force
iptables -D INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --rttl --name SSH -j DROP
Run the same commands with -D
instead of -A
.
Alternatively, if you want to completely reset the iptables, flush everything with iptables -F
.
As long as you didn't run the iptables save
command, all you should have to do is restart or reload the iptables service. Or, you can do what Bonsi Scott said and delete the rules -- with a caveat. First run:
#iptables -L -n -v --line-numbers
to get the rule number, then all you would have to do is delete the rule by number with:
#iptables -D INPUT <rule number>