âHow to Block Internet Connection Using IPTables Tools
Introduction
Iptables is a tool or application that functions as a firewall in the Linux operating system. With iptables, you can manage network traffic on the server such as allowing, blocking or skipping incoming and outgoing connections, managing ports and so on. Iptables is a firewall application that is used by default on various Linux distributions, especially on servers that do not use graphical control panels such as cPanel or Plesk Panel.
Iptables works by reading network traffic and comparing it with a set of rules that have been created. The rules in iptables are in the form of a table consisting of a series of rules or rules called a chain. There are three main tables in Iptables, namely Filter, NAT and Mangle. In this article, we will focus on discussing Filter tables because they are most often used in server operations with the Linux operating system.
Configuration
Debian 10-Server
Install Package
Change the contents of the proftpd file
nano /etc/proftpd/proftpd.conf
Restart proftpd Service
Check the service from the client browser by typing the URL: ftp://IP-Internet
Example : ftp://192.168.91.150
Configuration IPTables
Debian 10-Router
iptables 1
iptables this time aims to block all packets originating from the ip pool 192.168.91.0/24
iptables 2
iptables this time aims to block all packets originating from the Debian 10- Router's ens33 interface
iptables 3
iptables this time aims to block all packets that will be sent to our local IP, namely 11.1.25.0/24
iptables 4
iptables this time aims to block all packets that will be sent to the Debian 10- Router's ens36 interface
iptables 5
Port 21
iptables this time aims to block all packets that will be sent to port 21 (FTP's default port) on the Debian 10- Router
To check whether port 21 has been blocked or not, you can check by going to Windows-Client then browsing to the Debian 10-Router's FTP service address by doing
Port 22
iptables this time aims to block all packets that will be sent to port 22 (SSH's default port) on the Debian 10- Router
To check whether port 22 has been blocked or not, you can check by going to Windows-Client then SSH using putty/cmd to the Debian 10-Router by doing
iptables 6
Block Ping
iptables this time aims to block ping packets that will be sent to the Debian 10- Router's ens33
To check whether the firewall blocking pings has been successful or not, you can check by going to Windows-Client then pinging the Debian 10-Router's Internet IP using this method.
Reject Ping
iptables this time aims to reject ping packets that will be sent to the Debian 10- Router's ens33
To check whether the firewall rejecting the ping packet has been successful or not, you can check by going to Windows-Client then pinging the Debian 10-Router's Internet IP using this method.
Configuration is Completed
Last updated