__Using CentOS VPNC, OpenVPN and Network Manager to get VPN services__
First enable EPEL repo using one of these links:
* [[http://wiki.centos.org/AdditionalResources/Repositories]]
* [[http://www.ctkn.net/tag/enable-epel-centos-6/]]
* [[http://johnpoelstra.com/2010/12/23/rhel-6-epel/]]
* [[http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F]]
epel.repo goes into /etc/yum.repos.d/ - something similar to this:
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
Then:
yum -y install NetworkManager*
yum -y install *vpn*
yum -y install openconnect*
Then go to network manager or right-click the network icon in the task bar and add a new connection, VPN.
Enter all the appropriate settings as given by work and then __reboot the machine__ otherwise your configuration will not save and you will get an error "no valid VPN secrets".
----
To connect to a Cisco AnyConnect VPN server, use openconnect as listed above. Reboot the computer after installing the VPN packages and set up the connection entering the IP address for the Gateway.
----
The ntpd service may not be able to connect to time servers; remember to update /etc/ntp.conf and possible /etc/ntp/step-tickers with time sources that are reachable when the machine has the VPN connected.
----
[[http://www.debuntu.org/how-to-connect-to-a-cisco-vpn-with-vpnc/ Cisco VPN with VPNC (Ubuntu and Debian)]]
----
Notes from Scalio:
* Install the vpnc rpm and any dependencies, if not already installed.
* As root, use visudo to add the following entries to the sudoers file without the surrounding "<>":
ALL=(root) NOPASSWD: /usr/sbin/vpnc
ALL=(root) NOPASSWD: /usr/sbin/vpnc-disconnect
* As root, create a vpn configuration file (I called mine myvpn.conf) in /etc/vpnc containing the following:
IPSec gateway XXX.XXX.XXX.XXX
IPSec ID XXX
IPSec secret XXXXXXXXX
Xauth username
Xauth password
* Change file permissions on your vpnc configuration file to 600.
* Copy the two attached files to some place in your path. I put them in ~/bin. Make sure you they both have execute permission.
* Use the scripts to start/stop VPN sessions. I use this from inside a VirtualBox Linux guest. Occasionally, your vpn sessions will terminate without any notification. If you aren't getting a response from an established session, you can just do "start_vpnc" again and you shouldn't even get kicked out of any remote terminal sessions you have running.
#!/bin/bash
# start_vpnc.bash
sudo /usr/sbin/vpnc --natt-mode cisco-udp myvpn
#!/bin/bash
# stop_vpnc.bash
sudo /usr/sbin/vpnc-disconnect
----
Old Notes that do not appear to be needed:
http://wiki.centos.org/HowTos/vpnc
* had to manually download http://pkgs.repoforge.org/vpnc/vpnc-0.5.3-1.el5.rf.i386.rpm since it's a RHEL5 package \\
* installs but will connect; firewall issue? \\
* try [[http://www.zeroshell.net/eng/openvpn-client/#OpenVPN-GUI-Linux]] and/or [[http://kde-apps.org/content/show.php?content=12570]] \\
* [[http://pkgs.repoforge.org/kvpnc/]]