I need to assign rules in my firewall using programming.. I mean I want to create a web app in which user can select the firewall rules for their ip address and those rules will be assigned to that IP. There would be only one firewall machine. I think a firewall with nice api will do this. Anyone knows open source firewall with good api??
Share
The linux firewall is called
netfilterand is a part of the linux kernel. There are various userland tools which manipulates it, most notably the de-facto standard utilityiptables. As you need to be root in order to modify firewall rules, and web servers should not run as root, I’d recommend a two-tier approach to solving this: A web app which modifies a set of rules (in a SQL db, or a config file), and a daemon running as root which monitors for rule changes and applies them by executingiptables.