Class: Dcmgr::VNet::Tasks::AcceptARPFromGateway

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

Instance Attribute Summary collapse

Attributes inherited from Dcmgr::VNet::Task

#rules

Instance Method Summary collapse

Constructor Details

#initialize(gw_ip, enable_logging = false, log_prefix = nil) ⇒ AcceptARPFromGateway

Returns a new instance of AcceptARPFromGateway.



11
12
13
14
15
16
# File 'lib/dcmgr/vnet/tasks/accept_arp_from_gateway.rb', line 11

def initialize(gw_ip,enable_logging = false,log_prefix = nil)
  super()
  self.gw_ip = gw_ip
  # Allow broadcast from the gateway
  self.rules << EbtablesRule.new(:filter,:forward,:arp,:incoming,"--protocol arp --arp-ip-src=#{self.gw_ip} #{EbtablesRule.log_arp(log_prefix) if enable_logging} -j ACCEPT")
end

Instance Attribute Details

#gw_ipObject

Returns the value of attribute gw_ip.



9
10
11
# File 'lib/dcmgr/vnet/tasks/accept_arp_from_gateway.rb', line 9

def gw_ip
  @gw_ip
end