this apply ipset and iptables rules, display verbose ipset and iptables command and display errors
Signed-off-by: Alexandre Derumier <[email protected]> --- src/pve-firewall | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pve-firewall b/src/pve-firewall index befee44..62d5768 100755 --- a/src/pve-firewall +++ b/src/pve-firewall @@ -366,7 +366,14 @@ __PACKAGE__->register_method ({ description => "Compile and print firewall rules. This is useful for testing.", parameters => { additionalProperties => 0, - properties => {}, + properties => { + full => { + optional => 1, + type => 'boolean', + description => "Full compilation test with iptables and ipset restore", + default => 0, + }, + } }, returns => { type => 'null' }, @@ -393,7 +400,10 @@ __PACKAGE__->register_method ({ if (!$cluster_conf->{options}->{enable}) { print "firewall disabled\n"; } - + if ( $param->{full}){ + my $hostfw_conf = PVE::Firewall::load_hostfw_conf(); + PVE::Firewall::apply_ruleset($ruleset, $hostfw_conf, $ipset_ruleset, 1); + } }; PVE::Firewall::run_locked($code); -- 1.7.10.4 _______________________________________________ pve-devel mailing list [email protected] http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
