How to do it...

We can define different rules using Iptables. These rules are then followed by the kernel when checking the incoming and outgoing traffic packets:

  1. The first thing we shall do on our system is check which version of iptables is installed by using the following command:

  1. Now, we will check whether any rule already exists on the system for Iptables by using the -L option:

  1. The preceding output can also be seen in a format that tells us about the commands that are necessary for each policy. To do this, use the -S option, as follows: ...

Get Practical Linux Security Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.