Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:services:vpn:openconnect:server [2023/03/15 03:09] – [Command-line instructions] vgaeteradocs:guide-user:services:vpn:openconnect:server [2023/03/25 10:46] – [2. Key management] vgaetera
Line 12: Line 12:
 ==== 1. Preparation ==== ==== 1. Preparation ====
 Install the required packages. Install the required packages.
-Generate client [[docs:guide-user:services:vpn:openconnect:extras#password_hash|password hash]] on VPN server. +Specify configuration parameters for VPN server.
-Specify the VPN server configuration parameters.+
  
 <code bash> <code bash>
Line 24: Line 23:
 VPN_POOL="192.168.7.0 255.255.255.0" VPN_POOL="192.168.7.0 255.255.255.0"
 VPN_DNS="${VPN_POOL%.* *}.1" VPN_DNS="${VPN_POOL%.* *}.1"
-VPN_HASH="$(cat ocpass.hash)"+VPN_USER="USERNAME" 
 +VPN_PASS="PASSWORD"
 </code> </code>
  
-==== 2. Firewall ====+==== 2. Key management ==== 
 +Generate password hash for VPN client. 
 + 
 +<code bash> 
 +# Generate password hash 
 +ocpasswd ${VPN_USER} << EOI 
 +${VPN_PASS} 
 +${VPN_PASS} 
 +EOI 
 +VPN_HASH="$(sed -n -e "/^${VPN_USER}:.*:/s///p" /etc/ocserv/ocpasswd)" 
 +</code> 
 + 
 +==== 3. Firewall ====
 Consider VPN network as private. Consider VPN network as private.
 Assign VPN interface to LAN zone to minimize firewall setup. Assign VPN interface to LAN zone to minimize firewall setup.
Line 49: Line 61:
 </code> </code>
  
-==== 3. VPN service ====+==== 4. VPN service ====
 Configure VPN service. Configure VPN service.
  
Line 65: Line 77:
 uci -q delete ocserv.@ocservusers[0] uci -q delete ocserv.@ocservusers[0]
 uci set ocserv.client="ocservusers" uci set ocserv.client="ocservusers"
-uci set ocserv.client.name="${VPN_HASH%%:*}" +uci set ocserv.client.name="${VPN_USER}" 
-uci set ocserv.client.password="${VPN_HASH##*:}"+uci set ocserv.client.password="${VPN_HASH}"
 uci commit ocserv uci commit ocserv
 /etc/init.d/ocserv restart /etc/init.d/ocserv restart
  • Last modified: 2024/10/17 17:27
  • by andrewz