Class: Tablomat::IPTables

Inherits:
IPTablesBase show all
Defined in:
lib/tablomat/iptables.rb

Overview

The IPTables interface

Instance Attribute Summary

Attributes inherited from IPTablesBase

#active, #builtin_chains, #iptables_bin, #tmp_chain

Instance Method Summary collapse

Methods inherited from IPTablesBase

#activate, #append, #deactivate, #delete, #exec, #exists, #get_active_rules, #insert, #normalize, #parse_chain, #parse_data, #parse_output, #parse_table, #print, #switch_sources, #synchronize, #table

Methods included from Exec

exec

Constructor Details

#initializeIPTables

Returns a new instance of IPTables.



200
201
202
203
204
205
206
# File 'lib/tablomat/iptables.rb', line 200

def initialize
  super()
  # iptables must be in PATH
  @iptables_bin = 'iptables'
  @iptables_bin = "sudo #{@iptables_bin}" if Etc.getlogin != 'root'
  synchronize
end