Archive

Articles taggués ‘VPS’

Iptables Tutorial – Securing Ubuntu VPS with Linux Firewall

14/10/2023 Comments off

Are you looking for a complete iptables tutorial? Stay put. In this article, we will show you how to install and use iptables on the Ubuntu system. By learning about this Linux firewall tool, you can secure your Linux VPS using the command-line interface.

What is Iptables, and How Does It Work?

Simply put, iptables is a firewall program for Linux. It will monitor traffic from and to your server using tables. These tables contain sets of rules, called chains, that will filter incoming and outgoing data packets.

When a packet matches a rule, it is given a target, which can be another chain or one of these special values:

  • ACCEPT – will allow the packet to pass through.
  • DROP – will not let the packet pass through.
  • RETURN – stops the packet from traversing through a chain and tell it to go back to the previous chain.

In this iptables tutorial, we are going to work with one of the default tables, called filter. It consists of three chains:

  • INPUT –  controls incoming packets to the server.
  • FORWARD – filters incoming packets that will be forwarded somewhere else.
  • OUTPUT – filter packets that are going out from your server.

Before we begin this guide, make sure you have SSH root or sudo access to your machine that runs on Ubuntu 16.04 or up. You can establish the connection through PuTTY (Windows) or terminal shell (Linux, macOS). If you own Hostinger VPS, you can get the SSH login details on the Servers tab of hPanel.

iptables rules only apply to ipv4. If you want to set up a firewall for the ipv6 protocol, you will need to use ip6tables instead.

Lire la suite…

Categories: Réseau, Sécurité Tags: , ,