diff --git a/yabgp/core/protocol.py b/yabgp/core/protocol.py index f314489..3744f45 100644 --- a/yabgp/core/protocol.py +++ b/yabgp/core/protocol.py @@ -92,7 +92,11 @@ def connectionMade(self): # Set the local BGP id from the local IP address if it's not set if self.factory.bgp_id is None: try: - self.factory.bgp_id = int(netaddr.IPAddress(self.transport.getHost().host)) + local_host_addr = netaddr.IPAddress(self.transport.getHost().host) + if 'IPv6' in local_host_addr.info: + self.factory.bgp_id = int(netaddr.IPAddress('127.0.0.1')) + else: + self.factory.bgp_id = int(local_host_addr) except Exception as e: LOG.error(e) error_str = traceback.format_exc()