Networking Forums

Networking Forums > Computer Networking > Linux Networking > How to destroy tun device (created by ssh -w)?

Reply
Thread Tools Display Modes

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

 
 
Andrew Gideon
Guest
Posts: n/a

 
      04-03-2008, 06:32 PM

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
 
Reply With Quote
 
 
 
 
Pascal Hambourg
Guest
Posts: n/a

 
      04-04-2008, 10:16 AM
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.
 
Reply With Quote
 
Jurgen Haan
Guest
Posts: n/a

 
      04-04-2008, 12:51 PM
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'
 
Reply With Quote
 
Andrew Gideon
Guest
Posts: n/a

 
      04-04-2008, 11:36 PM
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
 
Reply With Quote
 
Andrew Gideon
Guest
Posts: n/a

 
      04-04-2008, 11:41 PM
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
 
Reply With Quote
 
Andrew Gideon
Guest
Posts: n/a

 
      04-07-2008, 05:40 PM
On Fri, 04 Apr 2008 23:36:27 +0000, Andrew Gideon 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>.


Ugh. The sshd was still running. I'd missed that, though in looking
again I see it very clearly in the ps output. <Sigh>

Thanks again...

Andrew
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When is ppp0 created? morleyc@gmail.com Linux Networking 1 07-01-2007 10:55 PM
created 2nd network, can't get rid of it Kram Wireless Networks 6 01-04-2007 03:00 AM
Internet Gateway device created in Network Connections when I removed Internet Connection Sharing Martin Underwood Home Networking 2 04-07-2005 12:56 PM
Are all microfilters created equal news@jbrand.clara.co.uk Broadband 6 09-29-2004 04:06 PM
My documents folder: unable to destroy contents Rafael Block Windows Networking 1 07-24-2004 01:46 PM



1 2 3 4 5 6 7 8 9 10 11