The essence of the problem: you need to open the port, but by entering various iptables commands, this case will not be crowned with success.

For example, I enter

iptables -I INPUT -p tcp -m tcp --dport 53 -j ACCEPT

in iptables -L 53, the port is saved, but from the external network it remains closed. And after rebooting the server, all innovations in iptables are reset to the original ones. Iptables-persistense, iptables-save, iptables-apply did not help either. What could be the reason?

From my comments on this issue:

  • The server is fail2ban
  • Some manuals mention service iptables start , but I don’t have this service.
  • When you enter the sudo iptables-apply , it displays the error Error: rulesfile not readable: /etc/network/iptables.up.rules
  • Why tcp? Maybe all the same udp protocol. Or if you really need tcp, then add another rule for udp. - de_frag
  • What policy is used for the INPUT chain? What is the external network? Show an example of how you use commands to save the rules - stxdtm
  • in general, we must begin again. How exactly did you determine that this port is closed? (in general, judging by the above information, it is very likely that there is a “ xy error ”) - aleksandr barakin
  • @alexanderbarakin, following the recommendations from a similar question ru.stackoverflow.com/questions/347145/ ... open ports are determined using nmap from a third-party device. The server is almost stock, especially nothing has been reconfigured. I edit iptables, but ports do not open. It seems that iptables can only limit, and the ports themselves are opened with something that is higher than the firewall. Unfortunately, I don’t have enough knowledge to resolve this issue on my own - MIKS
  • and the ports themselves are opened with something that stands above the firewall - something like this (if the words “stands higher” are replaced by “has no relation to”): the ports are “opened” by application programs. - aleksandr barakin

0