16

I have multiple VPN server software running on the same server, two of them (tinc and openvpn) are using the same /dev/net/tun devices and spawning a tunX iface.

The later started ones will use tun devices from zero, so they're reusing each other's device and causing a lot of problems and disruption of services.

My question is, is it possible to let OpenVPN to spawn its own tun with other names like tun-X or otun-Y etc?

slm
  • 369,824
Quan Zhou
  • 163

1 Answers1

21

Yes, you can use the dev option to specify which device you want to use. You'll also have to add dev-type to specify tun or tap:

dev ovpn-tcp
dev-type tun

Will use a tun device named ovpn-tcp, giving you:

$ ip link ls ovpn-tcp
7: ovpn-tcp: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 100
    link/none 

This is quite useful—far easier to hang, e.g., iptables rules off of known device names.

derobert
  • 109,670