Deleting TAP interface
I'm able to create the TAP interface, lets say with name 'test', and bring it up, but when I try deleting it using
ioctl(fd, TUNSETPERSIST, 0)
I can see that on my system I still have an interafce with name eth0 (the original name was test). How can I completely delete the interface that I created and restore the system to the state it was before I created the TAP interface?
Do use tunctl to delete the device created. tunctl is available in xml-utilities pacakge.
use tunctl -d tap0 to delete the tap0. before deleting the device, bring it down using ifconfig tap0 down.
Then bring down the eth0 interface and run dhclient to get the IP address.
ifconfig eth0 down
hope it helps