[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:network_services:openvpn [2018/04/06 21:19 (UTC)] – Updated for Slackware 14.2 chrisabela | howtos:network_services:openvpn [2023/02/04 18:36 (UTC)] (current) – [13. Firewalls] chrisabela | ||
---|---|---|---|
Line 8: | Line 8: | ||
OpenVPN is an open source software application that implements virtual private network (VPN) techniques for creating secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities. It uses a custom security protocol that utilizes SSL/TLS for key exchange. It is capable of traversing network address translators (NATs) and firewalls. It was written by James Yonan and is published under the GNU General Public License (GPL). | OpenVPN is an open source software application that implements virtual private network (VPN) techniques for creating secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities. It uses a custom security protocol that utilizes SSL/TLS for key exchange. It is capable of traversing network address translators (NATs) and firewalls. It was written by James Yonan and is published under the GNU General Public License (GPL). | ||
- | OpenVPN allows peers to authenticate each other using a pre-shared secret key, certificates, | + | OpenVPN allows peers to authenticate each other using a pre-shared secret key, certificates, |
===== 2. Scope and Objective ===== | ===== 2. Scope and Objective ===== | ||
Line 20: | Line 20: | ||
===== 3. Installation ===== | ===== 3. Installation ===== | ||
- | Openvpn | + | OpenVPN |
- | If you want to confirm that Openvpn | + | If you want to confirm that OpenVPN |
< | < | ||
- | # ls /var/log/ | + | # ls /var/lib/ |
</ | </ | ||
===== 4. Requirements ===== | ===== 4. Requirements ===== | ||
- | Server and a Client computers would be needed. They would have to be connected to the Internet on two different Routers and different Network Routes. | + | Server and a Client computers would be needed. They would have to be connected to the Internet on two different Routers and different Network Routes. |
==== 4.1. Server DNS ==== | ==== 4.1. Server DNS ==== | ||
- | A URL is normally used to address the Server. This is not mandatory and instead you may use only the Internet IP. However it is recommended to use a URL to access the Server from the Internet, especially if it is connected to a dynamic IP, which is typical for domestic Internet connections. The author is using noip2(4) as it is free upon subscription. A noip2 slackbuild is available from http:// | + | A URL is normally used to address the Server. This is not mandatory and instead you may use only the Internet IP. However it is recommended to use a URL to access the Server from the Internet, especially if it is connected to a dynamic IP, which is typical for domestic Internet connections. The author is using duckdns.org |
==== 4.2. Server details ==== | ==== 4.2. Server details ==== | ||
Line 41: | Line 41: | ||
hostname: server1 | hostname: server1 | ||
IP: 192.168.200.195/ | IP: 192.168.200.195/ | ||
- | URL: servervpn.no-ip.org | + | URL: servervpn.duckdns.org |
Network Interface: eth0 | Network Interface: eth0 | ||
</ | </ | ||
Line 53: | Line 53: | ||
</ | </ | ||
- | ==== 4.3 Administrator Rights ==== | + | ==== 4.4 Administrator Rights ==== |
- | You will need to have administrator rights to set up OpenVPN. This applies to both the Server and the Client. For simplicity, in this tutorial, it will be assumed that all actions will be performed by the root user. Naturally advanced users might be more discerning. | + | You will need to have administrator rights to set up OpenVPN. This applies to both the Server and the Client. For simplicity, in this tutorial, it will be assumed that all actions will be performed by the root user. Naturally, advanced users might be more discerning. |
- | ==== 4.4 Possible Constraints and Possible Solutions for a WiFi equipped Client ==== | + | ==== 4.5 Possible Constraints and Possible Solutions for a WiFi equipped Client ==== |
The availability of two Routers might be challenging. Consider that interactive sessions on both the Server and Client will be needed before the VPN is set up. If the Client is equipped with a WiFi interface there might be some easy solutions that may be considered: | The availability of two Routers might be challenging. Consider that interactive sessions on both the Server and Client will be needed before the VPN is set up. If the Client is equipped with a WiFi interface there might be some easy solutions that may be considered: | ||
- | - Use a 3G smart phone' | + | - Use the data smart phone' |
- | - Connect the Client to another WiFi available in the vicinity of the Server. Some lucky people live in areas were benevolent neighbours provide them with openly accessible Internet WiFi. It is recommended to request permission before taking up this solution. In case that no such open service exists, you may find it appropriate to request a temporary password from a friendly neighbour for the private encrypted WiFi service. | + | - Nowadays, many public |
- | - Nowadays, many governmental | + | |
===== 5. Creating a Public Key Infrastructure (PKI) using the easy-rsa Scripts ===== | ===== 5. Creating a Public Key Infrastructure (PKI) using the easy-rsa Scripts ===== | ||
- | The PKI may be created on any computer | + | The PKI may be created on any computer, but it is probably more sensible to be done on both the Server and the Client as both would need it. An easy way to build the PKI is to use the '' |
< | < | ||
Line 77: | Line 76: | ||
< | < | ||
- | # tar cvf easy-rsa.tar easy-rsa | + | # tar czvf easy-rsa.tgz easy-rsa |
</ | </ | ||
Line 103: | Line 102: | ||
</ | </ | ||
- | You will be prompted for another | + | You will be prompted for the PEM pass phrase, to reverify it and to confirm that the name of the entity is indeed server1. Now you may proceed to sign this request: |
< | < | ||
Line 117: | Line 116: | ||
# openssl dhparam -out dh2048.pem 2048 | # openssl dhparam -out dh2048.pem 2048 | ||
# cd / | # cd / | ||
- | # / | + | # / |
</ | </ | ||
Line 124: | Line 123: | ||
Follow these steps on the Client to create the needed keys and certificates: | Follow these steps on the Client to create the needed keys and certificates: | ||
- | You will need the easy-rsa scripts, so you can copy the easy-rsa tarball from the Server to the Client and extract it: | + | You will need the '' |
< | < | ||
# cd | # cd | ||
- | # tar xvf easy-rsa.tar | + | # tar xvf easy-rsa.tgz |
</ | </ | ||
Line 139: | Line 138: | ||
</ | </ | ||
- | You will be prompted for another | + | You will be prompted for a PEM pass phrase, to re-verify it and to confirm that the name of the entity is indeed client1. In this article I am using the hostnames for clarity (in this case: client1), but you may choose any name. |
- | Copy pki/ | + | Copy '' |
=== 5.2.1 Sign the Client' | === 5.2.1 Sign the Client' | ||
- | For the purpose of this article, it is assumed that the Client' | + | For the purpose of this article, it is assumed that the Client' |
< | < | ||
Line 155: | Line 154: | ||
When prompted enter " | When prompted enter " | ||
- | Copy the generated $HOME/ | + | Copy the generated |
back to the client. | back to the client. | ||
===== 6. Setting up the Server ===== | ===== 6. Setting up the Server ===== | ||
- | Copy the following files generated by the easy-rsa scripts to their respective directories in the / | + | Copy the following files generated by the easy-rsa scripts to their respective directories in the '' |
< | < | ||
Line 171: | Line 170: | ||
</ | </ | ||
- | Copy the sample | + | Copy the provided '' |
< | < | ||
- | # cd /tmp/ | + | # cp /etc/openvpn/ |
- | # wget -c \ | + | |
- | > ftp:// | + | |
- | # cd /usr/src/ | + | |
- | # tar xvf / | + | |
</ | </ | ||
- | Copy the file server.conf contained in the source to the OpenVPN configuration directory: | + | Edit the following lines of '' |
- | + | ||
- | < | + | |
- | # cp openvpn-*/ | + | |
- | > / | + | |
- | </ | + | |
- | + | ||
- | Edit the following lines of / | + | |
From these lines: | From these lines: | ||
Line 196: | Line 184: | ||
cert server.crt | cert server.crt | ||
key server.key | key server.key | ||
- | |||
dh dh1024.pem | dh dh1024.pem | ||
- | ;tls-auth ta.key 0 # This file is secret | ||
- | ;user nobody | + | ;topology subnet |
- | ;group nobody | + | |
+ | tls-auth ta.key 0 # This file is secret | ||
+ | |||
+ | cipher AES-256-CBC | ||
; | ; | ||
+ | |||
</ | </ | ||
Line 215: | Line 205: | ||
dh / | dh / | ||
+ | |||
+ | topology subnet | ||
tls-auth / | tls-auth / | ||
- | user nobody | + | data-ciphers-fallback AES-256-CBC |
- | group nobody | + | |
log-append | log-append | ||
</ | </ | ||
- | Finally add the following | + | < |
+ | |||
+ | Create a file containing your PEM pass phrase in a secure location; e.g. '' | ||
< | < | ||
- | # Select a cryptographic cipher. | + | # chmod 600 / |
- | # This config item must be copied to | + | |
- | # the client config file as well. | + | |
- | cipher AES-256-CBC | + | |
- | # If you want to use OpenVPN as a daemon, uncomment this line. | + | |
- | # Generally speaking, servers should run OpenVPN as a daemon | + | |
- | ;daemon | + | |
</ | </ | ||
- | < | + | On the Server, edit '' |
< | < | ||
- | # cat /var/log/openvpn.log | + | askpass |
+ | auth-nocache | ||
</ | </ | ||
- | < | + | Create a directory |
- | + | ||
- | Copy the rc.openvpn listed hereunder | + | |
< | < | ||
- | #!/bin/sh | + | mkdir /run/openvpn/ |
- | # | + | chmod 700 /run/openvpn/ |
- | # / | + | |
- | # | + | |
- | # Start/stop/ | + | |
- | # | + | |
- | + | ||
- | ovpn_start() { | + | |
- | if [ -x /usr/sbin/ | + | |
- | echo " | + | |
- | / | + | |
- | fi | + | |
- | } | + | |
- | + | ||
- | ovpn_stop() { | + | |
- | killall openvpn | + | |
- | } | + | |
- | + | ||
- | ovpn_restart() { | + | |
- | ovpn_stop | + | |
- | sleep 2 | + | |
- | ovpn_start | + | |
- | } | + | |
- | + | ||
- | case " | + | |
- | ' | + | |
- | ovpn_start | + | |
- | ;; | + | |
- | ' | + | |
- | ovpn_stop | + | |
- | ;; | + | |
- | ' | + | |
- | ovpn_restart | + | |
- | ;; | + | |
- | *) | + | |
- | echo " | + | |
- | esac | + | |
</ | </ | ||
- | Then give it executable permissions: | + | Give the OpenVPN '' |
< | < | ||
- | # chmod 755 / | + | # chmod +x / |
</ | </ | ||
===== 7. Port Forwarding ===== | ===== 7. Port Forwarding ===== | ||
- | You will need to forward traffic from the port you have chosen for OpenVPN to be routed to the Server. To accomplish this you will need to provide your Server with a fixed IP and you will need to configure your router. You may use netconfig, network-manager or wicd to set the fixed IP on Slackware. Then you also need to consult the documentation provided with your router to set up the selected IP address reserved for the Server, and the port forwarding. For our default OpenVPN set up, the UDP Port would be 1194. | + | You will need to forward traffic from the port you have chosen for OpenVPN to be routed to the Server. To accomplish this you will need to provide your Server with a fixed IP and you will need to configure your router. You may use netconfig to set the fixed IP on Slackware. Then you also need to consult the documentation provided with your router to set up the selected IP address reserved for the Server, and the port forwarding. For this default OpenVPN set up, the UDP Port would be 1194. |
- | In case if you have misplaced such documentation, | + | In case if you have misplaced such documentation, |
===== 8. Setting up the Client ===== | ===== 8. Setting up the Client ===== | ||
Line 302: | Line 253: | ||
On the Client machine perform the following instructions to set it up. | On the Client machine perform the following instructions to set it up. | ||
- | Download | + | Copy the provided '' |
< | < | ||
- | # cp /usr/src/openvpn-*/sample/ | + | # cp /etc/ |
- | > / | + | |
</ | </ | ||
Line 321: | Line 271: | ||
key client.key | key client.key | ||
- | ;tls-auth ta.key 1 | + | tls-auth ta.key 1 |
+ | |||
+ | cipher AES-256-CBC | ||
</ | </ | ||
Line 327: | Line 279: | ||
< | < | ||
- | remote servervpn.no-ip.org 1194 | + | remote servervpn.duckdns.org 1194 |
user nobody | user nobody | ||
Line 337: | Line 289: | ||
tls-auth / | tls-auth / | ||
- | </ | ||
- | Finally add the following to / | + | data-ciphers-fallback AES-256-CBC |
- | < | + | auth-nocache |
- | # Select a cryptographic cipher. | + | |
- | # This config item must be copied to | + | log-append |
- | # the server config file as well. | + | |
- | cipher AES-256-CBC | + | |
</ | </ | ||
- | < | + | < |
- | You will need this file that was generated by the Client' | + | You will need this file that was generated by the Client' |
< | < | ||
Line 357: | Line 306: | ||
</ | </ | ||
- | and the following from the Server' | + | and the following from the Server' |
< | < | ||
Line 364: | Line 313: | ||
</ | </ | ||
- | and this file as well: | + | and this file from the Server |
< | < | ||
Line 370: | Line 319: | ||
</ | </ | ||
- | Place these files as indicated in client.conf. So ca.crt and client1.crt go under / | + | Place these files as indicated in '' |
===== 9. Testing the VPN ===== | ===== 9. Testing the VPN ===== | ||
Line 377: | Line 326: | ||
< | < | ||
- | # / | + | # / |
</ | </ | ||
Line 385: | Line 334: | ||
< | < | ||
- | # / | + | # / |
</ | </ | ||
Enter the Client PEM pass phrase when prompted. To stop OpenVPN on the Client just hit CTRL+C | Enter the Client PEM pass phrase when prompted. To stop OpenVPN on the Client just hit CTRL+C | ||
- | On both you should see a new network interface called tun0. On the Server, I obtained the following: | + | On both you should see a new network interface called tun0. To verify, run this ip command: |
< | < | ||
- | # ifconfig tun0 | + | # /usr/sbin/ip addr show tun0 |
- | tun0: flags=4305< | + | |
- | inet 10.8.0.1 | + | |
- | unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 | + | |
- | RX packets 0 bytes 0 (0.0 B) | + | |
- | RX errors 0 dropped 0 overruns 0 frame 0 | + | |
- | TX packets 0 bytes 0 (0.0 B) | + | |
- | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | + | |
- | </code> | + | |
- | + | ||
- | Similarly on the Client: | + | |
- | + | ||
- | < | + | |
- | # ifconfig tun0 | + | |
- | tun0: flags=4305< | + | |
- | inet 10.8.0.6 | + | |
- | unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 | + | |
- | RX packets 0 bytes 0 (0.0 B) | + | |
- | RX errors 0 dropped 0 overruns 0 frame 0 | + | |
- | TX packets 0 bytes 0 (0.0 B) | + | |
- | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | + | |
</ | </ | ||
Line 432: | Line 361: | ||
</ | </ | ||
- | ===== 10. Storing the PEM pass phrase in a secure file and Automatic start of service after booting ===== | + | If you fail to set-up |
- | To start the OpenVPN service on boot, an entry in /etc/rc.d/rc.local is needed, but you would have to enter the server PEM pass phrase every time. This might be undesirable if the Server | + | < |
+ | tal -f /var/log/openvpn.log | ||
+ | </code> | ||
+ | |||
+ | ===== 10. Logrotate (6) ===== | ||
+ | |||
+ | This is logrotate configuration for OpenVPN. It prevents | ||
< | < | ||
- | # chmod 600 /root/password.ovpn | + | /var/log/openvpn.log { |
+ | daily | ||
+ | rotate 12 | ||
+ | compress | ||
+ | copytruncate | ||
+ | delaycompress | ||
+ | missingok | ||
+ | notifempty | ||
+ | } | ||
</ | </ | ||
- | On the Server, edit / | + | ===== 11. Storing the PEM pass phrase in a secure file and automatic start of service after booting ===== |
+ | |||
+ | As hinted in Chapter 6, to start the OpenVPN service on boot, an entry in ''/ | ||
+ | |||
+ | As ''/ | ||
+ | |||
+ | On the Client, edit '' | ||
< | < | ||
Line 447: | Line 396: | ||
</ | </ | ||
- | Also, uncomment the ' | + | Create a directory to store the OpenVPN service |
- | + | ||
- | This may be repeated also on the Client, just edit / | + | |
- | + | ||
- | To start the OpenVPN service | + | |
< | < | ||
- | # Start the OpenVPN Service | + | mkdir /run/openvpn/ |
- | if [ -x /etc/rc.d/rc.openvpn ]; then | + | chmod 700 /run/openvpn/ |
- | /etc/rc.d/rc.openvpn start | + | |
- | fi | + | |
</ | </ | ||
- | An alternate method (albeit less secure) is to remove the passphrase from server1.key | + | An alternate method (albeit less secure) is to remove the passphrase from '' |
< | < | ||
# cd / | # cd / | ||
# openssl rsa -in server1.key -out tmp.key | # openssl rsa -in server1.key -out tmp.key | ||
+ | </ | ||
+ | |||
+ | Enter the pass phrase. | ||
+ | |||
+ | < | ||
# mv tmp.key server1.key | # mv tmp.key server1.key | ||
# chmod 600 server1.key | # chmod 600 server1.key | ||
</ | </ | ||
+ | If you had them remove these lines from ''/ | ||
+ | |||
+ | < | ||
+ | askpass / | ||
+ | auth-nocache | ||
+ | </ | ||
+ | |||
+ | Similarly, this can be repeated for the Client: | ||
+ | |||
+ | < | ||
+ | # cd / | ||
+ | # openssl rsa -in client1.key -out tmp.key | ||
+ | </ | ||
+ | |||
+ | Enter the pass phrase. | ||
+ | |||
+ | < | ||
+ | # mv tmp.key client1.key | ||
+ | # chmod 600 client1.key | ||
+ | </ | ||
+ | |||
+ | Then, if you had it, remove this line from ''/ | ||
+ | |||
+ | < | ||
+ | askpass / | ||
+ | </ | ||
+ | |||
+ | If you intend to use the '' | ||
+ | |||
+ | < | ||
+ | mkdir / | ||
+ | chmod 700 / | ||
+ | chmod +x / | ||
+ | </ | ||
- | ===== 11. IP Routing ===== | + | ===== 12. IP Routing ===== |
Up to now we have created a tunnel device on both the Server and the Client called tun0 which is visible only to these two machines. However more work is needed to route the Client' | Up to now we have created a tunnel device on both the Server and the Client called tun0 which is visible only to these two machines. However more work is needed to route the Client' | ||
- | ==== 11.1 Server Configuration | + | ==== 12.1 IP Forwarding |
- | Enable | + | On the Server, enable |
< | < | ||
Line 491: | Line 473: | ||
</ | </ | ||
- | Create a file with the same name of the client (in this case client1) and enter the following line in / | + | Create a file with the same name of the client (in this case '' |
< | < | ||
Line 499: | Line 481: | ||
Replace 192.168.1.0 255.255.255.0 by the Network Route of your Client. | Replace 192.168.1.0 255.255.255.0 by the Network Route of your Client. | ||
- | Similarly edit / | + | Similarly edit '' |
< | < | ||
Line 514: | Line 496: | ||
Naturally replace 192.168.200.0 255.255.255.0 with the Server' | Naturally replace 192.168.200.0 255.255.255.0 with the Server' | ||
- | 208.67.222.222 and 208.67.220.220 are the OpenDNS | + | 208.67.222.222 and 208.67.220.220 are the OpenDNS |
<note warning> | <note warning> | ||
Line 530: | Line 512: | ||
Some users have reported that their Client' | Some users have reported that their Client' | ||
- | Next you will have to configure | + | Next you will have to configure NAT forwarding on the Server (only). |
+ | |||
+ | You can do this by means of iptables or the newer nftables (not both). | ||
+ | |||
+ | ==== 12.2 NAT forwarding with iptables ==== | ||
+ | |||
+ | Start by flushing the '' | ||
< | < | ||
- | # iptables -F | + | # /usr/sbin/iptables -F |
</ | </ | ||
Line 539: | Line 527: | ||
< | < | ||
- | # iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE | + | # /usr/sbin/iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE |
</ | </ | ||
- | On Slackware, such a line may be included in / | + | On Slackware, such a line may be included in '' |
The exact lines which you need to include depend on whether you already entered your own iptables filter chains and rules, but I will assume that that this is not the case. | The exact lines which you need to include depend on whether you already entered your own iptables filter chains and rules, but I will assume that that this is not the case. | ||
- | As already explained, as a minimum you only need to enter the following lines in / | + | As already explained, as a minimum you only need to enter the following lines in '' |
< | < | ||
Line 553: | Line 541: | ||
</ | </ | ||
- | If on the other hand you would like a better | + | Give the firewall '' |
- | + | ||
- | < | + | |
- | # | + | |
- | # Start/ | + | |
- | + | ||
- | IPT=/ | + | |
- | + | ||
- | firewall_start() { | + | |
- | + | ||
- | # flush the iptables | + | |
- | echo -e " | + | |
- | $IPT -F | + | |
- | + | ||
- | # policies | + | |
- | $IPT -P OUTPUT DROP | + | |
- | $IPT -P INPUT DROP | + | |
- | $IPT -P FORWARD DROP | + | |
- | + | ||
- | $IPT -N SERVICES # services is a custom chain | + | |
- | + | ||
- | # allowed output | + | |
- | $IPT -A OUTPUT -o lo -j ACCEPT | + | |
- | $IPT -A OUTPUT -o eth0 -j ACCEPT | + | |
- | $IPT -A OUTPUT -o tun0 -j ACCEPT | + | |
- | + | ||
- | # allowed inputs | + | |
- | #$IPT -A INPUT -i lo -j ACCEPT # uncomment if the host is a desktop | + | |
- | $IPT -A INPUT -m conntrack --ctstate ESTABLISHED, | + | |
- | $IPT -A INPUT -j SERVICES # append the services chain to the input | + | |
- | + | ||
- | # allowed forwarding for OpenVPN | + | |
- | $IPT -A FORWARD -i eth0 -o tun0 -m state --state ESTABLISHED, | + | |
- | $IPT -A FORWARD -s 10.8.0.0/24 -o eth0 -j ACCEPT | + | |
- | + | ||
- | # masquerade the OpenVPN network | + | |
- | $IPT -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE | + | |
- | + | ||
- | # allow sshd on the default tcp port 22 | + | |
- | #$IPT -A SERVICES -p tcp --dport 22 -j ACCEPT # Uncomment to allow sshd | + | |
- | + | ||
- | # allow OpenVPN for the default udp port 1194 | + | |
- | $IPT -A SERVICES -p udp --dport 1194 -j ACCEPT | + | |
- | + | ||
- | echo " | + | |
- | } | + | |
- | + | ||
- | firewall_stop() { | + | |
- | echo -e " | + | |
- | + | ||
- | # polcies (permissive) | + | |
- | $IPT -P OUTPUT ACCEPT | + | |
- | $IPT -P INPUT ACCEPT | + | |
- | $IPT -P FORWARD ACCEPT | + | |
- | + | ||
- | # flush the iptables | + | |
- | $IPT -F | + | |
- | + | ||
- | # delete the services custom chain | + | |
- | $IPT -X SERVICES | + | |
- | echo " | + | |
- | } | + | |
- | + | ||
- | firewall_status() { | + | |
- | $IPT -vL | + | |
- | } | + | |
- | + | ||
- | case " | + | |
- | 'start') | + | |
- | firewall_start | + | |
- | ;; | + | |
- | 'stop') | + | |
- | firewall_stop | + | |
- | ;; | + | |
- | ' | + | |
- | firewall_stop | + | |
- | firewall_start | + | |
- | ;; | + | |
- | ' | + | |
- | firewall_status | + | |
- | ;; | + | |
- | *) | + | |
- | echo "Usage $0 start|stop|restart|status" | + | |
- | esac | + | |
- | </ | + | |
- | + | ||
- | Give the firewall rc script executable permission: | + | |
< | < | ||
Line 663: | Line 565: | ||
</ | </ | ||
- | ===== 12. Firewalls ===== | + | ==== 12.3 NAT forwarding with nftables |
+ | |||
+ | If you prefer '' | ||
+ | |||
+ | < | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | </ | ||
- | In the previous chapter we referred to a firewall you may include to protect your OpenVPN Server. | + | ===== 13. Firewalls ===== |
- | In order to penetrate through the Client | + | You may find that on some networks, UDP port 1194 is blocked, and so the Client will be unable to connect. |
< | < | ||
Line 681: | Line 592: | ||
</ | </ | ||
- | and / | + | Also, comment out '' |
+ | |||
+ | You also have to modify your Router' | ||
+ | |||
+ | Edit '' | ||
< | < | ||
Line 697: | Line 612: | ||
</ | </ | ||
- | The Server' | + | ===== 14. Sources ===== |
- | + | ||
- | < | + | |
- | # allow vpn on the default udp port 1194 | + | |
- | $IPT -A SERVICES -p udp --dport 1194 -j ACCEPT | + | |
- | </ | + | |
- | + | ||
- | to: | + | |
- | + | ||
- | < | + | |
- | # allow vpn on the custom tcp port 443 | + | |
- | $IPT -A SERVICES -p tcp --dport 443 -j ACCEPT | + | |
- | </ | + | |
- | + | ||
- | You also have to modify your Router' | + | |
- | + | ||
- | ===== 13. Sources ===== | + | |
(1) http:// | (1) http:// | ||
Line 721: | Line 620: | ||
(3) http:// | (3) http:// | ||
- | (4) http://www.no-ip.com | + | (4) http://www.duckdns.org |
(5) http:// | (5) http:// | ||
- | | + | (6) https:// |
+ | |||
+ | | ||
* Originally written by [[wiki: | * Originally written by [[wiki: | ||
<!-- Please do not modify anything below, except adding new tags.--> | <!-- Please do not modify anything below, except adding new tags.--> | ||
{{tag> | {{tag> | ||
- |