Block IP trough Fir...
 
Notifications
Clear all

Block IP trough Firewall

1 Posts
1 Users
0 Reactions
3 Views
Frank Schroeder
(@iseetwizard)
Eminent Member Admin
Joined: 5 years ago
Posts: 13
Topic starter  

I had recent attacks on my Linux server and so I was searching on how to add an IP drop with my firewall.

On my Sites I have a security system that blocks already many things but unfortunately not all.

And so here I show you an example on how to do it (at least how I did it).

 

#add the ip 91.92.252.176 to the connection reject list
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="91.92.252.176" reject'

#reload the firewall with the new settings
firewall-cmd --reload

#see the state of the firewall engine
firewall-cmd --state

#see the current settings
firewall-cmd --list-all

 

 
image
Example - You want to add an IP that is already exisiting
image 1
Reload firewall - if all is ok you'll get a success
image 2
Checking the state will show you if it's running or it's stopped
image 3
With list-all you gonna see the current settings - so also what is allowed (here logicaly obfuscated)
This topic was modified 17 hours ago by Frank Schroeder

   
Quote