def start(self): ''' Start the mesh tunnel. ''' self.logger.info("starting mesh tunnel '%s'" % self.name) tunnel_if = gre.create( self.dry_run, self.logger, self.name, "gretap", self.physical_local, self.physical_remote, key = self.asn, root_ipdb = self.root_ipdb, ) root_veth_if = veth.create( self.dry_run, self.logger, self.root_veth_name, self.netns_veth_name, root_ipdb = self.root_ipdb, ) netns_veth_if = root_veth_if.peer_get(peer_netns=self.netns) netns_veth_if.netns_set(self.netns) bridge_if = bridge.create( self.dry_run, self.logger, self.bridge_name, root_ipdb = self.root_ipdb, ) bridge_if.add_port(tunnel_if) bridge_if.add_port(root_veth_if) # Add an address to the network namespace veth interface, so it can # be addressed from either side of the mesh tunnel. netns_veth_if.add_ip(self.virtual_local, self.virtual_netmask) tunnel_if.up() root_veth_if.up() netns_veth_if.up() bridge_if.up() self.logger.info("finished starting mesh tunnel '%s'" % self.name)
def start(self): ''' Start the static tunnel. ''' self.logger.info("starting static tunnel '%s'" % self.name) tunnel_if = gre.create( self.dry_run, self.logger, self.tunnel_name, self.mode, self.local, self.remote, key = self.key, ikey = self.ikey, okey = self.okey, netns = self.netns, ) tunnel_if.add_ip(self.address, self.netmask) tunnel_if.up() self.logger.info("finished starting static tunnel '%s'" % self.name)