Hi,

On Mon, Dec 17, 2012 at 12:31:33AM -0800, ehsan enayati wrote:
> I need to run multiple instances of OpenVPN server on just one tun device 
> driver (say tun0) all on same subnets. I tried editing the open_tun function 
> in tun.c file, first instance goes well and creates tun0 but when the second 
> one comes along it cannot use tun0 and I get the error "ioctl(TUNSETIFF):
> Device or resource busy ". I really need this functionality. Please give me 
> some hints.

There is no way to do this, as the tun device is exclusive-open - only
a single process can open it (in theory, you might be able to open() it
and then fork, sharing the file descriptor between all childs, but then
you have the problem of ensuring that the "right" process gets the packets
sent from the kernel to tun0, and there is no way to influence that).

Maybe you can explain to us what you want to achieve, and then we can 
see how it can be done (if at all).

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-35655025                        g...@net.informatik.tu-muenchen.de

Attachment: pgpA2AO_YBxS9.pgp
Description: PGP signature

Reply via email to