Sobes.tech
Junior — Middle

Have you dealt with setting up and managing firewalls using iptables?

sobes.tech AI

Answer from AI

Yes, I have experience configuring and managing firewalls using iptables. I used iptables to restrict access to certain ports, configure NAT and port forwarding, and also to protect the server from unwanted traffic.

For example, to allow incoming connections only on ports 80 and 443, and block the rest, you can use rules like:

iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -j DROP

I also applied saving rules and their automatic loading on server reboot.