Networking Forums

Networking Forums > Computer Networking > Linux Networking > Newbie Help with Linux VPN and OpenSwan.

Reply
Thread Tools Display Modes

Newbie Help with Linux VPN and OpenSwan.

 
 
Google Mike
Guest
Posts: n/a

 
      03-02-2005, 03:35 AM
I have installed OpenSwan and 2.4 kernel for this on RH9. It's loading
properly without error. Now I just need to edit the conf files so that
I can VPN. Do you know how to edit ipsec.conf and ipsec.secrets?

Or, if I can get my W2K box to VPN through this configuration, can I
use my Linux box to "step" onto that connection and utilize the W2K VPN
connection?

My configuration would be this:

workstation -> NAT Router -> DSL Modem -> DSL Gateway -> Corporate VPN
Gateway

I use an RSA SecurID Keyfob that spits out a new 6 digit number every
10 seconds. When prompted to login (at least on Windows), I take my
username of "gmike" and my passcode "4430" + SecurID number. This
connects me to the Corporate VPN Gateway and I'm running inside of
Windows. Now I just need to understand how this would work under Linux.

My workstation sits at static IP 192.168.123.10. I have a fixed mapping
with my NAT Router for that. My NAT Router sits at 192.168.123.254. My
DSL Modem is PPPoE Verizon and it gives the NAT router this info:

IP Address 69.228.117.9 PPPoE
Subnet Mask 255.255.255.255
DSL Gateway 69.228.117.9
DSL Domain Name Server 69.228.113.12

My Corporate VPN Gateway (changed here, of course) is:

198.226.212.30

So, making some wild-a** guesses, here, I guess my /etc/ipsec.conf
might look like:

# /etc/ipsec.conf - Openswan IPsec configuration file

# basic configuration
config setup
# THIS SETTING MUST BE CORRECT or almost nothing will work;
# %defaultroute is okay for most simple cases.
interfaces=%defaultroute
# Debug-logging controls: "none" for (almost) none, "all" for lots.
klipsdebug=none
plutodebug=none
# Use auto= parameters in conn descriptions to control startup
actions.
plutoload=%search
plutostart=%search
# Don't wait for pluto to complete every plutostart before continuing
plutowait=no
# Close down old connection when new one using same ID shows up.
uniqueids=yes
# Enable NAT-Traversal
#nat_traversal=yes
# RFC1918 networks
#virtual_private=%v4:10.0.0.0/8,%v4:172.16.0.0/12,%v4:192.168.0.0/16

# Defaults for all connection descriptions
conn %default
keyingtries=0
disablearrivalcheck=no
dpdaction=hold
dpddelay=30
dpdtimeout=120
leftrsasigkey=%dnsondemand
rightrsasigkey=%dnsondemand
authby=rsasig
auto=add

conn sample
left=192.168.123.10
leftnexthop=192.168.123.254
leftsubnet=192.168.123.0/24
right=69.228.117.9
rightnexthop=198.226.212.30
rightsubnet=198.226.212.0/24
auto=start

 
Reply With Quote
 
 
 
 
Google Mike
Guest
Posts: n/a

 
      03-02-2005, 06:52 AM
I finally got this going, and with a pure Linux solution, mind you, but
I had to go 90 degrees in another direction.

First, I'd like to undo some of the posts I've seen regarding some
hardware that I also happen to have too -- the USR 8000A-02. This NAT
router and firewall, in addition to Verizon DSL, can still work with
Linux over VPN without issue. I managed to get it working. Others may
claim it cannot, but I claim that it can and I was able to get on my
office resources.

Note that in my case, my office used an RSA SecureID keyfob with the
VPN. In your case, you may not. These intructions below are for a Cisco
3000 connection with RSA SecurID keyfob and Linux.

To begin, you're going to need the 2.4 kernel, and the latest one at
that. You can get this with apt if you have installed it and have
learned to use it. (Speaking to you newbies (like me) out there.) You
might be able to get this going with the 2.6 kernel, but you'll
probably need a special version of the Linux Cisco driver. That's what
I read.

Okay, so once you are booted on the 2.4 kernel, go to some search
engine and download a file that begins with this in the name:

vpnclient-linux

You may see it as vpnclient-linux-distro-version.tar.gz, or perhaps
just vpnclient-linux.tar.gz. Find the one that works best for you.

