User Tools

Site Tools


unraid:virtual:openvpnu16.04

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
unraid:virtual:openvpnu16.04 [2021/07/21 20:55] – [Install OpenVPN and IpTables] dirkunraid:virtual:openvpnu16.04 [2025/04/19 15:13] (current) – [Install OpenVPN and IpTables] dirk
Line 1: Line 1:
 ====== Install OpenVPN virtual router on Ubuntu 16.04 LTS as Unraid Virtual Machine ====== ====== Install OpenVPN virtual router on Ubuntu 16.04 LTS as Unraid Virtual Machine ======
-This will guide you through the setup of an OpenVPN virtual router on an installation of [[Ubuntu 20.04 LTS]] as an Unraid Virtual Machine.+This will guide you through the setup of an OpenVPN virtual router on an installation of [[Ubuntu 16.04 LTS]] as an Unraid Virtual Machine.
 ===== VM Settings ===== ===== VM Settings =====
   * Autostart: Yes   * Autostart: Yes
Line 88: Line 88:
   * edit /etc/openvpn/boston.conf   * edit /etc/openvpn/boston.conf
     * <code>sudo vim /etc/openvpn/boston.conf</code>     * <code>sudo vim /etc/openvpn/boston.conf</code>
-    * add path to vpnauth.txt: auth-user-path /etc/openvpn/vpnauth.txt+    * add path to vpnauth.txt: auth-user-pass /etc/openvpn/vpnauth.txt 
 +  * add the cert file in that folder too 
 +  * remove the keysize thing (i think it was keysize) that line needs to go.
   * reboot   * reboot
   * check connection   * check connection
Line 104: Line 106:
 sudo iptables -t nat -F sudo iptables -t nat -F
 sudo iptables -t nat -A POSTROUTING -o tun+ -j MASQUERADE sudo iptables -t nat -A POSTROUTING -o tun+ -j MASQUERADE
-sudo iptables -A INPUT -i enp1s0 -p tcp --dport 22 -j ACCEPT+sudo iptables -A INPUT -i ens18 -p tcp --dport 22 -j ACCEPT
 sudo iptables -A INPUT -i lo -m comment --comment "loopback" -j ACCEPT sudo iptables -A INPUT -i lo -m comment --comment "loopback" -j ACCEPT
 sudo iptables -A OUTPUT -o lo -m comment --comment "loopback" -j ACCEPT sudo iptables -A OUTPUT -o lo -m comment --comment "loopback" -j ACCEPT
-sudo iptables -I INPUT -i enp1s0 -m comment --comment "In from LAN" -j ACCEPT+sudo iptables -I INPUT -i ens18 -m comment --comment "In from LAN" -j ACCEPT
 sudo iptables -I OUTPUT -o tun+ -m comment --comment "Out to VPN" -j ACCEPT sudo iptables -I OUTPUT -o tun+ -m comment --comment "Out to VPN" -j ACCEPT
-sudo iptables -A OUTPUT -o enp1s0 -p udp --dport 443 -m comment --comment "openvpn" -j ACCEPT +sudo iptables -A OUTPUT -o ens18 -p udp --dport 443 -m comment --comment "openvpn" -j ACCEPT 
-sudo iptables -A OUTPUT -o enp1s0 -p udp --dport 123 -m comment --comment "ntp" -j ACCEPT+sudo iptables -A OUTPUT -o ens18 -p udp --dport 123 -m comment --comment "ntp" -j ACCEPT
 sudo iptables -A OUTPUT -p UDP --dport 67:68 -m comment --comment "dhcp" -j ACCEPT sudo iptables -A OUTPUT -p UDP --dport 67:68 -m comment --comment "dhcp" -j ACCEPT
-sudo iptables -A OUTPUT -o enp1s0 -p udp --dport 53 -m comment --comment "dns" -j ACCEPT +sudo iptables -A OUTPUT -o ens18 -p udp --dport 53 -m comment --comment "dns" -j ACCEPT 
-sudo iptables -A FORWARD -i tun+ -o enp1s0 -m state --state RELATED,ESTABLISHED -j ACCEPT +sudo iptables -A FORWARD -i tun+ -o ens18 -m state --state RELATED,ESTABLISHED -j ACCEPT 
-sudo iptables -A FORWARD -i enp1s0 -o tun+ -m comment --comment "LAN out to VPN" -j ACCEPT+sudo iptables -A FORWARD -i ens18 -o tun+ -m comment --comment "LAN out to VPN" -j ACCEPT
 sudo iptables -P FORWARD DROP</code> sudo iptables -P FORWARD DROP</code>
     * first three lines erase old rules (if any)     * first three lines erase old rules (if any)
unraid/virtual/openvpnu16.04.1626918907.txt.gz · Last modified: by dirk