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

Unable to Receive RTM_NEWNEIGH Netlink Messages for Interfaces in a VRF #1238

Open
firasrasmy-thg opened this issue Jan 9, 2025 · 0 comments

Comments

@firasrasmy-thg
Copy link

firasrasmy-thg commented Jan 9, 2025

I am using pyroute2 to listen for netlink RTM_NEWNEIGH messages on an interface that is part of a VRF. However, no netlink messages are received for the interface under the VRF. The same code works fine for interfaces not assigned to a VRF.

Code:

with IPRoute() as ipr:
    ipr.bind()
    while True:
        for message in ipr.get():
            print(message)
            if message['event'] == 'RTM_NEWNEIGH':
                attrs = dict(message['attrs'])
                if not attrs.get('NDA_LLADDR', None):
                    print(f"Null route: {attrs['NDA_DST']}")
                else:
                    print(f"{attrs['NDA_DST']} is alive!")
        time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants