Class: Dcmgr::VNet::Tasks::AcceptArpBroadcast

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

Instance Attribute Summary collapse

Attributes inherited from Dcmgr::VNet::Task

#rules

Instance Method Summary collapse

Constructor Details

#initialize(hva_ip, enable_logging = false, log_prefix = nil) ⇒ AcceptArpBroadcast

Returns a new instance of AcceptArpBroadcast.



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

def initialize(hva_ip,enable_logging = false,log_prefix = nil)
  super()
  self.hva_ip = hva_ip

  # Allow broadcast from the network
  self.rules << EbtablesRule.new(:filter,:forward,:arp,:incoming,"--protocol arp --arp-mac-dst 00:00:00:00:00:00 #{EbtablesRule.log_arp(log_prefix) if enable_logging} -j ACCEPT")
  # Allow broadcast from the host
  self.rules << EbtablesRule.new(:filter,:output,:arp,:outgoing,"--protocol arp --arp-ip-src=#{self.hva_ip} #{EbtablesRule.log_arp(log_prefix) if enable_logging} --arp-mac-dst 00:00:00:00:00:00 -j ACCEPT")
end

Instance Attribute Details

#hva_ipObject

Returns the value of attribute hva_ip.



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

def hva_ip
  @hva_ip
end