Example #1
0
 def express_cloudpipe(self):
     private_ip = self.network[2]
     linux_net.confirm_rule("FORWARD -d %s -p udp --dport 1194 -j ACCEPT" %
                            (private_ip, ))
     linux_net.confirm_rule(
         "PREROUTING -t nat -d %s -p udp --dport %s -j DNAT --to %s:1194" %
         (self.project.vpn_ip, self.project.vpn_port, private_ip))
Example #2
0
File: network.py Project: jxta/cc
 def express(self, address=None):
     addresses = self.host_objs
     if address:
         addresses = [self.get_host(address)]
     for addr in addresses:
         if addr.get('private_ip','available') == 'available':
             continue
         public_ip = addr['address']
         private_ip = addr['private_ip']
         linux_net.bind_public_ip(public_ip, FLAGS.public_interface)
         linux_net.confirm_rule("PREROUTING -t nat -d %s -j DNAT --to %s"
                                % (public_ip, private_ip))
         linux_net.confirm_rule("POSTROUTING -t nat -s %s -j SNAT --to %s"
                                % (private_ip, public_ip))
         # TODO: Get these from the secgroup datastore entries
         linux_net.confirm_rule("FORWARD -d %s -p icmp -j ACCEPT"
                                % (private_ip))
         for (protocol, port) in DEFAULT_PORTS:
             linux_net.confirm_rule("FORWARD -d %s -p %s --dport %s -j ACCEPT"
                                    % (private_ip, protocol, port))
Example #3
0
 def express(self, address=None):
     addresses = self.host_objs
     if address:
         addresses = [self.get_host(address)]
     for addr in addresses:
         if addr.get('private_ip', 'available') == 'available':
             continue
         public_ip = addr['address']
         private_ip = addr['private_ip']
         linux_net.bind_public_ip(public_ip, FLAGS.public_interface)
         linux_net.confirm_rule("PREROUTING -t nat -d %s -j DNAT --to %s" %
                                (public_ip, private_ip))
         linux_net.confirm_rule("POSTROUTING -t nat -s %s -j SNAT --to %s" %
                                (private_ip, public_ip))
         # TODO: Get these from the secgroup datastore entries
         linux_net.confirm_rule("FORWARD -d %s -p icmp -j ACCEPT" %
                                (private_ip))
         for (protocol, port) in DEFAULT_PORTS:
             linux_net.confirm_rule(
                 "FORWARD -d %s -p %s --dport %s -j ACCEPT" %
                 (private_ip, protocol, port))
Example #4
0
File: network.py Project: sorenh/cc
 def express_cloudpipe(self):
     private_ip = self.network[2]
     linux_net.confirm_rule("FORWARD -d %s -p udp --dport 1194 -j ACCEPT"
                            % (private_ip, ))
     linux_net.confirm_rule("PREROUTING -t nat -d %s -p udp --dport %s -j DNAT --to %s:1194"
                            % (self.project.vpn_ip, self.project.vpn_port, private_ip))