def set_interface_route(self, dst_subnet, next_iface): if not vld.testip(dst_subnet) or not vld.testiface(next_iface): return False interface_params = [ dst_subnet + "/24", "next-hop-interface", next_iface ] return self.route("set", "interface-route", interface_params)
def set_interface_vpn(self,iface): if vld.testiface(iface): logger.warn("interface %s already exist"%iface) raise InterfaceExist("[WORNING] interface already exist") elif not self.check_ovp_iface_name(iface): logger.error("%s is not in the correct format!"%iface) return False return self.openvpn_config(iface,'set')
def hw_id(self, action, interface, hwid): if not vld.testiface(interface): return False hw = [interface, "hw-id", hwid] self.ethernet_config(action, hw)
def hw_id(self,action,interface,hwid): if not vld.testiface(interface): return False hw= [interface,"hw-id",hwid] self.ethernet_config(action,hw)
def set_interface_route(self,dst_subnet,next_iface): if not vld.testip(dst_subnet) or not vld.testiface(next_iface): return False interface_params=[dst_subnet+"/24","next-hop-interface",next_iface] return self.route("set","interface-route",interface_params)
def del_vpn_config(self,iface): if not vld.testiface(iface): logger.error("%s does not exists in the current mounted interfaces!"%iface) return False return self.delete('delete',[IOV,iface])
def listenon_interface(self,action,interface): if not vld.testiface(interface): return False return self.dns_config(action,["listen-on",interface])