Sha256: 5bde49621af9a838d01ce7a391f9d4e85a3f6f2c834a68783e4ed557f286b625

Contents?: true

Size: 1.41 KB

Versions: 2

Compression:

Stored size: 1.41 KB

Contents

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

module Dcmgr
  module VNet
    module Tasks
    
      # Accept related and established connections for tco
      class AcceptTcpRelatedEstablished < Task
        include Dcmgr::VNet::Netfilter
        def initialize
          super()
          self.rules << IptablesRule.new(:filter,:forward,:tcp,:incoming,"-m state --state RELATED,ESTABLISHED -p tcp -j ACCEPT")
        end
      end
      
      # Accept related and established connections for icmp
      class AcceptIcmpRelatedEstablished < Task
        include Dcmgr::VNet::Netfilter
        def initialize
          super()
          self.rules << IptablesRule.new(:filter,:forward,:icmp,:incoming,"-m state --state RELATED,ESTABLISHED -p icmp -j ACCEPT")
        end
      end
      
      # Accept established connections for any udp
      class AcceptUdpEstablished < Task
        include Dcmgr::VNet::Netfilter
        def initialize
          super()
          self.rules << IptablesRule.new(:filter,:forward,:udp,:incoming,"-m state --state ESTABLISHED -p udp -j ACCEPT")
        end
      end
    
      # Accept related and established connaction for any protocol
      class AcceptRelatedEstablished < Task
        include Dcmgr::VNet::Netfilter
        def initialize
          super()
          self.rules << IptablesRule.new(:filter,:forward,nil,:incoming,"-m state --state RELATED,ESTABLISHED -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_related_established.rb
wakame-vdc-dcmgr-11.12.0 lib/dcmgr/vnet/tasks/accept_related_established.rb