Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3556

General discussion • Re: Using a Pi as a "router"

$
0
0
Get OpenVPN running.
https://openvpn.net/community-downloads/

Which you can install with sudo apt update;sudo apt install openvpn.

It needs a config file where you can embed the self-signed certificates. So that looks like (I've mushed the certificates and private key in my example).

Code:

clientdev tunproto udpremote some-server-somewhere.com resolv-retry infinitenobindpersist-keypersist-tunremote-cert-tls servercomp-lzoverb 3<ca>-----BEGIN CERTIFICATE-----MIIF... certificate authority certificate copied here ...... some data removed for security reasons ...S-----END CERTIFICATE-----</ca><cert>-----BEGIN CERTIFICATE-----MIIFojCCBIqgAwIBAgIBDzANBgkqhkiG9w0BAQsFADCBxzELMAkGA1UEBhMCR0IxEjAQBgNVBAgTCUhhbXBzaGlyZTEUMBIGA1UEBxMLQmFzaW5nc3Rva2UxIjAgBgNVBAoTGURhcmtzaWRlIExvZ2ljIChPbmUpIEx0ZC4xGDAWBgNVBAsTD0RhcmtzaWRlOkFwb2xsbzEPMA0GA1UEAxMGYXBvbGxvMR4wHAYDVQQpExVBcG9sbG8gQ2VydCBBdXRoIChDQSkxHzAdBgkqhkiG9w0BCQEWEGRsMWltc0BnbWFpbC5jb20wHhcNMjEwNzE2MjMxNjU2WhcNMzEwNzE0MjMxNjU2WjCBwjELMAkGA1UEBhMCR0IxEjAQBgNVBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBcmtzaWRlIExvZ2ljIChPbmUpIEx0ZC4xGDAWBgNVBAsTD0xBUFRPUC0wTE8zUjRFMzEYMBYGA1UEAxMPTEFQVE9QLTBMTzNSNEUzMRAwDgYDVQQpEwdFYXN5UlNBMR8wHQYJKoZIhvcNAQkBFhBkbDFpbXNAZ21haWwuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0XUd3hmSlqpe/DKlc+CZre+8WEaEilWTsfzlQ2AF/DYjvvNhuXcRkND1jqcUf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ZI78a9D6r8wAvaV3tlBTVte6INjQuzVrXqdf5amnV8CIuuXnjh+rbQzNDQa8wkGD02hQEY5H3+W7p9EhErEGKPkdgGX1nSsJGCterfm/8iSXMT-----END CERTIFICATE-----</cert><key>-----BEGIN PRIVATE KEY-----MIIE... private key copied in here ...... some data removed for security reasons ....=-----END PRIVATE KEY-----</key>
You generate your CA, cert and private key using easy-rsa and store the same client and server files on both ends in /etc/openvpn (on your raspberry). Start the OpenVPN server with sudo systemctl enable servername@openvpn; systemctl start servername@openvpn (where servername matches the name of the config file you stored in /etc/openpvn).

Statistics: Posted by DougieLawson — Sun Jul 21, 2024 10:54 am



Viewing all articles
Browse latest Browse all 3556

Trending Articles