![]() In case you only want to block TCP traffic from that IP address, you can use the -p option that specifies the protocol. The -A option appends the rule in the end of the selected chain. Be very careful when running this command as you can accidentally block your own IP address. Where you need to change "" with the actual IP address. ![]() If you find an unusual or abusive activity from an IP address you can block that IP address with the following rule: # iptables -A INPUT -s -j DROP Block Specific IP Address in IPtables Firewall For example, to check the rules in the NAT table, you can use: # iptables -t nat -L -v -nģ. If you prefer to check the rules for a specific table, you can use the -t option followed by the table which you want to check. This should return output similar to the one below: Chain INPUT (policy ACCEPT 1129K packets, 415M bytes) If you want to check your existing rules, use the following command: # iptables -L -n -v On SysVinit based Linux Distributions - On Cent/RHEL 6/5 and Fedora. This is fairly easy: On SystemD based Linux Distributions - On Cent/RHEL 7 and Fedora 22+. Start/Stop/Restart Iptables Firewallįirst, you should know how to manage iptables service in different Linux distributions. ![]() For the purpose of this article, I will start with simpler commands and go to more complex to the end. In this article, you will see some useful commands that will help you manage your Linux box firewall through iptables.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |