NAME

Parser::IPTables::Save - A parser for iptables-save output files.

VERSION

Version 0.0.5

SYNOPSIS

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();

METHODS

create

Create a new rule

$iptables_save->create({ chain => 'POSTROUTING', source => '192.168.1.0/24', target => 'MASQUERADE', comment => 'Rule to masquerade' });

delete

Delete a rule

$iptables_save->delete(8);

disable

disable a rule

# disable rule with index 5
$iptables_save->disable(5);

enable

enable a rule

# enable a rule previously disabled
$iptables_save->enable(5);

new

table

Set table name

$iptables_save->table('filter');

fetch_rules

DESTROY

move

Move rules

# Move rule of index 1, 3 positions down
$iptables_save->move(1, 3);

save

$iptables_save->save();

AUTHOR

Geovanny Junio, <geovannyjs at gmail.com>

CONTRIBUTORS

rpetre: Petru Rațiu

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Parser::IPTables::Save

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2013 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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 489:

Non-ASCII character seen before =encoding in 'Rațiu'. Assuming CP1252