This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| openvpn [2021/11/10 00:17] – [Here is my steps] vissie | openvpn [2021/11/10 03:39] (current) – [Here is my steps] vissie | ||
|---|---|---|---|
| Line 39: | Line 39: | ||
|   sudo cp ./ |   sudo cp ./ | ||
| ./easyrsa sign-req server server | ./easyrsa sign-req server server | ||
| + |   sudo cp ./ | ||
| + |   sudo cp ./ | ||
| ./easyrsa gen-dh | ./easyrsa gen-dh | ||
| sudo openvpn --genkey --secret ta.key | sudo openvpn --genkey --secret ta.key | ||
| Line 75: | Line 77: | ||
|   push " |   push " | ||
| # Optional! | # Optional! | ||
| - | port 443 | + | port 11 | 
| # Optional! | # Optional! | ||
| proto tcp | proto tcp | ||
| Line 128: | Line 130: | ||
|   DEFAULT_FORWARD_POLICY=" |   DEFAULT_FORWARD_POLICY=" | ||
| ... | ... | ||
| - | sudo ufw allow 443/tcp | + | sudo ufw allow 1194/udp | 
| sudo ufw allow OpenSSH | sudo ufw allow OpenSSH | ||
| ===Step 7 — Starting and Enabling the OpenVPN Service=== | ===Step 7 — Starting and Enabling the OpenVPN Service=== | ||
| + | sudo systemctl start openvpn@server | ||
| + | sudo systemctl status openvpn@server | ||
| + | sudo systemctl enable openvpn@server | ||
| + | ===Step 8 — Creating the Client Configuration Infrastructure=== | ||
| + |   mkdir -p ~/ | ||
| + |   cp / | ||
| + |   vim ~/ | ||
| + | ... | ||
| + | remote my.server.com 1194 | ||
| + | proto udp | ||
| + | # Downgrade privileges after initialization (non-Windows only) | ||
| + | user nobody | ||
| + | group nogroup | ||
| + | #ca ca.crt | ||
| + | #cert client.crt | ||
| + | #key client.key | ||
| + | #tls-auth ta.key 1 | ||
| + | cipher AES-256-CBC | ||
| + | auth SHA256 | ||
| + | key-direction 1 | ||
| + |   # Finally, add a few commented out lines. Although you can include these directives in every client configuration file, you only need to enable them for Linux clients  | ||
| + |   # that ship with an / | ||
| + | # script-security 2 | ||
| + |   # up / | ||
| + |   # down / | ||
| + | ... | ||
| + |   vim ~/ | ||
| + |    | ||
| + | #!/bin/bash | ||
| + | # First argument: Client identifier | ||
| + | <sxh bash; gutter: false> | ||
| + | KEY_DIR=/ | ||
| + | OUTPUT_DIR=/ | ||
| + | BASE_CONFIG=/ | ||
| + | |||
| + | cat ${BASE_CONFIG} \ | ||
| + |     <(echo -e '< | ||
| + |     ${KEY_DIR}/ | ||
| + |     <(echo -e '</ | ||
| + |     ${KEY_DIR}/ | ||
| + |     <(echo -e '</ | ||
| + |     ${KEY_DIR}/ | ||
| + |     <(echo -e '</ | ||
| + |     ${KEY_DIR}/ | ||
| + |     <(echo -e '</ | ||
| + |     > ${OUTPUT_DIR}/ | ||
| + | </ | ||
| + |   chmod 700 ~/ | ||
| + | ===Step 9 — Generating Client Configurations===   | ||
| + |   cd ~/ | ||
| + |   sudo ./ | ||
| + |   ls ~/ | ||
| + | ===Step 10 — Installing the Client Configuration=== | ||
| + | sudo apt install openvpn | ||
| + |   # Check to see if your distribution includes an / | ||
| + |   ls / | ||
| + | update-resolv-conf | ||
| + | #Next, edit the OpenVPN client configuration file you transfered: | ||
| + | vim client1.ovpn | ||
| + | <sxh bash; gutter: false> | ||
| + | ... | ||
| + | script-security 2 | ||
| + | up / | ||
| + | down / | ||
| + | ... | ||
| + | </ | ||
| + |    | ||
| + | |||
| + |    | ||
| ==== Here is my notes: ==== | ==== Here is my notes: ==== | ||
| Use dig command for determining my public IP address: | Use dig command for determining my public IP address: | ||