Class: Dcmgr::VNet::Tasks::AcceptIpFromGateway

Inherits:
Dcmgr::VNet::Task show all
Includes:
Netfilter
Defined in:
lib/dcmgr/vnet/tasks/accept_ip_from_gateway.rb

Overview

Explicitely allows IP traffic between the gateway and the instances

Instance Attribute Summary collapse

Attributes inherited from Dcmgr::VNet::Task

#rules

Instance Method Summary collapse

Constructor Details

#initialize(gateway_ip) ⇒ AcceptIpFromGateway

Returns a new instance of AcceptIpFromGateway.



12
13
14
15
16
17
18
# File 'lib/dcmgr/vnet/tasks/accept_ip_from_gateway.rb', line 12

def initialize(gateway_ip)
  super()
  
  @gateway_ip = gateway_ip
  
  self.rules << IptablesRule.new(:filter,:forward,nil,:incoming,"-s #{gateway_ip} -j ACCEPT")
end

Instance Attribute Details

#gateway_ipObject (readonly)

Returns the value of attribute gateway_ip.



10
11
12
# File 'lib/dcmgr/vnet/tasks/accept_ip_from_gateway.rb', line 10

def gateway_ip
  @gateway_ip
end