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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.