Once you expand this into a directory, do this as root:

../vpn_install

It should prompt you a bunch of things and the defaults will likely
work if you are running at least the 2.4 kernel. If you're running
something else, you'll need a completely different install.

Now you're ready to fire this thing up...

/etc/init.d/vpnclient_init start

It will say something like:

Starting /usr/local/bin/vpnclient:
Warning: loading /lib/modules/2.4.18-14/CiscoVPN/cisco_ipsec will taint
the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about
tainted modules Module cisco_ipsec loaded, with warnings
Done

Now you have the major part of it loaded. The Cisco client daemon is
loaded. The same thing happens on Windows -- you need the Cisco service
running before the client tool can work.

Now cd to this path:

/etc/CiscoSystemsVPNClient/Profiles/

In there, you can find a sample.pcf profile, but I recommend something
like this:

[main]
; save me as corp.pcf
Description=corp user profile
Host=<YOUR INTERNET-PINGABLE VPN GATEWAY HOST GOES HERE>
AuthType=1
EnableISPConnect=0
ISPConnectType=0
SaveUserPassword=0
EnableBackup=0
EnableNat=0
TunnelingMode=0
TcpTunnelingPort=443
CertStore=0
CertSerialHash=00000000000000000000000000000000
PeerTimeout=400
EnableLocalLAN=0
EnableMSLogon=1
MSLogonType=0
SendCertChain=0
; end of file - erase this line

Now if you have a local Linux firewall, it may be a hinderence while
you troubleshoot this. I recommend turning it off until you get this
going, then turn it back on again after you disconnect VPN (later on
below), then figure out what the iptables statements are to keep you
secure in addition to doing VPN, and retest again.

Now you can connect with vpnclient connect corp

It will prompt you for some information that your VPN administrator
should have given you, including group username, group password, your
username, and your passcode. Often your passcode with the SecurID
device will be some 4 digit PIN code + whatever is on the SecurID
keyfob.

It should return with this result:

Authenticating user.
Negotiating security policies.
Securing communication channel.

...Reminder...
It is a good practice and added security to disconnect from the VPN
concentrator if you are not actively using the system!

Maximum idle time = 30 min
Maximum connect time = 10 hrs
Do you wish to continue? (y/n): y

Your VPN connection is secure.

VPN tunnel information.
Client address: 10.12.150.15
Server address: 196.200.212.14
Encryption: 168-bit 3-DES
Authentication: HMAC-MD5
IP Compression: None
NAT passthrough is inactive
Local LAN Access is disabled

....and just sit here. That's actually a GOOD THING. That means you're
connected and it's holding your connection, waiting for you to do
CTRL+C to kill it.

Now you can establish your connection to your LAN resources by IP
address.

Don't know the IP address but do know the IP address or fully-qualified
computer name of the DNS server that applies to your LAN in the
corporate WAN? No problem! Just do this step with Linux:

nslookup(press Enter here)

Now type "server <YOUR DNS IP OR HOSTNAME GOES HERE>".

You'll get a response.

Now type the server name you are interested in finding the IP address
for in FQDN format.

Repeat this last step as many times as you need to get all the IP
addresses you need.

Now you can disconnect from nslookup by doing "exit". Note that you can
record these short computer names now in /etc/hosts so that next time
you can reach a LAN resource by host name rather than remembering all
these IP addresses.

Now you are ready to use your web browser, vnc, tsclient (rdesktop), or
other tools in Linux to connect to your local LAN resources.

To disconnect your VPN, just do CTRL+C in the window you had open for
the vpnclient command line. No further commands necessary.

If you have your local Linux firewall down, I recommend turning it back
on again and testing this. It's highly likely you'll need to tweak your
firewall settings for the VPN connection so that you're secure and yet
you can get through.

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Newbie tash Linux Networking 2 04-16-2007 11:11 AM
Openswan - XP->Linux tunnel DJ Linux Networking 0 01-25-2007 04:09 PM
OpenSwan - Linux VPN to Linux VPN walt750@gmail.com Linux Networking 1 06-13-2006 03:04 PM
Re: Newbie Help with Linux VPN and OpenSwan. Vin McLellan Linux Networking 1 03-02-2005 05:57 PM
Newbie Trying To Understand OpenSwan Google Mike Linux Networking 0 02-27-2005 05:30 PM



1 2 3 4 5 6 7 8 9 10 11