Helpful hints on connecting to Cisco VPN on Ubuntu Hardy Heron


The Long Story

You can get to the Short Story by scrolling down

After getting a new wireless router and moving my desktop PC (running Windows XP) upstairs to the hallway, I went to work getting my VPN connection to SnagAJob.com up and working again. My plan was to try it out from the desktop PC (which worked when it was directly connected to the cable modem) and ensure that the VPN connection worked over the wireless network. Afterwards, I would then try to get a the Cisco VPN client working on my laptop, which is running Ubuntu (v8.04).

I was completely unsuccessful in getting my XP box to connect to the VPN client. The client would attempt to initialize the connection but would fail each time. The obvious culprit must have been the router. I am using the Netgear WPN824v3 Rangemax router. I tried changing the following settings on the router but with no success:

  • turned off the SPI (stateful packet inspection) firewall

  • turned off NAT filtering

  • turned on “respond to ping requests from the internet”

  • turned on port forwarding that are relevant for my type of VPN connection.

After a few hours of increasing frustrating results and feeling strangely exposed to the bad boys on the internet, I let things idle for a while. A couple days later, I attempted to connect to the VPN using my laptop. I wanted to use the Cisco VPN client and found the following instructions (http://www.longren.org/2007/05/17/how-to-cisco-vpn-client-on-ubuntu-704-feisty-fawn/). However, the instructions make clear that the client would not work on my version of the Linux kernel.

Feeling dejected and alone (and still exposed), I searched for other VPN clients that would work. Very quickly, I found that KVpnc (http://home.gna.org/kvpnc/en/index.html) may work. I installed that and then installed the free Cisco client, vpnc (http://www.unix-ag.uni-kl.de/~massar/vpnc/) using the Synaptic Package Manager. I fired up KVpnc and imported the Cisco client profile for my VPN connection (*.pcf). I selected the imported profile and went to connect. Success! I then started dialing back all the router changes I made and testing connectivity after each change. Each time, I was successful in connecting.

Next on the list was to remote desktop into my work machine so I could access my dev environment. I fired up rdesktop and tried to connect to my work machine over port 3389. I had no luck. After a little more searching, I found that the tsclient program was better suited for my needs. I fired that up and entered the relevant info. I experimented with different resolution sizes, but ended up selecting the full screen option. I was able to remote into my work PC. However, I had no way to get back to my local desktop. Tsclient does not have a toolbar like the Windows version does. I could log off my work PC to end the session but I like to toggle from local to remote a lot during a work day. After more searching, I found that Ctrl+Alt+enter should toggle me back to my local PC. I did this and the screen flickered to the local workspace and then went back to the remote PC. After more searching (as an aside, I would be a complete idiot without Google search – I need a direct neural interface to their search engine) I found that this behavior was due to a bug in rdesktop. It appeared to revolve around the Desktop Effects feature that makes things “pretty”. There were a multitude of workarounds suggested but after reviewing these, it seemed the most practical solution was to just turn off desktop effects altogether. Just like I want my coffee black, I like having a desktop that is “effect free” I kept the OS default desktop effect option up until now since it did not appear to impact system performance, but this rdesktop bug was a great excuse to turn the effects off. After turning the Desktop effects off, I was able to use the Ctrl+Alt+Enter key combo to toggle from local to remote. Finally!

I still have not had success in getting my XP desktop to connect to my work VPN.  I am giving up on that box since my laptop now works.

The Short Story

To connect to a Cisco VPN from Ubuntu 8.04 (note that there are different Cisco VPN configs out there. These steps worked for me but mileage may vary).

Environment

  • Ubuntu 8.04 (Hardy Heron) on local machine
  • Windows 2003 server on remote machine
  • Wireless network with Netgear WPN824v3 Rangemax router – default router options
  • Cisco VPN (unsure of exact type used at work)
  • Already have a known Cisco client profile that works in XP (when directly connected to local cable modem)

Assumptions

You know how to install applications on Ubuntu using the Synaptic package manager or the Applications → Add/Remove feature. If not, see

Steps used to connect to VPN

  1. Open up first bottle of Sam Adams, take small swig
  2. Install KVpnc using the Synaptic package manager or using the Applications → Add/remove feature
  3. Copy your Cisco client profile from your Windows box to a directory on your Ubuntu installation
  4. Run KVpnc (should be located at Applications → Internet) and select Profile → Import Cisco pcf file. Navigate to the location where you stored the pcf file and select it. Click OK.
  5. Install vpnc using the Synaptic package manager or using the Applications → Add/remove feature
  6. In KVpnc, go to Settings → configure kvpnc and select “Daemons” under “Programs”.
  7. Check that the path used for vpnc is correct and that it points to where the vpnc program was installed to. Once you are set, click OK.
  8. Get another beer.
  9. On the main kvpnc window, you should see a Profile dropdown that has the name of the profile you imported. Select that profile and click Connect.

You should now be connected.

If you want to remote desktop into a another PC follow the following steps:

  1. Go to System → Preferences → Appearance
  2. Go to the Visual effects tab and select “None”. Click Close.
    1. If you really are attached to the visual effects used in Ubuntu, you can try the workarounds located at https://bugs.launchpad.net/ubuntu/+source/rdesktop/+bug/153995. I have not tried them and do not know if they work.
  3. Run tsclient (Applications → Internet → Terminal Server Client)
  4. Click the Display tab.
  5. Select “Operate in full screen mode”
    1. Note: you can select your own resolution as well here. The default was 800×600 but that just doesn’t fly with me.
    2. Note 2: Do not click “use alternate full screen switch”. It added an invalid command to the command list for rdesktop and hosed the connection attempt
  6. Go back to the General tab and enter the computer name and your user name and password. You can save this info via the “Save As” button. Once you do this, the profile will be available under the “Quick Connect” dropdown
  7. Click Connect
  8. Get the nachos and another beer if you are so inclined.
  9. Sit back back down and wonder if the ability to log back into work from home is such a good thing after all.

Day 1: Moving to Linux

Intro

When it was time to get a new laptop, the decision I have been putting off for a while now needed to be made.  Do I move to Vista or jump over to Linux.  Up until now, I was the proverbial Charlton Heston:  you can pry XP from my cold dead hands.  My main PC had so much Windows specific baggage that a full jump to Linux would have been too disruptive.  In addition, I don’t have a lot of resources left to support a dual boot set up.  However, with a new laptop to order, all that baggage did not exist.  I ultimately decided to make the move to Ubuntu but I wussed out and still ordered the laptop with XP Home on it.  The idea was to make a dual boot system so that I could use Ubuntu for my main work but keep XP on the side for a failsafe.

Ordering the laptop

The biggest fear I had was that I would order hardware that was incompatible with Ubuntu or other Linix distributions.  Dell has an Ubuntu site that I used for reference.  I built a laptop from that site and used that to drive the specs for the laptop with XP I wanted to get.  The only change I needed to make to the laptop specs was the wireless card.  I needed to upgrade the card to match what was spec’d on the Ubuntu laptop from Dell.  A couple google searches confirmed that the default card that came with the XP 1520 laptop would have issues in Ubuntu.  After making that change, I ordered the laptop.  After getting over the disappointment that the laptop would not just simply materialize after I clicked “Confirm Order”, I waited.  In turns out that perhaps Dell follows the Scotty Principle.  My laptop arrived 3 days earlier than they estimated.

Prep for the install

After getting the laptop, I ran it through its paces on the XP side just to make sure all was well.  Once that was complete, I needed to burn an Ubuntu install disk.  Ubuntu’s instructions for this were very clear and made no assumptions on the technical savviness of the user.

Install

Once the disk was ready, I popped it into the laptop and turned it back on.  The laptop’s boot sequence had the CD drive listed second so I needed to interrupt the boot and choose to boot from the CD.  Once this was done, the graphical install kicked in and Ivwas on my way.  I partitioned my hard drive to account for the fact that I wanted a dual boot system.  The install was basically hands off.  I was able to do the install, watch my 3 year old and get dinner going at the same time.

Did it work?

I rebooted the laptop to see what would happen.  I expected a boot menu to come up so I could choose the OS I wanted to use.  It did come up and I went into Ubuntu.  It came up fine.  Wireless connectivity worked.  Since it is a new laptop with no baggage, there was not a lot of extra config/installs that I needed to worry about.  My laptop has an embedded webcam as well but I have not tried that as of yet.

First application install

As my kids watched a movie, I moved on to the important stuff:  how to get back into Twitterland.  I use twhirl on my Windows boxes for a client but they don’t have a version for Ubuntu due to Adobe Air.  I searched and found some other clients that would work and I downloaded the app called gTwitter.

Here is where I hit my first roadblock.  How to install?  I am a lifelong Windows user.  I was focused on installing and did not realize that the menu option Applications –> Add/remove existed.  I did another help search and found another helpful article  that explained in detail why I was overthinking things. I did a quick search from the Add/remove window on the term “twitter” and up popped gTwitter.  I selected it and installed it with no issue.  Now I can get my tweet fixes.

Day 1 conclusions/thoughts

  1. Ubuntu is very easy to install and there are helpful instructions all over the place.
  2. I would have had hardware issues if I did not start with the end in mind when ordering the laptop
  3. I have found a way to avoid Vista for home use.  I think I danced a little jig when all went well with this install.
  4. My kids don’t know how to react when they see their dad dance a little jig.
  5. Twitter is worse than crack
  6. twhirl is my crack pipe of choice.  Adobe Air has an alpha version (one guy’s results)that will run on Ubuntu so that is next on the list to install.