This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
picoenterprise:openvpn [2013/12/01 15:10] Olivier Brugman [install openvpn server] |
picoenterprise:openvpn [2013/12/01 18:57] (current) Olivier Brugman [configuration openvpn server] |
||
|---|---|---|---|
| Line 62: | Line 62: | ||
| cd /etc/openvpn/easy-rsa/2.0/keys/ | cd /etc/openvpn/easy-rsa/2.0/keys/ | ||
| openvpn --genkey --secret ta.key | openvpn --genkey --secret ta.key | ||
| + | |||
| + | |||
| + | Openvpn stores the IP addresses it dynamically assignes to clients in a file (cfm. the 'ifconfig-pool-persist' directive in server.conf as described in the next chapter): | ||
| + | |||
| + | cd /etc/openvpn | ||
| + | touch ipp.txt | ||
| + | chown nobody.nogroup ipp.txt | ||
| + | |||
| + | Create an openvpn status log file: | ||
| + | |||
| + | touch openvpn-status.log | ||
| + | |||
| + | |||
| + | In order to harden the security level of our openvpn server, we'll tell openvpn to run chrooted in subdirectory /etc/openvpn/jail | ||
| + | Openvpn needs access to /dev and /tmp directories within the chroot. | ||
| + | |||
| + | mkdir -p /etc/openvpn/jail/dev | ||
| + | mkdir -p /etc/openvpn/jail/tmp | ||
| + | chown -R nobody.nogroup /etc/openvpn/jail/tmp | ||
| + | chmod -R 770 /etc/openvpn/jail/tmp | ||
| + | |||
| + | As soon as openvpn will run chrooted, it can't open new file handles outside the chroot. So we'll configure rsyslog to add a socket for logging within the openvpn chroot. | ||
| + | |||
| + | echo '$AddUnixListenSocket /etc/openvpn/jail/dev/log' > /etc/rsyslog.d/openvpn.conf | ||
| + | |||
| + | service rsyslog restart | ||
| + | |||
| ====configuration openvpn server==== | ====configuration openvpn server==== | ||
| Line 98: | Line 125: | ||
| </code> | </code> | ||
| - | + | Now our openvpn server setup should be ready! Restart the service: | |
| - | Openvpn stores the IP addresses it dynamically assignes to clients in a file (cfm. the 'ifconfig-pool-persist' directive in server.conf): | + | |
| - | + | ||
| - | cd /etc/openvpn | + | |
| - | touch ipp.txt | + | |
| - | chown nobody.nogroup ipp.txt | + | |
| - | + | ||
| - | Create an openvpn status log file: | + | |
| - | + | ||
| - | touch openvpn-status.log | + | |
| - | + | ||
| - | + | ||
| - | In order to harden the security level of our openvpn server, we'll tell openvpn to run chrooted in subdirectory /etc/openvpn/jail | + | |
| - | Openvpn needs access to /dev and /tmp directories within the chroot. | + | |
| - | + | ||
| - | mkdir -p /etc/openvpn/jail/dev | + | |
| - | mkdir -p /etc/openvpn/jail/tmp | + | |
| - | chown -R nobody.nogroup /etc/openvpn/jail/tmp | + | |
| - | chmod -R 770 /etc/openvpn/jail/tmp | + | |
| - | + | ||
| - | As soon as openvpn will run chrooted, it can't open new file handles outside the chroot. So we'll configure rsyslog to add a socket for logging within the openvpn chroot. | + | |
| - | + | ||
| - | echo '$AddUnixListenSocket /etc/openvpn/jail/dev/log' > /etc/rsyslog.d/openvpn.conf | + | |
| - | + | ||
| - | service rsyslog restart | + | |
| - | + | ||
| - | + | ||
| - | Now our openvpn server configuration should be ready! Restart the service: | + | |
| service openvpn restart | service openvpn restart | ||