corebgp icon indicating copy to clipboard operation
corebgp copied to clipboard

(Optionally) allow non-global-unicast peer addresses

Open derlaft opened this issue 1 year ago • 2 comments

Hi, thanks for the great project.

We are trying to use it to communicate with AWS Transit Gateway Connect Attachment. In short, communication with the attachment happens over GRE.

Inside of each tunnel, there are BGP sessions over /29 ranges in 169.254.

  • Those are link-local IPv4 unicast ranges;
  • Those are currently filtered out in corebgp: https://github.com/jwhited/corebgp/blob/f3f0a0ed16a9bcd94f145478eb02fcd3ea035925/packet.go#L274-L278
  • There's currently no possibility to select other ranges in TGW Connect Peer configuration;

Proposal:

  • Introduce a new configuration entry in PeerConfig;
  • If this new flag is enabled, skip the relevant check;
  • Open to implement a different approach, if you see a better one.

derlaft avatar Apr 03 '24 12:04 derlaft

If the BGP Identifier field of the OPEN message is syntactically incorrect, then the Error Subcode MUST be set to Bad BGP Identifier. Syntactic correctness means that the BGP Identifier field represents a valid unicast IP host address.

https://datatracker.ietf.org/doc/html/rfc4271#section-6.2

Maybe a better approach would be to exclude only non-unicast addresses here and not expose anything in the config?

CC @jwhited

derlaft avatar Apr 04 '24 10:04 derlaft

If the BGP Identifier field of the OPEN message is syntactically incorrect, then the Error Subcode MUST be set to Bad BGP Identifier. Syntactic correctness means that the BGP Identifier field represents a valid unicast IP host address.

https://datatracker.ietf.org/doc/html/rfc4271#section-6.2

Maybe a better approach would be to exclude only non-unicast addresses here and not expose anything in the config?

CC @jwhited

if addr.IsMulticast() sounds good to me. Once the PR is updated I'll review.

jwhited avatar May 25 '24 15:05 jwhited