Class: Dcmgr::VNet::Tasks::StaticNatLog
- Inherits:
-
Dcmgr::VNet::Task
- Object
- Dcmgr::VNet::Task
- Dcmgr::VNet::Tasks::StaticNatLog
- Includes:
- Netfilter
- Defined in:
- lib/dcmgr/vnet/tasks/static_nat.rb
Instance Attribute Summary collapse
-
#dnat_log_prefix ⇒ Object
Returns the value of attribute dnat_log_prefix.
-
#inside_ip ⇒ Object
Returns the value of attribute inside_ip.
-
#outside_ip ⇒ Object
Returns the value of attribute outside_ip.
-
#snat_log_prefix ⇒ Object
Returns the value of attribute snat_log_prefix.
Attributes inherited from Dcmgr::VNet::Task
Instance Method Summary collapse
-
#initialize(inside_ip, outside_ip, snat_log_prefix = "", dnat_log_prefix = "") ⇒ StaticNatLog
constructor
A new instance of StaticNatLog.
Constructor Details
#initialize(inside_ip, outside_ip, snat_log_prefix = "", dnat_log_prefix = "") ⇒ StaticNatLog
Returns a new instance of StaticNatLog.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/dcmgr/vnet/tasks/static_nat.rb', line 14 def initialize(inside_ip,outside_ip,snat_log_prefix = "",dnat_log_prefix = "") super() self.inside_ip = inside_ip self.outside_ip = outside_ip self.snat_log_prefix = snat_log_prefix self.dnat_log_prefix = dnat_log_prefix self.rules = [] self.rules << IptablesRule.new(:nat,:prerouting,nil,:incoming,"-d #{self.outside_ip} -j LOG --log-prefix '#{self.dnat_log_prefix}'") self.rules << IptablesRule.new(:nat,:postrouting,nil,:outgoing,"-s #{self.inside_ip} -j LOG --log-prefix '#{self.snat_log_prefix}'") end |
Instance Attribute Details
#dnat_log_prefix ⇒ Object
Returns the value of attribute dnat_log_prefix.
12 13 14 |
# File 'lib/dcmgr/vnet/tasks/static_nat.rb', line 12 def dnat_log_prefix @dnat_log_prefix end |
#inside_ip ⇒ Object
Returns the value of attribute inside_ip.
9 10 11 |
# File 'lib/dcmgr/vnet/tasks/static_nat.rb', line 9 def inside_ip @inside_ip end |
#outside_ip ⇒ Object
Returns the value of attribute outside_ip.
10 11 12 |
# File 'lib/dcmgr/vnet/tasks/static_nat.rb', line 10 def outside_ip @outside_ip end |
#snat_log_prefix ⇒ Object
Returns the value of attribute snat_log_prefix.
11 12 13 |
# File 'lib/dcmgr/vnet/tasks/static_nat.rb', line 11 def snat_log_prefix @snat_log_prefix end |