title: How to find a Linux namespace by network adapter?
body: <p>I have a Linux server with multiple <a href="http://docs.openstack.org/openstack-ops/content/network_troubleshooting.html" rel="nofollow">network namespaces</a> defined:</p>
  
  <pre><code># ip netns list
  qdhcp-7dedbd4e-2265-4aa2-baac-add4e341dd18
  qdhcp-851379ba-1d51-4e45-8e50-b756e81c0949
  qdhcp-a19927c5-83b4-4bb4-a8b8-f21fdb5e004b
  qdhcp-b94605ff-b0e2-4cfe-a95e-3dd10208a5fb
  ... ...
  </code></pre>
  
  <p>Each namespace contains one or more virtual network adapters - in this case, it's a TAP device:</p>
  
  <pre><code># ip netns exec qdhcp-7dedbd4e-2265-4aa2-baac-add4e341dd18 ip route
  192.168.168.0/24 dev tapda4018ab-b7  proto kernel  scope link  src 192.168.168.2
  169.254.0.0/16 dev tapda4018ab-b7  proto kernel  scope link  src 169.254.169.254
  default via 192.168.168.1 dev tapda4018ab-b7
  </code></pre>
  
  <p>Now let's say I know the name of the adapter - <code>tapda4018ab-b7</code> - but I don't know the namespace it belongs to. Is there a way to look it up without checking namespaces one by one? Is there a generic Linux command to do this? Or at least OpenStack Neutron-specific command?</p>