Class: Dcmgr::VNet::Tasks::AcceptIpFromFriends
- Inherits:
-
Dcmgr::VNet::Task
- Object
- Dcmgr::VNet::Task
- Dcmgr::VNet::Tasks::AcceptIpFromFriends
- Includes:
- Netfilter
- Defined in:
- lib/dcmgr/vnet/tasks/accept_ip_from_friends.rb
Overview
Explicitely allows IP traffic between “friend” instances Friends are determined by an Isolator class
Instance Attribute Summary collapse
-
#friend_ips ⇒ Object
readonly
Returns the value of attribute friend_ips.
Attributes inherited from Dcmgr::VNet::Task
Instance Method Summary collapse
-
#initialize(friend_ips) ⇒ AcceptIpFromFriends
constructor
A new instance of AcceptIpFromFriends.
Constructor Details
#initialize(friend_ips) ⇒ AcceptIpFromFriends
Returns a new instance of AcceptIpFromFriends.
13 14 15 16 17 18 19 20 21 |
# File 'lib/dcmgr/vnet/tasks/accept_ip_from_friends.rb', line 13 def initialize(friend_ips) super() @friend_ips = friend_ips friend_ips.each { |friend_ip| self.rules << IptablesRule.new(:filter,:forward,nil,:incoming,"-s #{friend_ip} -j ACCEPT") } end |
Instance Attribute Details
#friend_ips ⇒ Object (readonly)
Returns the value of attribute friend_ips.
11 12 13 |
# File 'lib/dcmgr/vnet/tasks/accept_ip_from_friends.rb', line 11 def friend_ips @friend_ips end |