Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:services:vpn:openvpn:client [2019/04/06 02:02] – stylistics vgaetera | docs:guide-user:services:vpn:openvpn:client [2021/09/27 03:25] – [2. Firewall] vgaetera | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== OpenVPN | + | ====== OpenVPN |
| - | {{page> | + | {{section> |
| ===== Introduction ===== | ===== Introduction ===== | ||
| - | * This guide describes | + | * This how-to describes the method for setting up [[wp> |
| - | * You can use it to connect to your own OpenVPN server or a commercial OpenVPN provider. | + | * Follow [[docs: |
| - | * Follow [[basic|OpenVPN | + | |
| ===== Goals ===== | ===== Goals ===== | ||
| - | * Encrypt your internet connection to enforce security and privacy. | + | {{section> |
| - | * Prevent data leak and traffic spoofing on the path to client-ISP. | + | |
| - | * Escape client-ISP content-filters and internet censorship. | + | |
| - | * Access your VPN-server | + | |
| - | * Access region-restricted services and content using commercial VPN-providers. | + | |
| - | ===== Instructions | + | ===== Command-line instructions |
| - | ==== 1. Firewall | + | ==== 1. Preparation |
| - | To minimize firewall setup consider VPN-network as public and assign VPN-interface to WAN-zone. | + | Install the required packages. |
| <code bash> | <code bash> | ||
| - | # Configure firewall | + | # Install packages |
| - | uci set firewall.@zone[1].device=" | + | opkg update |
| - | uci commit firewall | + | opkg install openvpn-openssl |
| - | service firewall restart | + | |
| </ | </ | ||
| - | ==== 2. VPN-service | + | ==== 2. Firewall |
| - | Save your client profile. | + | Consider |
| - | Install and configure | + | Assign |
| - | Drop VPN-service privileges and ensure VPN-interface | + | |
| <code bash> | <code bash> | ||
| - | # Save VPN-client profile | + | # Configure firewall |
| - | cat << " | + | uci rename firewall.@zone[0]="lan" |
| - | COPY_PASTE_CLIENT_PROFILE_HERE | + | uci rename |
| - | EOF | + | uci del_list firewall.wan.device=" |
| - | + | uci add_list firewall.wan.device="tun+" | |
| - | # Fix permissions | + | uci commit firewall |
| - | chmod " | + | /etc/init.d/ |
| - | + | ||
| - | # Install packages | + | |
| - | opkg update | + | |
| - | opkg install openvpn-openssl | + | |
| - | + | ||
| - | # Configure VPN-client | + | |
| - | sed -i -e " | + | |
| - | / | + | |
| - | \$a user nobody | + | |
| - | / | + | |
| - | \$a group nogroup | + | |
| - | / | + | |
| - | \$a dev $(uci get firewall.@zone[1].device) | + | |
| - | " /etc/openvpn/ | + | |
| - | service openvpn | + | |
| </ | </ | ||
| - | If using a commercial | + | ==== 3. VPN service ==== |
| + | Save your client profile to configure VPN service. | ||
| <code bash> | <code bash> | ||
| - | # Save username/ | + | # Save VPN client profile |
| - | cat << | + | umask go= |
| - | YOUR_VPN_USERNAME | + | cat << EOF > / |
| - | YOUR_VPN_PASSWORD | + | COPY_PASTE_CLIENT_PROFILE_HERE |
| EOF | EOF | ||
| - | + | /etc/init.d/openvpn restart | |
| - | # Fix permissions | + | |
| - | chmod " | + | |
| - | + | ||
| - | # Configure VPN-client | + | |
| - | sed -i -e " | + | |
| - | /^auth-user-pass/ | + | |
| - | \$a auth-user-pass / | + | |
| - | / | + | |
| - | \$a redirect-gateway def1 ipv6 | + | |
| - | " / | + | |
| - | service | + | |
| </ | </ | ||
| - | Configure | + | Configure |
| - | + | ||
| - | See also: [[extra# | + | |
| ===== Testing ===== | ===== Testing ===== | ||
| - | Follow: [[extra#testing|Testing]] | + | {{section> |
| ===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
| - | Follow: [[extra# | + | {{section>docs:guide-user: |
| - | + | ||
| - | {{tag>How-To VPN OpenVPN}} | + | |