How I got a OpenVNP connection with Kvpnc (version 0.9.3) using KDE 4.3.5 on Kubuntu 9.10 (Karmic)
This is what I have installed:
- openvpn (network-manager-openvpn)
You don't need 'network-manager-gnome'
I have a folder in my homedir with all the files I got from my admin.
Start kvpnc using kdesudo:
- Run 'New profile (Wizard)'
- Select OpenVPN as the type of VPN -> Next
- Make sure the 'Import OpenVPN config file' is checked -> Next
- Find your *.ovpn file -> OK -> OK (if import was successful - if not I cannot help)
- Type in username and password -> Next -> Next (I leave default Connection status check settings) -> Next
- Keep 'Connect after creating a new profile' unchecked, connection at this point will not work -> Next
- Give your profile a meaningful name and description. Keep the gateway -> Next -> Finish
Next we need to set some paths and commands to be executed. Go to 'Manage profiles'.
In the section 'Certificate' (a subsection to 'Authenticate'), we need to add paths, though the files are already there.
- Locate the certificate (.crt file)
- Set the path to the certificates - I have all mine in a subdir to my home dir
- Locate the CA.crt file
- Locate the private key (.key file)
I have found that I need to disable my firewall before connecting:
Go to 'Manage Profiles'
In the section 'Command Execution' I have in the 'Before Connect':
iptables-save > /root/firewall.rules
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
This saves my iptables, and disables my firewall.
In the 'After Connect' I restore my firewall:
iptables-restore < /root/firewall.rules
Close 'Manage Profiles'.
You should now be able to connect (at least I am).
Ping the proxy to make sure the connection is there and is useful.
ISSUE: It seems that the connection is not closed properly, when one disconnects from the VPN. I go around this issue by disconnecting, and then quitting kvpnc.
I have had no need for this information, but OpenVPN apparently uses port UDP 5000.
It irritated me always having to type kdesudo kvpnc, so I made a small bash file called kvpnc which calls the real kvpnc bin file with kdesudo. Here's howto:
Open a new text file
Copy and paste:
# Start Kvpnc with kdesudo
Save it somewhere which is in your path (look somewhere else for help if you are not sure what this means) with the name kvpnc, and make is executable with
Now, when you run kvpnc, you should be prompted for a password by kdesudo, and the real kvpnc should then run with superuser privileges.