IPDB is not in sych with system routes

33 views
Skip to first unread message

Ragan Gidde

unread,
Aug 18, 2017, 5:08:18 AM8/18/17
to pyroute2-dev
Hello,

I am using IPDB APIs to synch between system configuration and my configuration DB. So far it was working fine.
Suddenly one strange issue started appearing.

ISSUE: IPDB fails to retrieve complete routing information. it is consistent once the problem start appearing.

Below is the IPDB dump:

>>> ipdb.routes.tables[123]
[{'metrics': {}, 'oif': 4, 'dst_len': 0, 'family': 10, 'proto': 4, 'tos': 0, 'dst': 'default', 'flags': 0, 'ipdb_priority': 0, 'priority': 2, 'scope': 0, 'encap': {}, 'src_len': 0, 'table': 123, 'multipath': [], 'type': 1, 'gateway': 'fd00::1', 'ipdb_scope': 'system'}, {'metrics': {}, 'oif': 4, 'dst_len': 24, 'family': 2, 'proto': 4, 'tos': 0, 'dst': '45.45.44.0/24', 'flags': 0, 'ipdb_priority': 0, 'priority': 3, 'scope': 0, 'encap': {}, 'src_len': 0, 'table': 123, 'multipath': [], 'type': 1, 'gateway': '45.45.45.1', 'ipdb_scope': 'system'}, {'metrics': {}, 'oif': 4, 'dst_len': 64, 'family': 10, 'proto': 4, 'tos': 0, 'dst': 'fd01::/64', 'flags': 0, 'ipdb_priority': 0, 'priority': 2, 'scope': 0, 'encap': {}, 'src_len': 0, 'table': 123, 'multipath': [], 'type': 1, 'gateway': 'fd00::1', 'ipdb_scope': 'system'}]

Below is the IPRoute dump:

>>> ip.route('dump',table=123)
[{'family': 2, 'dst_len': 0, 'proto': 4, 'tos': 0, 'event': 'RTM_NEWROUTE', 'header': {'pid': 4294962720, 'length': 60, 'flags': 2, 'error': None, 'type': 24, 'sequence_number': 259}, 'flags': 0, 'attrs': [('RTA_TABLE', 123), ('RTA_PRIORITY', 6), ('RTA_GATEWAY', '45.45.45.1'), ('RTA_OIF', 4)], 'table': 123, 'src_len': 0, 'type': 1, 'scope': 0}, {'family': 2, 'dst_len': 24, 'proto': 4, 'tos': 0, 'event': 'RTM_NEWROUTE', 'header': {'pid': 4294962720, 'length': 68, 'flags': 2, 'error': None, 'type': 24, 'sequence_number': 259}, 'flags': 0, 'attrs': [('RTA_TABLE', 123), ('RTA_DST', '45.45.44.0'), ('RTA_PRIORITY', 3), ('RTA_GATEWAY', '45.45.45.1'), ('RTA_OIF', 4)], 'table': 123, 'src_len': 0, 'type': 1, 'scope': 0}]

System configuration:

>> ip r l t 123
default via 45.45.45.1 dev offload  proto static  metric 6
45.45.44.0/24 via 45.45.45.1 dev offload  proto static  metric 3

As shown above, the highlighted route is being displayed in IPRoute dump and system ip command dump.
However it is not present in the IPDB dump.

Any idea why is such discrepancy in the IPDB behavior?



Ragan Gidde

unread,
Aug 18, 2017, 5:13:14 AM8/18/17
to pyroute2-dev

This issue happens specially with IPv4 routes. So far issue is not seen with IPv6 routes.

Peter Saveliev

unread,
Aug 18, 2017, 8:34:36 AM8/18/17
to Ragan Gidde, pyroute2-dev
Thanks, investigating. Looks like a bug, so wait for a fix asap.

--
You received this message because you are subscribed to the Google Groups "pyroute2-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyroute2-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ragan Gidde

unread,
Aug 18, 2017, 9:41:45 AM8/18/17
to pyroute2-dev, ragan...@gmail.com

Thanks for your reply.
Yes. Please provide the fix asap. We badly need the correction :)
Thanks for your help.
To unsubscribe from this group and stop receiving emails from it, send an email to pyroute2-dev...@googlegroups.com.

Peter Saveliev

unread,
Aug 18, 2017, 4:15:59 PM8/18/17
to Ragan Gidde, pyroute2-dev
Several questions:

* Which pyroute2 version do you use?
* Is it reproducible?
* Can you send ipdb.routes.tables[123].idx.keys() ?

To unsubscribe from this group and stop receiving emails from it, send an email to pyroute2-dev+unsubscribe@googlegroups.com.

Ragan Gidde

unread,
Aug 19, 2017, 11:38:02 PM8/19/17
to pyroute2-dev, ragan...@gmail.com

  • version:  pyroute2-0.4.15
  • The issue doesn't happen every time. Once it starts appearing means it exists forever. We are not sure what all cases it would get reproduced.
  • >>> ipdb.routes.tables[123].idx.keys()
    [RouteKey(dst='45.45.44.0/24', scope=0, table=123, priority=3, oif=4), RouteKey(dst='1.1.1.1/32', scope=0, table=123, priority=None, oif=4), RouteKey(dst='default', scope=0, table=123, priority=2, oif=4), RouteKey(dst='fd01::/64', scope=0, table=123, priority=2, oif=4)]


I hope I have provided required information. Please let me know if any additional information required.


Thanks for your kind support.

Peter Saveliev

unread,
Aug 20, 2017, 4:30:32 PM8/20/17
to Ragan Gidde, pyroute2-dev
Yep. The issue is that in 0.4.15 there was no family in the route keys, so default IPv6 just kicked out default IPv4 route.

Pls try to upgrade to the latest stable version (0.4.18) or use the git — the master branch will be released soon as 0.5.0 and there is 0.4.x branch for the «stable» 0.4.x API with only bugfixes backported from the master.

To unsubscribe from this group and stop receiving emails from it, send an email to pyroute2-dev+unsubscribe@googlegroups.com.

Ragan Gidde

unread,
Aug 21, 2017, 10:54:59 AM8/21/17
to pyroute2-dev, ragan...@gmail.com
Sure. I will try to update to the version that you have mentioned and get back.

Thanks again for your support.

Ragan Gidde

unread,
Aug 22, 2017, 2:48:52 AM8/22/17
to pyroute2-dev, ragan...@gmail.com
One dumb question:
I have cloned the code. how to generate a RPM to put into build?

Thanks.

Peter Saveliev

unread,
Aug 22, 2017, 6:28:26 AM8/22/17
to Ragan Gidde, pyroute2-dev


On Fedora it should be relatively simple (assume you have everything in place to create rpms — rpmbuild etc.):

$ git clone …
$ cd pyroute2
$ vim packages/RedHat/python-pyroute2.spec
$ make rpm

The source tarball is generated after  «git describe», so pls change the spec file accordingly before «make rpm».


To unsubscribe from this group and stop receiving emails from it, send an email to pyroute2-dev+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages