Does anyone know iptables well? I have a task and I got a little confused with it because I have a quite poor understanding of networking :)
- i need to limit access to the server for all outgoing connections, except smtp to 587 to its specific address
- allow access to incoming connections on port 80 from the world, so that certbot can generate certificates for itself without problems
- allow access to the server from the local work subnet
- block an access from everything else :)
— what i tried:
iptables --append OUTPUT --protocol tcp --src <here is the address of the mail server> --sport 587 --jump ACCEPT
IPTABLES -P OUTPUT DROP
iptables --append INPUT --protocol tcp --src <local network/24> --dport 22 --jump ACCEPT
- to connect with SSHiptables --append INPUT --protocol tcp --dport 80 --jump ACCEPT
- to connect to the world for certbotiptables --append INPUT --protocol tcp --src <local network/24> --dst 443 --jump ACCEPT
- to provide an access only for work subnetIPTABLES -P INPUT DROP
at the moment, the result is that I cannot open the resource at the address on port 80/443 from the local network and getting ERR_PROXY_CONNECTION_FAILED