Hello guys, I am running an OpenVPN server on a KVM-based virtual system for a number of clients and, for many complicated reasons, I would like to have this system connect to another (external) OpenVPN server, so that my client's traffic passes my virtual system and the external VPN on the way to the world wide web. As the external VPN server is also running OpenVPN, I figured my virtual system could simply act as a go-between, being an OpenVPN client of the external VPN provider and an OpenVPN server for my clients. But when I tried to set this up, the devices of the OpenVPN instances seemed to interfere with each other.
Essentially, the set-up I want is this: clients --> [my system] --> vpn service provider. I was hoping somebody more knowledgeable than me may be able to offer advice on how to go about setting this up.
server.conf for OpenVPN server on virtual system (where my clients connect to)
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
tls-auth ta.key 0
server 10.8.0.0 255.255.255.0
tls-server
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
ping-timer-rem
cipher BF-CBC
comp-lzo
user ovusr
group ovusr
persist-key
persist-tun
status openvpn-status.log
verb 3
connect.conf for OpenVPN client on virtual system (to connect to external VPN provider)
client
dev tun0
proto udp
remote <host> 1194
resolv-retry infinite
nobind
auth-user-pass
ca [inline]
tls-client
tls-auth [inline]
ns-cert-type server
keepalive 10 30
cipher AES-256-CBC
tls-cipher TLSv1:!ADH:!SSLv2:!NULL:!EXPORT:!DES:!LOW:!MEDIUM:@STRENGTH
persist-key
persist-tun
comp-lzo
tun-mtu 1500
mssfix
passtos
verb 3
<ca>
-----BEGIN CERTIFICATE-----
<cert here>
-----END CERTIFICATE-----
</ca>
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
<keyhere>
-----END OpenVPN Static key V1-----
</tls-auth>
On the virtual system, when connecting to the VPN service provider as root, using "openvpn ~/connect.conf", the connection parameters seem to be set up fine at first, until eventually the connection fails with the following message:
Cannot open TUN/TAP dev /dev/tun0: No such file or directory (errno=2)
How would I have to modify the devices to be able to connect to the VPN provider, but at the same time keep the server running, so that my clients can still connect?