Hi all,
I was trying to create a segment routing v6 tunnel (seg6) with pyroute2 library but my tentative failed.
With ip route command is possible to create a tunnel in this way:
ip -6 route add 2001:0:0:10::2/128 encap seg6 mode encap segs 2000::5,2000::6 dev eth0
Instead, this is what I did with my example script:
# Get iface
idx = ip.link_lookup(ifname=iface_name)[0]
# create SR tunnel 2001:0:0:10::2/128 encap seg6 mode encap segs 2000::5,2000::6 dev hnyc-eth0
ip.route(
'add',
dst='2001:0:0:10::2/128',
oif=idx,
encap={'type': 'seg6', 'mode': 'encap', 'segs':['2000::5', '2000::6']}
)
# release Netlink socket
ip.close()
Running this script adds a new static route for
2001:0:0:10::2/128 but not the expected tunnel, it looks like the encapsulation
seg6 is silently discarded.
If I am right, I would like to add the support for seg6 tunnel mode to pyroute2 library, can someone point me where to start ?
Thanks
Pier