Forked from GlitchWitch/_OpenVPN Server for LAN Access only.md
Created
November 20, 2024 18:07
-
-
Save coresh/41ea07f597a67d0a27992198575d1838 to your computer and use it in GitHub Desktop.
Revisions
-
GlitchWitch revised this gist
Mar 13, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ push "route 10.13.37.0 255.255.255.0" ## Edit client.conf Comment out the following from `client.conf` and `/etc/openvpn/server/client-common.txt` ``` #ignore-unknown-option block-outside-dns #block-outside-dns -
GlitchWitch revised this gist
Mar 13, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,13 @@ # How to setup an OpenVPN server for LAN Access only ## Install OpenVPN `wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh` ## Edit server.conf `/etc/openvpn/server/server.conf` Change the OpenVPN LAN address to prevent interfering with other OpenVPN connections `server 10.8.0.0 255.255.255.0` to `server 10.5.0.0 255.255.255.0` Comment out the following so Internet traffic is not routed through -
GlitchWitch renamed this gist
Mar 13, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
GlitchWitch renamed this gist
Mar 13, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
GlitchWitch renamed this gist
Mar 13, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
GlitchWitch revised this gist
Mar 8, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ push "route 10.13.37.0 255.255.255.0" ## Edit client.conf Comment out the following from client.conf and `/etc/openvpn/server/client-common.txt` ``` #ignore-unknown-option block-outside-dns #block-outside-dns -
GlitchWitch created this gist
Mar 8, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ client dev tun proto tcp remote X.X.X.X 1337 resolv-retry infinite nobind persist-key persist-tun remote-cert-tls server auth SHA512 cipher AES-256-CBC verb 3 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ ## Install OpenVPN `wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh` ## Edit server.conf `/etc/openvpn/server/server.conf` Changed the OpenVPN LAN address to prevent interfering with other OpenVPN connections `server 10.8.0.0 255.255.255.0` to `server 10.5.0.0 255.255.255.0` Comment out the following so Internet traffic is not routed through ``` #push "redirect-gateway def1 bypass-dhcp" #push "dhcp-option DNS 1.1.1.1" #push "dhcp-option DNS 1.0.0.1" ``` Add the following so VPN Clients get LAN route ``` # 10.13.37.254 is OpenVPN server's LAN IP push "route 10.13.37.254 255.255.255.0" push "route 10.13.37.0 255.255.255.0" ``` ## Edit client.conf Comment out the following from client.conf and ``/etc/openvpn/server/client-common.txt` ``` #ignore-unknown-option block-outside-dns #block-outside-dns ``` ## Add LAN Routes Add route to DDWRT/Routing.asp so LAN clients can respond ``` Destination LAN NET 10.5.0.0 Subnet Mask 255.255.0.0 Gateway 10.13.37.254 ``` Add route to VM pfsense/system_routes.php ``` Destination network 10.5.0.0 / 32 Gateway 10.13.37.1 ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ local 10.13.37.254 port 1337 proto tcp dev tun ca ca.crt cert server.crt key server.key dh dh.pem auth SHA512 tls-crypt tc.key topology subnet server 10.5.0.0 255.255.255.0 #push "redirect-gateway def1 bypass-dhcp" push "route 10.13.37.254 255.255.255.0" push "route 10.13.37.0 255.255.255.0" ifconfig-pool-persist ipp.txt #push "dhcp-option DNS 1.1.1.1" #push "dhcp-option DNS 1.0.0.1" keepalive 10 120 cipher AES-256-CBC user nobody group nogroup client-to-client persist-key persist-tun verb 3 crl-verify crl.pem