Installing VPNC

VPNC is found in many of the distributions’ package managements systems.  So before scouring after the source, try searching your package repositories.  If downloading the source is inevitable, the install is quite simple:

  1. `$make && su -c “make install”` or `$make && sudo make install` (for sudoers).
  2. Be sure the tun/tap device driver is built into your kernel (vpnc will tell you if it isn’t when you first run vpnc).

Configuring VPNC

Edit the configuration file:

#Interface name tun0
IPSec gateway 199.17.118.250
IPSec ID wireless
IPSec secret XXXXXXXXXXXXXXX
Xauth username (Your DragonMail UserName)
[Xauth password (Your DragonMail Password)]

Only use the password line if you don’t want to have to type your password every time.  Please, e-mail your name and dragonID to Alex Brandt to get the password that goes in the `IPSec secret` line  (Thanks to Conor Shenk for getting the password decrypted).

If you decide to include your password in the configuration file, then take the necessary precautions (e.g. `chmod 600 /etc/vpnc.conf`).

Checking Functionality

Now with everything properly configured and installed,  all you need to do is (as root for now) run `vpnc`.   If it works, congratulations, continue reading to learn how to customize it so certain users can run vpnc without becoming root. If it did not work try going through the steps again and experiment a little.  The first place you should check is the vpnc homepage.

Adding Convenience

Autostarting VPNC

If you want vpnc to start every time you start your computer, put it in your `rc.local` file.  This is located in different places based on the distribution you are running; so, please, consult the documentation for your distribution if you don’t know where it is. You will also want to add `vpnc-disconnect` to your shutdown scripts (this isn’t required, but is good practice).

Unprivileged VPNC with Sudo

If you want to allow a user to connect to the network, but not use a startup script; I recommend installing sudo to handle the security.  Using the `visudo` editor (I know how much some people like vim, but there is a tutor available by running `vimtutor`).  Now, just add this line to your sudoers file (using our handy visudo):

username    hostname    =   NOPASSWD:/usr/bin/vpnc,/usr/bin/vpnc-disconnect

Now, your specified user can start the vpn client with the following statement: `sudo vpnc`, and stop it with `sudo vpnc-disconnect`.

Aliasing VPNC

Using aliases can make your life even easier. The user can add the following lines to his `~/.bashrc` file to simplify commands requiring the school’s network.

alias vpnc="sudo vpnc"
alias vpnc-disconnect="sudo vpnc-disconnect"
alias program="sudo vpnc && program && sudo vpnc-disconnect"

This last one is invaluable if you need to log into the network for a specific program’s license or whatnot, but use your imagination and you can make your computing experience as easy as you like.

Alex Brandt

An avid Linux user for many years (since 2004). Have moved through Fedora, Slackware, and finally settled on Gentoo as a distribution of choice. Hacking Gentoo and other software as well as playing bass pass the time and add a flair of fun.

Sorry, the comment form is closed at this time.

 
© 2011 Alunduil's Hosting Suffusion theme by Sayontan Sinha