Sha256: 17e1a06c2a8f20769088ae1e34e97e7248e7eddf3c8c3dd23b353e3954185292

Contents?: true

Size: 1016 Bytes

Versions: 2

Compression:

Stored size: 1016 Bytes

Contents

# -*- coding: utf-8 -*-

module Dcmgr
  module VNet
    module Tasks
    
      # Explicitely allows ARP traffic to take place from the instance to the host
      class AcceptARPToHost < Task
        include Dcmgr::VNet::Netfilter
        attr_reader :enable_logging
        attr_reader :log_prefix
        attr_reader :host_ip
        attr_reader :inst_ip
        
        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
      end
    
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
wakame-vdc-agents-11.12.0 lib/dcmgr/vnet/tasks/accept_arp_to_host.rb
wakame-vdc-dcmgr-11.12.0 lib/dcmgr/vnet/tasks/accept_arp_to_host.rb