Iptables rules default location

Discussion in 'ISPConfig 3 Priority Support' started by Stelios, Nov 7, 2022.

  1. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi all,

    I want to run a few custom commands with Iptables (to block some countries etc) and would like to ask where should I put them in order to load after every reboot on all servers?

    Thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig is not loading any iptables rules. So your question is basically how to load iptables rules for the OS you use, you can probably find matching articles for this question e.g. via Google search.
     
  3. Stelios

    Stelios Active Member HowtoForge Supporter

    So those rules that are set via ispconfig interface where are they stored?
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not set IPTables rules via ISPConfig interface. If you mean opening or closing ports, the port numbers (not iptables rules) are stored in the firewall you have chosen. That's either Bastille Firewall (for older systems) or UFW (for newer Ubuntu and Debian systems). In both cases, no IPTables rules are set by ISPConfig, ISPConfig just stores the port numbers in the bastille config file or it uses the ufw command to open/close ports in UFW. UFW itself is persistent, so it does not loose port configs set via ufw command after a reboot.
     
    Last edited: Nov 7, 2022
  5. Stelios

    Stelios Active Member HowtoForge Supporter

    Thanks Till, now I know how to sort it out. I believe if I add those rules under /etc/ufw/user.rules it will work fine.
     

Share This Page