Parser::IPTables::Save - A parser for iptables-save output files.
Version 0.04
Quick summary of what the module does.
Perhaps a little code snippet.
use Parser::IPTables::Save; my $iptables_save = Parser::IPTables::Save->new('/tmp/iptables.out'); $iptables_save->table('filter'); $iptables_save->create({ chain => 'POSTROUTING', source => '192.168.1.0/24', target => 'MASQUERADE', comment => 'Rule to masquerade' }); $iptables_save->move(3, -1); $iptables_save->delete(8); $iptables_save->delete(9); my @rules = $iptables_save->fetch_rules(); $iptables_save->disable(10); $iptables_save->enable(10); $iptables_save->save();
Create a new rule
$iptables_save->create({ chain => 'POSTROUTING', source => '192.168.1.0/24', target => 'MASQUERADE', comment => 'Rule to masquerade' });
Delete a rule
$iptables_save->delete(8);
disable a rule
# disable rule with index 5 $iptables_save->disable(5);
enable a rule
# enable a rule previously disabled $iptables_save->enable(5);
Set table name
$iptables_save->table('filter');
Move rules
# Move rule of index 1, 3 positions down $iptables_save->move(1, 3);
$iptables_save->save();
Geovanny Junio, <geovannyjs at gmail.com>
<geovannyjs at gmail.com>
Please report any bugs or feature requests to bug-parser-iptables-save at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Parser-IPTables-Save. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-parser-iptables-save at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Parser::IPTables::Save
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Parser-IPTables-Save
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Parser-IPTables-Save
CPAN Ratings
http://cpanratings.perl.org/d/Parser-IPTables-Save
Search CPAN
http://search.cpan.org/dist/Parser-IPTables-Save/
Copyright 2010 Geovanny Junio.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Parser::IPTables::Save, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parser::IPTables::Save
CPAN shell
perl -MCPAN -e shell install Parser::IPTables::Save
For more information on module installation, please visit the detailed CPAN module installation guide.