SÍNTESI 25 | SAIA

MANAGEMENT OF TRAFFIC TO LAN

These iptables rules control access from the client network (10.0.10.0/26). Only connections to essential service ports are allowed: 21 (FTP), 22 (SSH for FTP), 80 (HTTP), 443 (HTTPS), and 25 (SMTP). Any other connections are blocked, enhancing security and limiting access to strictly necessary services.

sudo iptables -A INPUT -p tcp –dport 80 -s 10.0.10.0/26 -j ACCEPT

sudo iptables -A INPUT -p tcp –dport 22 -s 10.0.10.0/26 -j ACCEPT

sudo iptables -A INPUT -p tcp –dport 443 -s 10.0.10.0/26 -j ACCEPT

sudo iptables -A INPUT -p tcp –dport 21 -s 10.0.10.0/26 -j ACCEPT

sudo iptables -A INPUT -p tcp –dport 25 -s 10.0.10.0/26 -j ACCEPT

With this rule, we will block any other FTP connection outside of the network:

sudo iptables -A INPUT -p tcp –dport 21 -j REJECT

FTP TESTS:

Leave a Comment