Home
About Me!
Projects
Research
Links
Gallery
Travel
   
Random Header Image
Disable Enable
More Info



OpenVPN Install on Gentoo

Overview:
Installation of OpenVPN on Gentoo Linux. Shown below are the notes I made when installing OpenVPN

Notes:
USE="examples" emerge openvpn

* WARNING: The openvpn init script has changed
*
* The openvpn init script expects to find the configuration file
* openvpn.conf in /etc/openvpn along with any extra files it may need.
*
* To create more VPNs, simply create a new .conf file for it and
* then create a symlink to the openvpn init script from a link called
* openvpn.newconfname - like so
* cd /etc/openvpn
* foo.conf
* cd /etc/init.d
* ln -s openvpn openvpn.foo
*
* You can then treat openvpn.foo as any other service, so you can
* stop one vpn and start another if you need to.
*
* plugins have been installed into /usr/lib/openvpn
*
* It is recommended that you create your tun/tap interfaces using
* the net.tun0/net.tap0 scripts provided by baselayout instead of
* using the 'server' directive in openvpn configuration files.
* This will insure that the interface really is up after openvpn
* starts.
* Note that you cannot use net.tun0/net.tap0 and the server option,
* otherwise openvpn will not start.

cp -R easy-rsa/ /etc/openvpn/easy-rsa
cd /etc/openvpn/easy-rsa
edit the vars file and set the KEY_COUNTRY, KEY_PROVINCE, KEY_CITY, KEY_ORG, and KEY_EMAIL parameters.
. ./vars
./clean-all
./build-ca
./build-key-server server
./build-key client1
./build-dh

cd /etc/openvpn
cp -R easy-rsa/keys/ ./

write config file and place at /etc/openvpn/server.conf

test by: openvpn server.conf
if you get error:
Cannot open TUN/TAP dev /dev/net/tun
You need to compile "Universal TUN/TAP device driver support" and/or "802.1d Ethernet Bridging" in your kernel.
See: http://gentoo-wiki.com/HOWTO_Road_Warriors_with_OpenVPN

enable IP forwarding:
emerge iptables
/etc/sysctl.conf and set net.ipv4.ip_forward = 1

create symlink /etc/init.d/openvpn.server -> openvpn
for starting and stopping the service

logs go into /var/log/messages