LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   configuring openvpn with an ip failover (https://www.linuxquestions.org/questions/linux-newbie-8/configuring-openvpn-with-an-ip-failover-4175423921/)

Anselme 08-25-2012 04:45 AM

configuring openvpn with an ip failover
 
Hello, I'm trying to set up an openvpn server on a dedicated server with fedora, and setting it up to work with the failover IP (eth0:0) of my server.
(an apache server is already running successfully through the failover IP)

cat /etc/openvpn/server.conf
Quote:

# Serveur TCP/443
mode server
proto tcp
port 443
dev tun
# Cles et certificats
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
tls-auth ta.key 0
cipher AES-256-CBC
# Reseau
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 4.4.4.4"
push "dhcp-option DNS 8.8.8.8"
keepalive 10 120
# Securite
user nobody
group nogroup
chroot /etc/openvpn/jail
persist-key
persist-tun
comp-lzo
# Log
verb 3
mute 20
status openvpn-status.log
log-append /var/log/openvpn.log
openvpn --version
Quote:

OpenVPN 2.0_rc6 x86_64-unknown-linux [SSL] [LZO] [EPOLL] built on Oct 17 2011
Copyright (C) 2002-2004 James Yonan <jim@yonan.net>
is "unknown-linux" normal?

I tried to launch openvpn

service openvpn start
Quote:

Starting openvpn (via systemctl): [ OK ]
cat /var/log/openvpn.log
Quote:

Options error: Unrecognized option or missing parameter(s) in [CMD-LINE]:1: script-security
Use --help for more information.
Options error: Unrecognized option or missing parameter(s) in [CMD-LINE]:1: script-security
Use --help for more information.
Options error: Unrecognized option or missing parameter(s) in [CMD-LINE]:1: script-security
Use --help for more information.
Sat Aug 25 11:00:15 2012 OpenVPN 2.0_rc6 x86_64-unknown-linux [SSL] [LZO] [EPOLL] built on Oct 17 2011
Sat Aug 25 11:00:15 2012 Cannot open dh1024.pem for DH parameters: error:02001002:system library:fopen:No such file or directory: error:2006D080:BIO routines:BIO_new_file:no such file
Sat Aug 25 11:00:15 2012 Exiting
Sat Aug 25 11:02:57 2012 OpenVPN 2.0_rc6 x86_64-unknown-linux [SSL] [LZO] [EPOLL] built on Oct 17 2011
Sat Aug 25 11:02:57 2012 Cannot open dh1024.pem for DH parameters: error:02001002:system library:fopen:No such file or directory: error:2006D080:BIO routines:BIO_new_file:no such file
Sat Aug 25 11:02:57 2012 Exiting
I don't understand how openvpn has to be configured to start properly.

KinnowGrower 08-25-2012 08:19 AM

Openvpn server can be setup in two ways.

1. Static key based
2. Certificate based

To get help for simple static key based setup (server configuration file) click OpenVpn HOWTO

you can set variable verb to 9 for diagnostic purpose. Also check the log file for errors. You are using port 443 in server configuration. Make sure it is correct because if Apache is using the same 443 port as SSL it may not start

Anselme 08-25-2012 03:58 PM

My server has to be certificate based, 3-4 users will be connected simultaneously, i followed a tutorial to make a first certificate, but the problem is not a connection problem right now, the server don't even starts.
What means: Unrecognized option or missing parameter(s) in [CMD-LINE]:1: script-security ?
where do i have to add a parameter? what parameter?

And the most disturbing:
Cannot open dh1024.pem for DH parameters: error:02001002:system library:fopen:No such file or directory: error:2006D080:BIO routines:BIO_new_file:no such file

dh1024.pem is in the /etc/openvpn folder, i rebuilt it to be sure, the error is still there.

About apache, there are just simple php tests, i'm learning web programming, i don't think apache uses 443 port.
And i'm forced to use the 443 for openvpn, most of the other ports are blocked in my student room. (that's why i use a vpn)

Thanks for your answers and patience, i'm new on linux.

KinnowGrower 08-25-2012 08:10 PM

Quote:

What means: Unrecognized option or missing parameter(s) in [CMD-LINE]:1: script-security ?
According to me the error message says [CMD-LINE]:1:. Can you try by commenting out the line 1 (mode server). or make sure it is correct.


for the dh1024.pem error give a full path there e.g. /etc/openvpn/dh1024.pem

Quote:

# Log
verb 3
mute 20
status openvpn-status.log
log-append /var/log/openvpn.log
replace verb 3 with verb 9. It will give your more detail about error message you can check the error log for more info. Hope it may help

Anselme 08-26-2012 05:40 AM

I tried everything you suggested, and nothing changed in the logs, i concluded that openvpn don't use my server.conf, then i tried launching openvpn that way:

openvpn --config /etc/openvpn/server.conf

It worked, and i can connect to the server with my openvpn client.
Everything is fine and works well, I think I will let openvpn work that way now.

You've been really helpful, thanks !
(By the way, if you have some advices to improve how my openvpn server is working, i'm listening)


All times are GMT -5. The time now is 02:23 PM.