Ejemplo n.º 1
0
    def parse_and_apply_default_config(cls, router_id):
        """parse the default configuration"""
        res = "hostname ospfd\npassword zebra\nrouter ospf\nospf router-id " + \
              router_id + "\nlog-adjacency-changes\nnetwork 0.0.0.0/0 area 0\n"
        with open(cls.ospf_config_file, 'w') as f:
            f.write(res)
        logger.info('OSPF default configuration has been parsed.')

        if cls.execute_cmd_api.execute('ospfd -d'):
            logger.info('Default OSPF thread has been turned on.')
        else:
            logger.error('Fail to start default OSPF thread.')
Ejemplo n.º 2
0
 def apply(self):
     if self.execute_cmd_api.execute('zebra -d'):
         logger.info('Static Route thread has been turned on.')
     else:
         logger.error('Fail to start Zebra for Static Route thread.')
Ejemplo n.º 3
0
 def apply(self):
     if self.execute_cmd_api.execute('ripd -d'):
         logger.info('RIP thread has been turned on.')
     else:
         logger.error('Fail to start RIP thread.')
Ejemplo n.º 4
0
 def apply(self):
     if self.execute_cmd_api.execute('ospfd -d'):
         logger.info('OSPF thread has been turned on.')
     else:
         logger.error('Fail to start OSPF thread.')
Ejemplo n.º 5
0
 def start_zebra(self):
     if self.execute_cmd_api.execute('zebra -d'):
         logger.debug('Zebra thread has been turned on.')
     else:
         logger.error('Fail to start Zebra thread.')