Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] BgpFsm::openRecv: peer BGP ID (0.0.0.11) invalid. #3

Open
amb1s1 opened this issue Jan 18, 2021 · 5 comments
Open

[ERROR] BgpFsm::openRecv: peer BGP ID (0.0.0.11) invalid. #3

amb1s1 opened this issue Jan 18, 2021 · 5 comments

Comments

@amb1s1
Copy link

amb1s1 commented Jan 18, 2021

I'm trying to test libbgp with bird as a peer. When I run the peer-and-print.cc I get the following:

waiting for any client...
accept(): new client from 10.168.0.6.
ticker(): ticker started.
[DEBUG] BgpFsm::run: got message (Current state: Idle):
[DEBUG] OpenMessage {
    Version { 4 }
    MyAsn { 65001 }
    BgpId { 0.0.0.11 }
    HoldTimer { 240 }
    Capabilities {
        MpBgpCapability {
            Code { 1 }
            Afi { IPv4 }
            Safi { Unicast }
        }
        UnknowCapability {
            Code { 2 }
        }
        UnknowCapability {
            Code { 64 }
        }
        FourOctetAsnCapability {
            Code { 65 }
            MyAsn { 65001 }
        }
        UnknowCapability {
            Code { 70 }
        }
        UnknowCapability {
            Code { 71 }
        }
    }
}
[ERROR] BgpFsm::openRecv: peer BGP ID (0.0.0.11) invalid.
[DEBUG] BgpFsm::writeMessage: write (Current state: Idle):
[DEBUG] NotificationMessage {
    Error { OPEN Message Error }
    SubError { Bad Peer BGP ID }
}
waiting for the ticker thread to stop...
ticker(): ticker stopped.
closing socket & clean up...
@magicnat
Copy link
Member

libbgp was expecting a valid IPv4 address as router ID; what did you configure as router ID on the bird side?

I believe non-IPv4 addresses can be use as router ID too. You can comment out the check here [1] to get rid of the error.

[1] https://github.com/Nat-Lab/libbgp/blob/master/src/bgp-fsm.cc#L344

@amb1s1
Copy link
Author

amb1s1 commented Jan 18, 2021

I configured as 0.0.0.11

@magicnat
Copy link
Member

In this case, you can comment out the checks mentioned above, or change the router ID to something that does not start with 0, 127, 224 to 239, or 240.

I will push an update to fix the issue later. Thanks for reporting.

@amb1s1
Copy link
Author

amb1s1 commented Jan 19, 2021

Thanks, it is peering now.

@amb1s1
Copy link
Author

amb1s1 commented Jan 19, 2021

It looks like you guys are using validAddr4 for multiple functions. May I suggest to split the function to something more readable. like validRouterID and validNextHop. Thanks for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants