If you get them for the host network namespace, then ypu can get them also for other network namespaces. The issue here is how to "know" that a certain namespace exists and how to access it. From what I've seen when looking at the netns code in pyroute2, it supports out of the box only network namespaces registered in /var/run/netns. Thus, no docker, ...
However, what I'm doing is as follows: there's a python package nsenter. I'm using that to enter a network namespace, then create an IPRoute object and query the information I'm interested in while in this namespace, leave, done. You can find namespaces using /proc/PID/ns/net or other means. No need to switch the mount namespace as long as you're not forking any tools that rely on /sys/class/net.
--
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.
Hi Peter/all,
Thanks a lot for your ideas. I will use this logic and implement my functionality.
Regards
--Muni
Sent from Mail for Windows 10
To unsubscribe from this group and stop receiving emails from it, send an email to pyroute2-dev...@googlegroups.com.