How it works...
To block all the incoming traffic on the server and allow only the outbound connections, we again use Iptables as it is the default firewall of Linux.
To allow the proper functioning of the server internally, we allow access to localhost.
Next, to keep the outbound connections active, we add rules to accept the Time Exceeded, Destination Unreachable, and Echo ICMP packets.
Once these rules have been added, we can define whether we want to allow any incoming traffic for some particular services, such as SSH or a particular client address. For this, we create a table to add the list of IP address for the clients we want to allow. After, we add a rule to allow access to SSH service, or any other service as per our requirements. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access