Comment 5 for bug 1995735

Revision history for this message
Brian Haley (brian-haley) wrote :

Thanks for the info Frode. I wonder if it's the version of pyroute2? I created a small python program that should run the same commands, perhaps we can give that a try? I can pull a kinetic iso and try if you don't have one running. The below did work on my 22.04-ish system.

# ip netns add foo
# python ./ipd.py

ipd.py:

import socket
import pyroute2
from pyroute2 import netns

def main():
    with pyroute2.NetNS('foo', flags=0) as ip:
        link_id = ip.link_lookup(ifname='lo')
        dev = link_id[0]
        ip.addr("add", index=dev, address='fe80::1', mask=64, family=socket.AF_INET6)
        ip.addr("delete", index=dev, address='fe80::1', mask=64, family=socket.AF_INET6)

if __name__ == "__main__":
    main()