Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-29-2009, 05:14 AM
|
#1
|
LQ Newbie
Registered: Jun 2009
Posts: 9
Rep:
|
Configuring OPENVPN 2.1
Hi all this is my first post so try to be less rude if i am wrong.
Last couple of days i have been trying openvpn2.1 on centos 5.3. I am trying a simple thing
server ------------------------------client
192.168.7.120 --------------------------192.168.7.150
I want to establish a ROUTED OPENVPN with x509 (PKI) certification not with static key, between this two pc. what i did is
# I created iptables for tun
IPTABLES -A INPUT -i tun+ -j accept
1.Generate master Certificate
2.Generate server certificate
3.Generate client certificate
(I copied client certificate from server to client in a secure channel)
4.Generate DH parameter
5. Edit server.conf on server pc
local 192.168.7.120
port 1194
proto udp
dev tun
ca /etc/openvpn/easy-rsa/2.0/keys/ca.cert
cert /etc/openvpn/easy-rsa/2.0/keys/server.cert
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
server 10.8.8.0 255.255.255.0
6. Edit client.conf on client pc (A windows pc)
client
dev tun
proto 1194
remote 192.168.7.120 1194
ca c:\\Program Files\OpenVPN\easy-rsa\keys\ca.cert
cert c:\\Program Files\OpenVPN\easy-rsa\keys\client1.cert
key c:\\Program Files\OpenVPN\easy-rsa\keys\client1.key
7. Now Starting OPENVPN in server
openvpn server.conf
###Here is my problem cause this command is not working
and showing me following error.
-bash: openvpn: command not found
Please help me where is my fault or whether there is any other requirement or not.
Last edited by towhid; 06-29-2009 at 05:17 AM.
|
|
|
06-29-2009, 05:30 AM
|
#2
|
Member
Registered: Jun 2003
Posts: 481
Rep:
|
Assuming you installed using Yum or an RPM, you should have a file in /etc/rc.d/init.d/ called openvpn... it is this that you should use to start openvpn... as follows
# /etc/rc.d/init.d/openvpn start
If you installed from source, you will need to find the openvpn binary, which you can do by entering...
# find / -iname openvpn
It should be in your path, but obviously is not...
|
|
|
06-29-2009, 05:34 AM
|
#3
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
What user did you try to run openvpn as? You probably need to be root.
|
|
|
06-29-2009, 05:58 AM
|
#4
|
LQ Newbie
Registered: Jun 2009
Posts: 9
Original Poster
Rep:
|
[root@vmcent ~]# /etc/rc.d/init.d/openvpn start
/etc/rc.d/init.d/openvpn: line 9: /etc/openvpn/: is a directory
can you help me what will i do now..and i am doing it as root.
|
|
|
06-29-2009, 03:19 PM
|
#5
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
Ho did you install openvpn? I'm guessing you installed from source rather than using yum?
|
|
|
06-29-2009, 10:20 PM
|
#6
|
LQ Newbie
Registered: Jun 2009
Posts: 9
Original Poster
Rep:
|
I have downloaded openvpn-2.1_rc18.tar.gz and installed with rpm and can you tell me how to install with yum
|
|
|
06-29-2009, 10:26 PM
|
#7
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
yum install openvpn
would have installed the CentOS specific version.
Are you saying you created the rpm from the tarball? If so, uninstall with rpm -e and install with yum.
|
|
|
06-30-2009, 01:36 AM
|
#8
|
LQ Newbie
Registered: Jun 2009
Posts: 9
Original Poster
Rep:
|
dear billymayday;
I have added 3rd party repository to my centeos-base-repos for installing openvpn. i have used "yum install openvpn" it has downloaded lzo2-2.02-3.el5.rf.i386.rpm openvpn-2.0.9-1.el5.rf.i386.rpm these two packages. Now what will do with these things coz ./configure is not working.
can you check my previous configuration pocess whether the process is right or not.
|
|
|
06-30-2009, 01:40 AM
|
#9
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
Yum should have installed them.
Did you remove the old version first?
|
|
|
07-02-2009, 12:24 AM
|
#10
|
LQ Newbie
Registered: Jun 2009
Posts: 9
Original Poster
Rep:
|
configuring openvpn
My server side is ok now and its up and running. But my client side is not working when ever i start client side with "openvpn client.ovpn"
it shows me following error.
"Options error: In [CMD-LINE]:1: Error opening configuration file: client.ovpn"
I created client.crt and client.key on server side and copy these files along with ca.crt to the client windows machine.
Can anyone tell whether i have to create the client.crt and client.key file in server side or in the client side.
|
|
|
07-02-2009, 12:47 AM
|
#11
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
So are you trying to run the client on Windows? If so what client, where is client.ovpn, etc.?
|
|
|
07-02-2009, 03:27 AM
|
#12
|
LQ Newbie
Registered: Jun 2009
Posts: 9
Original Poster
Rep:
|
Oh its working. I copied client.ovpn in C://programfiles/openvpn/config/ directory and client.cert, client.key, ca.crt in easy-rsa/keys directory thats why its was not working . Next i copied all the files in C://programfiles/openvpn/config/ directory and changed directories in client.ovpn files. Now its working. thanks everybody for giving me time.
|
|
|
07-02-2009, 03:46 AM
|
#13
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
A small thought for you. I keep a small batch file on my desktop to map remote samba shares with a simple double click and password entry. Works a charm. Note that you will probably need to use the IP rather than server name if you are using a routed connection.
Last edited by billymayday; 07-02-2009 at 03:50 AM.
|
|
|
All times are GMT -5. The time now is 01:52 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|