Page MenuHomeVyOS Platform

BGP IPv6 neighbor statements configuration not normalized.
Open, NormalPublicBUG

Description

The following IPv6 neighbor configuration entries are not normalized and appear under different entries even though they are the same IPv6-address. This can probably lead to many side-effecst

bgp x {
    neighbor 2001:DB8:: {
        ebgp-multihop 3
        remote-as 65000
    }
    neighbor 2001:db8:: {
        ebgp-multihop 1
        remote-as 65000
    }
    neighbor 2001:db8::0 {
        ebgp-multihop 2
        remote-as 65000
    }
}

Details

Difficulty level
Normal (likely a few hours)
Version
VyOS 1.3-beta-202103030443
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

Viacheslav triaged this task as Normal priority.Mar 4 2021, 7:27 PM
Viacheslav changed Difficulty level from Unknown (require assessment) to Normal (likely a few hours).

FRR doing normalization for ipv6

set protocols bgp local-as '65001'
set protocols bgp neighbor 2001:DB8:: remote-as '65002'
set protocols bgp neighbor 2001:db8:: remote-as '65002'
set protocols bgp neighbor 2001:db8::0 remote-as '65002'

Show protocols

vyos@r6-roll# show protocols 
 bgp {
     local-as 65001
     neighbor 2001:DB8:: {
         remote-as 65002
     }
     neighbor 2001:db8:: {
         remote-as 65002
     }
     neighbor 2001:db8::0 {
         remote-as 65002
     }
 }

FRR

!
router bgp 65001
 no bgp ebgp-requires-policy
 no bgp network import-check
 neighbor 2001:db8:: remote-as 65002
!

Need to think about how we can use it in our CLI for neighbors

root@r6-roll:/home/vyos# ./test.py 2001:4860:800f:0:0:0:0:0063
2001:4860:800f::63
root@r6-roll:/home/vyos# ./test.py 2001:DB8::
2001:db8::
root@r6-roll:/home/vyos# ./test.py 2001:db8::
2001:db8::
root@r6-roll:/home/vyos# ./test.py  2001:db8::0
2001:db8::
root@r6-roll:/home/vyos#

Script

#!/usr/bin/env python3

import re
import sys
import ipaddress


if __name__ == '__main__':
    if len(sys.argv) < 2:
        print("Argument required")
        sys.exit(1)

    address_string = sys.argv[1]

    try:
        address = ipaddress.IPv6Address(address_string)
        normalized_address = address.compressed
        normalized_address = normalized_address.lower()
    except ipaddress.AddressValueError:
        # It's likely an IPv4 address or peer-group, do nothing
        normalized_address = address_string

    print(f'{normalized_address}')
    sys.exit(0)

That mist actually be habdled by vbash and the backend code.

But good snippet