I have a virtual machine "gateway" and a virtual machine "client", and I want to connect client machine to my gateway machine using vpn.
Im my gateway virtual machine I have network configured as internal network and it has IP `192.168.0.254`
In my client machine I have network configured as internal network and it has `192.168.0.5`
For this purporse I started to install openvpn in my gateway machine and then I create a CA and a certificate in my "gateway" machine:
Code: Select all
openssl genrsa -des3 -out ca.key 1024
openssl req -new -key ca.key -out ca.csr
openssl 509 -req -days 3650 -in ca.csr -out ca.crt -signkey ca.key
openssl genrsa -out gateway.key 1024
openssl req -new -key gateway.key -out gateway.csr
openssl ca -in gateway.csr -cert ca.crt -keyfile ca.key -out gateway.crt
Code: Select all
openssl genrsa -out client.key 1024
openssl req -new -key client.key -out client.csr
openssl ca -in client.csr -cert ca.crt -keyfile ca.key -out client.crt
Then I configured the client.conf file and then I started openvpn in my client machine:
service openvpn start
And I get the green "ok message", but if I do `ifconfig` I dont have any `tun0` in my client machine, and when I do `tail -f /var/log/messages` I get errors:
- TLS handshake failed
- Certificate does not have key usage extension
Someone there understand what Im doing wrong? I think its some problem with certificates but Im not finding where..