Re: [Openvpn-users] Can I preserve the tun device from being deleted on the client side after the connection was closed or the server side is unavailable?

2016-10-16 Thread Hongyi Zhao
2016-10-17 3:27 GMT+08:00 David Sommerseth :
> On 15/10/16 15:34, Gert Doering wrote:
>> Hi,
>>
>> On Sat, Oct 15, 2016 at 08:47:38PM +0800, Hongyi Zhao wrote:
> Can I preserve the tun device from being deleted on the client side after
> the connection was closed or the server side is unavailable?

 Depends on the operating system used, but generally yes.
>>>
>>> I use Debian and always find that the tun device will be deleted
>>> automatically after the server side is down/unavailable/closed.
>>>
>>> So, how can I preserve that tun device for my case?
>>
>> precreate:
>>
>> $ openvpn --mktun tun4
>>
>> and then use that
>>
>> $ openvpn --dev tun4 ...
>>
>> (on BSDs, one would do "ifconfig tun4 create", but Linux' ifconfig cannot
>> do that)
>
> openvpn --mktun is the "light weight" approach which works quite well on
> Linux, especially when you want to use it for OpenVPN tasks.
>
> Otherwise there is tunctl which can be used to create tun/tap devices
> which can also set a few more advanced options, which generally do not
> make much of a difference for OpenVPN configurations.

Thanks for letting me know this tool.

Regards

>
>
> --
> kind regards,
>
> David Sommerseth
>



-- 
Hongyi Zhao 
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] Can I preserve the tun device from being deleted on the client side after the connection was closed or the server side is unavailable?

2016-10-16 Thread Hongyi Zhao
2016-10-16 23:08 GMT+08:00 Selva Nair :
>
> On Sun, Oct 16, 2016 at 9:45 AM, Hongyi Zhao  wrote:
>>
>>
>> But I find another issue: when the vpn connection is down on this
>> device, the tun device created by the above method can only be listed
>> by using `ip link' command, while the `ifconfig ' will not list this
>> device.
>
>
> ifconfig needs -a to list devices that are down.

Thanks, yes.

Regards

>
> Selva



-- 
Hongyi Zhao 
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] Can I preserve the tun device from being deleted on the client side after the connection was closed or the server side is unavailable?

2016-10-16 Thread David Sommerseth
On 15/10/16 15:34, Gert Doering wrote:
> Hi,
> 
> On Sat, Oct 15, 2016 at 08:47:38PM +0800, Hongyi Zhao wrote:
 Can I preserve the tun device from being deleted on the client side after
 the connection was closed or the server side is unavailable?
>>>
>>> Depends on the operating system used, but generally yes.
>>
>> I use Debian and always find that the tun device will be deleted
>> automatically after the server side is down/unavailable/closed.
>>
>> So, how can I preserve that tun device for my case?
> 
> precreate: 
> 
> $ openvpn --mktun tun4
> 
> and then use that
> 
> $ openvpn --dev tun4 ...
> 
> (on BSDs, one would do "ifconfig tun4 create", but Linux' ifconfig cannot
> do that)

openvpn --mktun is the "light weight" approach which works quite well on
Linux, especially when you want to use it for OpenVPN tasks.

Otherwise there is tunctl which can be used to create tun/tap devices
which can also set a few more advanced options, which generally do not
make much of a difference for OpenVPN configurations.


--
kind regards,

David Sommerseth



signature.asc
Description: OpenPGP digital signature
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] Can I preserve the tun device from being deleted on the client side after the connection was closed or the server side is unavailable?

2016-10-16 Thread Selva Nair
On Sun, Oct 16, 2016 at 9:45 AM, Hongyi Zhao  wrote:

>
> But I find another issue: when the vpn connection is down on this
> device, the tun device created by the above method can only be listed
> by using `ip link' command, while the `ifconfig ' will not list this
> device.


ifconfig needs -a to list devices that are down.

Selva
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] Can I preserve the tun device from being deleted on the client side after the connection was closed or the server side is unavailable?

2016-10-16 Thread Gert Doering
Hi,

On Sun, Oct 16, 2016 at 09:45:38PM +0800, Hongyi Zhao wrote:
> > precreate:
> >
> > $ openvpn --mktun tun4
> 
> I tried it, it seems the command should be something as follows:
> 
> $ sudo openvpn --mktun --dev tun4

Apologies - yes, that's the correct way.

> Thanks, it does the trick.

Good :-)

> But I find another issue: when the vpn connection is down on this
> device, the tun device created by the above method can only be listed
> by using `ip link' command, while the `ifconfig ' will not list this
> device.
> 
> When the device is up/ in-using, both the `ip link' and the `ifconfig
> ' will list this device.
> 
> Why this happen?

I can't answer this one - "ifconfig" has always been a strange beast,
and I prefer to use "ip" for everything on linux...

gert

-- 
USENET is *not* the non-clickable part of WWW!
   //www.muc.de/~gert/
Gert Doering - Munich, Germany g...@greenie.muc.de
fax: +49-89-35655025g...@net.informatik.tu-muenchen.de


signature.asc
Description: PGP signature
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] Can I preserve the tun device from being deleted on the client side after the connection was closed or the server side is unavailable?

2016-10-16 Thread Hongyi Zhao
2016-10-15 21:34 GMT+08:00 Gert Doering :
> Hi,
>
> On Sat, Oct 15, 2016 at 08:47:38PM +0800, Hongyi Zhao wrote:
>> >> Can I preserve the tun device from being deleted on the client side after
>> >> the connection was closed or the server side is unavailable?
>> >
>> > Depends on the operating system used, but generally yes.
>>
>> I use Debian and always find that the tun device will be deleted
>> automatically after the server side is down/unavailable/closed.
>>
>> So, how can I preserve that tun device for my case?
>
> precreate:
>
> $ openvpn --mktun tun4

I tried it, it seems the command should be something as follows:

$ sudo openvpn --mktun --dev tun4

>
> and then use that
>
> $ openvpn --dev tun4 ...

Thanks, it does the trick.

But I find another issue: when the vpn connection is down on this
device, the tun device created by the above method can only be listed
by using `ip link' command, while the `ifconfig ' will not list this
device.

When the device is up/ in-using, both the `ip link' and the `ifconfig
' will list this device.

Why this happen?

Regards

>
> (on BSDs, one would do "ifconfig tun4 create", but Linux' ifconfig cannot
> do that)
>
> gert
> --
> USENET is *not* the non-clickable part of WWW!
>//www.muc.de/~gert/
> Gert Doering - Munich, Germany g...@greenie.muc.de
> fax: +49-89-35655025g...@net.informatik.tu-muenchen.de



-- 
Hongyi Zhao 
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] Can I preserve the tun device from being deleted on the client side after the connection was closed or the server side is unavailable?

2016-10-15 Thread Gert Doering
Hi,

On Sat, Oct 15, 2016 at 08:47:38PM +0800, Hongyi Zhao wrote:
> >> Can I preserve the tun device from being deleted on the client side after
> >> the connection was closed or the server side is unavailable?
> >
> > Depends on the operating system used, but generally yes.
> 
> I use Debian and always find that the tun device will be deleted
> automatically after the server side is down/unavailable/closed.
> 
> So, how can I preserve that tun device for my case?

precreate: 

$ openvpn --mktun tun4

and then use that

$ openvpn --dev tun4 ...

(on BSDs, one would do "ifconfig tun4 create", but Linux' ifconfig cannot
do that)

gert
-- 
USENET is *not* the non-clickable part of WWW!
   //www.muc.de/~gert/
Gert Doering - Munich, Germany g...@greenie.muc.de
fax: +49-89-35655025g...@net.informatik.tu-muenchen.de


signature.asc
Description: PGP signature
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] Can I preserve the tun device from being deleted on the client side after the connection was closed or the server side is unavailable?

2016-10-15 Thread Hongyi Zhao
2016-10-15 19:58 GMT+08:00 Gert Doering :
> Hi,
>
> On Sat, Oct 15, 2016 at 06:55:57PM +0800, Hongyi Zhao wrote:
>> Can I preserve the tun device from being deleted on the client side after
>> the connection was closed or the server side is unavailable?
>
> Depends on the operating system used, but generally yes.

I use Debian and always find that the tun device will be deleted
automatically after the server side is down/unavailable/closed.

So, how can I preserve that tun device for my case?

Regards

>
> gert
> --
> USENET is *not* the non-clickable part of WWW!
>//www.muc.de/~gert/
> Gert Doering - Munich, Germany g...@greenie.muc.de
> fax: +49-89-35655025g...@net.informatik.tu-muenchen.de



-- 
Hongyi Zhao 
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


Re: [Openvpn-users] Can I preserve the tun device from being deleted on the client side after the connection was closed or the server side is unavailable?

2016-10-15 Thread Gert Doering
Hi,

On Sat, Oct 15, 2016 at 06:55:57PM +0800, Hongyi Zhao wrote:
> Can I preserve the tun device from being deleted on the client side after
> the connection was closed or the server side is unavailable?

Depends on the operating system used, but generally yes.

gert
-- 
USENET is *not* the non-clickable part of WWW!
   //www.muc.de/~gert/
Gert Doering - Munich, Germany g...@greenie.muc.de
fax: +49-89-35655025g...@net.informatik.tu-muenchen.de


signature.asc
Description: PGP signature
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users


[Openvpn-users] Can I preserve the tun device from being deleted on the client side after the connection was closed or the server side is unavailable?

2016-10-15 Thread Hongyi Zhao
Hi all,

Can I preserve the tun device from being deleted on the client side after
the connection was closed or the server side is unavailable?

Regards
-- 
Hongyi Zhao 
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Openvpn-users mailing list
Openvpn-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-users