Topic: FreeBSD as OpenVPN Client

Hello the team,
I'm french boy from France, excuse me for my bad english.
I have installed FreeNAS, this is a FreeBSD OS specialized in NAS (Network Area Storage)
Freenas is installed with the full version, not embedded.

I'm a customer from a VPN Provider Arethusa
I have a little problem for to automize the VPN connection on my VPN provider.

First: I only have from VPN Provider a Login and Password, ca.key and openvpn.conf.
My openvpn.conf file:

client
dev tun
proto udp
remote xxx.xxxxxxx.xxx 443
resolv-retry infinite
nobind
persist-key
persist-tun
ca /usr/local/etc/openvpn/ca.crt
ns-cert-type server
cipher AES-256-CBC
comp-lzo
verb 3
auth-user-pass
redirect-gateway def1 bypass-dhcp

Look, auth-user-pass, if I try to put the Login and Password in a file -> it doesn't work

Second: in Putty SSH mode:

pkg_add -r openvpn

Third: At the End of rc.conf I have to add:

openvpn_enable="YES"
openvpn_if="tap"

Fourth: in Putty SSH mode:

ifconfig tun0 create

Fifth: in Putty SSH mode:

/usr/local/etc/rc.d/openvpn start

After the following command openvpn start, the Prompt of Putty ask:
Enter Auth Username: I need to type the login
Enter Auth Password: I need to type the password

Ok, FreeNAS VPN client works.

Now, if I reboot FreeNas
after the file rc.conf has loaded, the prompt asks:
Enter Auth Username and Enter Auth Password
Ok, I type the login and password.
But the tun0 doesn't exist, so the vpn doesn't work

I have two questions:
the problem for me is: to type the login and password at the boot
I tried this command:
auth-user-pass /usr/local/etc/openvpn/key.conf -> it doesn't work
auth-user-pass /usr/local/etc/openvpn/key.conf via file -> it doesn't work

Do you have a solution ?

I also need to create an automized command for ifconfig tun0 create.
Do you have any idea ? and where and in which file can I put this command ?


Regards,
The french boy who tried to write an english  lol

Re: FreeBSD as OpenVPN Client

First, if you use tun for your network device, you should use openvpn_if="tun". That should create the tun interface on startup. As for automatically submitting username and password, I don't know at the moment; I use password-less certificates with OpenVPN. Maybe someone else can supply that answer.

Re: FreeBSD as OpenVPN Client

Ok thx Maxtor,
I will  try to put

openvpn_if="tun"

in rc.conf file.