Re: How to destroy tun device (created by ssh -w)?



Hello,

Andrew Gideon a écrit :
I've tun devices created via "ssh -w". Sometimes, the connection is broken in a way that leaves the tun device around. I can remove the device via "rmmod tun", but this kills *all* tun devices. I'd like to be a little less bloodthirsty than that.

I thought perhaps "/sbin/ip tunnel del tun9", but that yields: "ioctl: Operation not supported". So apparently it's not the right type of device for this.

No it's not. "ip tunnel" manages only kernel-mode tunnels such as IP-in-IP, GRE or IPv6-in-IPv4 over IP. Not user-mode TUN/TAP devices.

Any suggestions on how to delete the tun device?

Try tunctl from UML (User-mode Linux).

However I am a bit surprised that the tun device created by ssh is persistent after ssh exits, because this is useless.
.