22

I'm creating a network interface via a program in order to build a bridge between a simulated network (NS-3) and the real Linux host. So when the "bridged" node receive a packet in NS-3, the real Linux host receive the packet.

But when I run the program again, it can't "erase" or delete the network interface because "device or resource is busy".

I tried to shut the interface down (ifconfig <myInterface> down), restart the networking service (service networking restart), tried to delete the TAP interface with tunctl (tunctl -d myInterface), but even after hours, I'm still not able to delete or reuse this interface. "Device or resource is busy".

Can you please explain me how to delete or erase or reuse the interface?

michas
  • 25,361
  • 15
  • 76
  • 121
user2561112
  • 221
  • 1
  • 2
  • 3

3 Answers3

40

You can use sudo ip link delete tap# to delete the interface itself.

user3637203
  • 762
  • 5
  • 17
-4

just type ip link set tap# down and it dissapears.

-4

You can also edit out network devices by use of this file then restarting computer.... vi /etc/udev/rules.d/70-persistent-net.rules