From: Andrew Gideon on

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. Which does make sense as "ip tunnel show" doesn't show
this tun device either.

But ifconfig does show it, as does "ip link show".

Any suggestions on how to delete the tun device?

Thanks...Andrew
From: Pascal Hambourg on
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.
From: Jurgen Haan on
Andrew Gideon wrote:
> 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. Which does make sense as "ip tunnel show" doesn't show
> this tun device either.
>
> But ifconfig does show it, as does "ip link show".
>
> Any suggestions on how to delete the tun device?
>
> Thanks...Andrew

use 'tunctl'
From: Andrew Gideon on
On Fri, 04 Apr 2008 12:16:57 +0200, Pascal Hambourg wrote:

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

Well, I'm guessing that some resource is being held by some mechanism
somewhere in there <grin>. It only happens sometimes, and it does appear
to eventually time out. I've not yet figured out the pattern, but I
think it make be related to moving between networks (ie. when I shut my
laptop down at home and bring it back online elsewhere). It's not 100%
even in that case, though.

I'll try tunctl when this next occurs.

- Andrew
From: Andrew Gideon on
On Fri, 04 Apr 2008 23:36:27 +0000, Andrew Gideon wrote:

> I'll try tunctl when this next occurs.

Sorry. I meant to add "thanks" to the two of you that suggested this.

Thanks...

Andrew