Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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')
Ejemplo n.º 3
0
 def hw_id(self, action, interface, hwid):
     if not vld.testiface(interface):
         return False
     hw = [interface, "hw-id", hwid]
     self.ethernet_config(action, hw)
Ejemplo n.º 4
0
 def hw_id(self,action,interface,hwid):
     if not vld.testiface(interface):
         return False
     hw= [interface,"hw-id",hwid]
     self.ethernet_config(action,hw)
Ejemplo n.º 5
0
 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)
Ejemplo n.º 6
0
 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])
Ejemplo n.º 7
0
 def listenon_interface(self,action,interface):
     if not vld.testiface(interface):
         return False
     return self.dns_config(action,["listen-on",interface])