On 17/12/12 09:31, ehsan enayati wrote: > Hi, > 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.
It is not possible to do what you try to do. Only one application can bind to a tun or tap socket. It's basically the same issue if you try to have more applications bind and listen to, say port 80, at the same time. It's impossible. And it's restricted by the OS. If you need OpenVPN instances to be on the same subnet, you can use TAP and bridge tap0 and tap1 together. *But* I 'd rather recommend to use tun devices, have them on separate subnets and do the rest with routing. Using tun + routing is by far the cleanest and easiest configuration setups. It also gives the lowest traffic overhead and least headache while debugging the configuration when it fails. -- kind regards, David Sommerseth
signature.asc
Description: OpenPGP digital signature