Class: Dcmgr::VNet::Tasks::AcceptARPToHost

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

Overview

Explicitely allows ARP traffic to take place from the instance to the host

Instance Attribute Summary collapse

Attributes inherited from Dcmgr::VNet::Task

#rules

Instance Method Summary collapse

Constructor Details

#initialize(host_ip, inst_ip, enable_logging, log_prefix) ⇒ AcceptARPToHost

Returns a new instance of AcceptARPToHost.



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/dcmgr/vnet/tasks/accept_arp_to_host.rb', line 15

def initialize(host_ip,inst_ip,enable_logging,log_prefix)
  super()
  
  @enable_logging = enable_logging
  @log_prefix = log_prefix
  @host_ip = host_ip
  @inst_ip = inst_ip
  
  self.rules << EbtablesRule.new(:filter,:input,:arp,:outgoing,"--protocol arp --arp-ip-src #{self.inst_ip} --arp-ip-dst #{self.host_ip} --log-ip --log-arp --log-prefix '#{self.log_prefix}' -j CONTINUE") if self.enable_logging
  self.rules << EbtablesRule.new(:filter,:input,:arp,:outgoing,"--protocol arp --arp-ip-src #{self.inst_ip} -j ACCEPT")
end

Instance Attribute Details

#enable_loggingObject (readonly)

Returns the value of attribute enable_logging.



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

def enable_logging
  @enable_logging
end

#host_ipObject (readonly)

Returns the value of attribute host_ip.



12
13
14
# File 'lib/dcmgr/vnet/tasks/accept_arp_to_host.rb', line 12

def host_ip
  @host_ip
end

#inst_ipObject (readonly)

Returns the value of attribute inst_ip.



13
14
15
# File 'lib/dcmgr/vnet/tasks/accept_arp_to_host.rb', line 13

def inst_ip
  @inst_ip
end

#log_prefixObject (readonly)

Returns the value of attribute log_prefix.



11
12
13
# File 'lib/dcmgr/vnet/tasks/accept_arp_to_host.rb', line 11

def log_prefix
  @log_prefix
end