bit more. i think i need to add both the allocations and the client ip
This commit is contained in:
		
							parent
							
								
									0b07050ce4
								
							
						
					
					
						commit
						276aa01928
					
				@ -182,6 +182,21 @@ class TunnelBroker(object):
 | 
				
			|||||||
            logger.error(('Could not add address {0} on link {1}: '
 | 
					            logger.error(('Could not add address {0} on link {1}: '
 | 
				
			||||||
                          '{2}').format(str(self.addr), self.iface_name, e))
 | 
					                          '{2}').format(str(self.addr), self.iface_name, e))
 | 
				
			||||||
            raise e
 | 
					            raise e
 | 
				
			||||||
 | 
					        for a in self.allocations:
 | 
				
			||||||
 | 
					            try:
 | 
				
			||||||
 | 
					                _addr = next(a.hosts())
 | 
				
			||||||
 | 
					                self.ipr.addr('add',
 | 
				
			||||||
 | 
					                              index = self.iface_idx,
 | 
				
			||||||
 | 
					                              address = str(_addr),
 | 
				
			||||||
 | 
					                              mask = a.prefixlen,
 | 
				
			||||||
 | 
					                              family = socket.AF_INET6)
 | 
				
			||||||
 | 
					                logger.debug('Added address {0} to link {1} with prefix {2}.'.format(str(_addr),
 | 
				
			||||||
 | 
					                                                                                     self.iface_name,
 | 
				
			||||||
 | 
					                                                                                     a.prefixlen))
 | 
				
			||||||
 | 
					            except Exception as e:
 | 
				
			||||||
 | 
					                logger.error(('Could not add address {0} on link {1}: '
 | 
				
			||||||
 | 
					                              '{2}').format(str(self.addr), self.iface_name, e))
 | 
				
			||||||
 | 
					                raise e
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            self.ipr.route('add', dst = 'default', oif = self.iface_idx, family = socket.AF_INET6)
 | 
					            self.ipr.route('add', dst = 'default', oif = self.iface_idx, family = socket.AF_INET6)
 | 
				
			||||||
            logger.debug('Added default route for link {0}.'.format(self.iface_name))
 | 
					            logger.debug('Added default route for link {0}.'.format(self.iface_name))
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user