返回列表 發帖

Openconnect VPN server implementation on OpenWRT router using certificate authentication

本帖最後由 tomleehk 於 2022-12-25 15:27 編輯

Successfully followed the below walkthrough to install and set up Openconnect VPN server on OpenWRT router using certificate authentication.
Proved default gateway re-direction working with CISCO Anyconnect client connection ( on IOS and Android ) and www.getip.com.

Original article :
http://blog.ltns.info/linux/open ... client_smart_proxy/
Updated : 08-Nov-2016
Original article updated with procedure to make OpenConnect able to run on OpenWRT ver.15.05.1 using certificate authentication.


Hardware :  LINKSYS WRT54GS : 8M Flash (This antique hardware is simply used for testing/practice)
O/S         :  openwrt-15.05-brcm47xx-legacy-linksys-wrt54gs-squashfs.bin <== downloaded at https://downloads.openwrt.org/   ( Chaos Calmer 15.05 )

Supplementary Note :
1) I selected Chaos Calmer 15.05 branch as it appeared to me that other branches failed to establish successful connection even using the simplest USER ID/Password authentication mode.
2) Other software need : SSL Toolkit for .p12 creation
                                     ( I used OpenSSL <= downloaded at https://www.openssl.org/community/binaries.html )
                                     SSH Client for OpenWRT file management
                                     ( I used WINSCP <= downloaded at https://winscp.net/eng/index.php
                                     SSH Client for terminal emulation
                                     ( I used OpenSSH <= downloaded at http://sshwindows.sourceforge.net/download/ )

OpenConnect installation/setup steps :
1) Install OpenWRT firmware and connect the router to internet
2) Use TelNet to access default server IP 192.168.1.1 and input the followings
    nvram set boot_wait=on
    nvram set boot_time=10
    nvram set wait_time=10
    nvram commit
    reboot  
    Remark : These are to facilitate firmware recovery in case your router is bricked.
3) Use TelNet to access default server IP 192.168.1.1 again and input the followings to install packages
    opkg update
    opkg install ocserv
    opkg install luci-app-ocserv   
    opkg install luci-app-ddns
4) Enable the packages via LUCI (Service/Dynamic DNS, Service/OpenConnect VPN) or at TelNet terminal with appropriate command
5) Set root password via LUCI (System/Administration) or via TelNet terminal.
    Note that once the root password is set, Telnet is no longer able to access the router. You need to use a tool such as OpenSSH to access the router and emulate the terminal command prompt.
6) Enable SSH via LUCI (System/Administration)
7) Make sure DDNS and OCSERV package is enabled (System/Startup) and reboot router
8) Configure DDNS via LUCI (Services/Dynamic DNS)
9) Configure Local Time zone via LUCI (System/System)
10) Use WINSCP to access 192.168.1.1 to edit template file /etc/ocserv/pki/server.tmpl
      cn=<Your VPN server URL, e.g. vpn.dyndns.org>   
      serial=2
      expiration_days=3650
      signing_key
      encryption_key
11) Use WINSCP to access 192.168.1.1  to edit template file /etc/ocserv/pki/ca.tmpl
      cn=<Your VPN server URL, e.g. vpn.dyndns.org>
      expiration_days=3650
      serial=1
      ca
      cert_signing_key
12) Then create the new ca.pem and server-cert.pem
      certtool --template /etc/ocserv/pki/ca.tmpl --generate-self-signed --load-privkey /etc/ocserv/ca-key.pem  --outfile /etc/ocserv/ca.pem
      certtool --template /etc/ocserv/pki/server.tmpl --generate-certificate --load-privkey /etc/ocserv/server-key.pem --load-ca-certificate /etc/ocserv/ca.pem --load-ca-privkey /etc/ocserv/ca-key.pem --outfile /etc/ocserv/server-cert.pem
13) Restart OCSERV via LUCI (System/Startup) or via OpenSSH (terminal emulation) with appropriate command.
14) Use WINSCP to access 192.168.1.1 and backup /etc/ocserv/ocserv.conf. Then replace /etc/ocserv/ocserv.conf with appropriate content. Sample shown below :
  1. auth = "certificate"
  2. listen-host-is-dyndns = true
  3. max-clients = 16
  4. max-same-clients = 10
  5. tcp-port = 443
  6. udp-port = 443
  7. keepalive = 32400
  8. dpd = 240
  9. mobile-dpd = 1800
  10. try-mtu-discovery = true
  11. server-cert = /etc/ocserv/server-cert.pem
  12. server-key = /etc/ocserv/server-key.pem
  13. ca-cert = /etc/ocserv/ca.pem
  14. cert-user-oid = 2.5.4.3
  15. tls-priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT"
  16. auth-timeout = 40
  17. cookie-timeout = 300
  18. rekey-time = 172800
  19. rekey-method = ssl
  20. connect-script = /usr/bin/ocserv-script
  21. disconnect-script = /usr/bin/ocserv-script
  22. use-utmp = true
  23. pid-file = /var/run/ocserv.pid
  24. chroot-dir = /var/lib/ocserv
  25. socket-file = ocserv-socket
  26. run-as-user = ocserv
  27. run-as-group = ocserv
  28. net-priority = 5
  29. cgroup = "cpuset,cpu:test"
  30. device = vpns
  31. default-domain = <your vpn server URL, e.g. vpn.dyndns.org>
  32. ipv4-network = 192.168.60.0
  33. ipv4-netmask = 255.255.255.0
  34. dns = 8.8.8.8
  35. ping-leases = false
  36. output-buffer = 10
  37. #route = 192.168.1.0/255.255.255.0
  38. #route = 192.168.5.0/255.255.255.0
  39. #route = fef4:db8:1000:1001::/64
  40. route-add-cmd = "ip route add %{R} dev %{D}"
  41. route-del-cmd = "ip route delete %{R} dev %{D}"
  42. cisco-client-compat = true
  43. custom-header = "X-DTLS-MTU: 1200"
  44. custom-header = "X-CSTP-MTU: 1200"
複製代碼
You may customize the content with reference to the original ocserv.conf that you just backup.

Important : Any typo and mistake made in this file may make your OpenConnect Server unable to be launched.

14) Make sure ocserv is enabled via LUCI (Service/Dynamic DNS/Server settings/General settings) and at the same screen input the configuration that matches the content of /etc/ocserv/ocserv.conf that you just modified.

15) Modify firewall rules via LUCI (Network/Firewall/Custom Rules)
      iptables -I INPUT -p tcp --dport 443 -j ACCEPT
      iptables -I INPUT -p udp --dport 443 -j ACCEPT
      iptables -I FORWARD -i vpns+ -s 192.168.60.0/24 -j ACCEPT
      iptables -I INPUT -i vpns+ -s 192.168.60.0/24 -j ACCEPT

16) Restart router and make sure your Openconnect Server can be up properly. If you can find the below 2 processes
      ocserv-main
      {ocserv-secmod} ocserv-secm
      
      at LUCI (Status/Processes), the Openconnect Server is launched properly.
      If Openconnect Server cannot be launched, review and troubleshoot your configuration.
17) Use WINSCP to access router 192.168.1.1 and create a new file  /etc/ocserv/pki/client.tmpl with the below content :
      cn = client
      unit = "users"
      expiration_days = 3650   
      signing_key
      tls_www_client
18) Use OpenSSH to access router 192.168.1.1 and input the followings  at the command prompt one by one.
      cd /etc/ocserv
      ln -s pki/ca.tmpl ca.tmpl            
      ln -s pki/server.tmpl server.tmpl
      ln -s ca.pem ca-cert.pem
      cp pki/client.tmpl client.tmpl

      certtool --generate-privkey --outfile user-key.pem

      certtool --generate-certificate --load-privkey user-key.pem --load-ca-certificate ca-cert.pem --load-ca-privkey ca-key.pem --template client.tmpl --outfile user-cert.pem
19) Use WINSCP to to access router 192.168.1.1 and extract the 3 files : user-key.pem, ca-cert.pem and user-cert.pem from /etc/ocserv to a certain folder on your computer.
      At the DOS prompt and change to the same folder, use SSL tool to create the file user-cert.p12.
      e.g.   c:\openssl-win32\bin\openssl pkcs12 -export -inkey user-key.pem -in user-cert.pem -name "client" -certfile ca-cert.pem -caname "VPN CA" -out user-cert.p12
      Remark : You may be prompted to create a password for the file user-cert.p12 during creation. Just input the password you desired when prompted.
20) Then load the user-cert.p12 to the Iphone or Android with the corresponding client (e.g. CISCO AnyCoonect) installed and make the corresponding connection profile configuration accordingly. When loading the certificate into your client, you will be promted for the password and you just need to input the password you captured in the above step. For this part, you can refer to google.

Comment :
1) Credit goes to the original developer.. (Not me!)
2) Before making any connection testing, make sure
     - root password at OpenWRT has been set.
     - DDNS is working and your VPN server URL has been updated properly.
     - NTP is running properly and your router is showing the correct date/time.
3) In addition to the backup of the OpenWRT server configuration via LUCI (System /Backup, Flash Firmware/Backup,Restore/Generate Archive), it is suggested to backup all the content at and below the folder /etc/ocserv/ after all tests are completed. This is to save time when you need to restore the server, you do not need to re-generate the certificate/key files again.
4) Even though the VPN connection is working properly, a number of error messages were still found at the OpenWRT system log when ocserv is launched. These are to be fine-tuned/studied if I have spare time.
5) If you prefer using the simplest ID/Password authentication method, simply make the corresponding VPN configuration via LUCI(Service/OpenConnect VPN/General Settings, User Settings) and Firewall(Network/Firewall/Custom Rules) and skip anything related to certificate, template files.
6) The antique hardware is simply used for testing/practice and faster equipment is more recommended for live running.

我猜 no-route 像 Split channel, 將no-route traffic 直接 轉到本地的 網路。

TOP

本帖最後由 tomleehk 於 2020-1-9 14:47 編輯

無用過, 我唔會留喺固定地區用vpn..

TOP

本帖最後由 yiucsw 於 2020-1-9 14:03 編輯

想在ocserv.conf 加 no-route. 用後是不是本地website不用route vpn?
改善原因:主要是國內的bandwidth 太少10Mbps,wechat video 有問題。

https://github.com/wppurking/ocs ... /ocserv/ocserv.conf

no-route = 192.168.0.0/255.255.0.0
no-route = 1.0.0.0/255.192.0.0
no-route = 1.64.0.0/255.224.0.0
no-route = 1.112.0.0/255.248.0.0
no-route = 1.176.0.0/255.240.0.0
no-route = 1.192.0.0/255.240.0.0
no-route = 14.0.0.0/255.224.0.0
no-route = 14.96.0.0/255.224.0.0
no-route = 14.128.0.0/255.224.0.0
no-route = 14.192.0.0/255.224.0.0
no-route = 27.0.0.0/255.192.0.0
no-route = 27.96.0.0/255.224.0.0
no-route = 27.128.0.0/255.224.0.0
no-route = 27.176.0.0/255.240.0.0
no-route = 27.192.0.0/255.224.0.0
no-route = 27.224.0.0/255.252.0.0
no-route = 36.0.0.0/255.192.0.0
no-route = 36.96.0.0/255.224.0.0
no-route = 36.128.0.0/255.192.0.0
no-route = 36.192.0.0/255.224.0.0
no-route = 36.240.0.0/255.240.0.0
no-route = 39.0.0.0/255.255.0.0
no-route = 39.64.0.0/255.224.0.0
no-route = 39.96.0.0/255.240.0.0
no-route = 39.128.0.0/255.192.0.0
no-route = 40.72.0.0/255.254.0.0
no-route = 40.124.0.0/255.252.0.0
no-route = 42.0.0.0/255.248.0.0
no-route = 42.48.0.0/255.240.0.0
no-route = 42.80.0.0/255.240.0.0
no-route = 42.96.0.0/255.224.0.0
no-route = 42.128.0.0/255.128.0.0
no-route = 43.224.0.0/255.224.0.0
no-route = 45.3.32.0/255.255.224.0
no-route = 45.65.16.0/255.255.240.0
no-route = 45.78.80.0/255.255.240.0
no-route = 45.112.0.0/255.240.0.0
no-route = 45.248.0.0/255.248.0.0
no-route = 47.92.0.0/255.252.0.0
no-route = 47.96.0.0/255.224.0.0
no-route = 49.0.0.0/255.128.0.0
no-route = 49.128.0.0/255.224.0.0
no-route = 49.192.0.0/255.192.0.0
no-route = 52.80.0.0/255.252.0.0
no-route = 54.222.0.0/255.254.0.0
no-route = 58.0.0.0/255.128.0.0
no-route = 58.128.0.0/255.224.0.0
no-route = 58.192.0.0/255.224.0.0
no-route = 58.240.0.0/255.240.0.0
no-route = 59.32.0.0/255.224.0.0
no-route = 59.64.0.0/255.224.0.0
no-route = 59.96.0.0/255.240.0.0
no-route = 59.144.0.0/255.240.0.0
no-route = 59.160.0.0/255.224.0.0
no-route = 59.192.0.0/255.192.0.0
no-route = 60.0.0.0/255.224.0.0
no-route = 60.48.0.0/255.240.0.0
no-route = 60.160.0.0/255.224.0.0
no-route = 60.192.0.0/255.192.0.0
no-route = 61.0.0.0/255.192.0.0
no-route = 61.80.0.0/255.248.0.0
no-route = 61.128.0.0/255.192.0.0
no-route = 61.224.0.0/255.224.0.0
no-route = 91.234.36.0/255.255.255.0
no-route = 101.0.0.0/255.128.0.0
no-route = 101.128.0.0/255.224.0.0
no-route = 101.192.0.0/255.240.0.0
no-route = 101.224.0.0/255.224.0.0
no-route = 103.0.0.0/255.0.0.0
no-route = 104.167.16.0/255.255.240.0
no-route = 104.207.32.0/255.255.224.0
no-route = 106.0.0.0/255.128.0.0
no-route = 106.224.0.0/255.240.0.0
no-route = 110.0.0.0/255.128.0.0
no-route = 110.144.0.0/255.240.0.0
no-route = 110.160.0.0/255.224.0.0
no-route = 110.192.0.0/255.192.0.0
no-route = 111.0.0.0/255.192.0.0
no-route = 111.64.0.0/255.224.0.0
no-route = 111.112.0.0/255.240.0.0
no-route = 111.128.0.0/255.192.0.0
no-route = 111.192.0.0/255.224.0.0
no-route = 111.224.0.0/255.240.0.0
no-route = 112.0.0.0/255.128.0.0
no-route = 112.128.0.0/255.240.0.0
no-route = 112.192.0.0/255.252.0.0
no-route = 112.224.0.0/255.224.0.0
no-route = 113.0.0.0/255.128.0.0
no-route = 113.128.0.0/255.240.0.0
no-route = 113.192.0.0/255.192.0.0
no-route = 114.16.0.0/255.240.0.0
no-route = 114.48.0.0/255.240.0.0
no-route = 114.64.0.0/255.192.0.0
no-route = 114.128.0.0/255.240.0.0
no-route = 114.192.0.0/255.192.0.0
no-route = 115.0.0.0/255.0.0.0
no-route = 116.0.0.0/255.0.0.0
no-route = 117.0.0.0/255.128.0.0
no-route = 117.128.0.0/255.192.0.0
no-route = 118.16.0.0/255.240.0.0
no-route = 118.64.0.0/255.192.0.0
no-route = 118.128.0.0/255.128.0.0
no-route = 119.0.0.0/255.128.0.0
no-route = 119.128.0.0/255.192.0.0
no-route = 119.224.0.0/255.224.0.0
no-route = 120.0.0.0/255.192.0.0
no-route = 120.64.0.0/255.224.0.0
no-route = 120.128.0.0/255.240.0.0
no-route = 120.192.0.0/255.192.0.0
no-route = 121.0.0.0/255.128.0.0
no-route = 121.192.0.0/255.192.0.0
no-route = 122.0.0.0/254.0.0.0
no-route = 124.0.0.0/255.0.0.0
no-route = 125.0.0.0/255.128.0.0
no-route = 125.160.0.0/255.224.0.0
no-route = 125.192.0.0/255.192.0.0
no-route = 137.59.59.0/255.255.255.0
no-route = 137.59.88.0/255.255.252.0
no-route = 139.0.0.0/255.224.0.0
no-route = 139.128.0.0/255.128.0.0
no-route = 140.64.0.0/255.240.0.0
no-route = 140.128.0.0/255.240.0.0
no-route = 140.192.0.0/255.192.0.0
no-route = 144.0.0.0/255.248.0.0
no-route = 144.12.0.0/255.255.0.0
no-route = 144.48.0.0/255.248.0.0
no-route = 144.123.0.0/255.255.0.0
no-route = 144.255.0.0/255.255.0.0
no-route = 146.196.0.0/255.255.128.0
no-route = 150.0.0.0/255.255.0.0
no-route = 150.96.0.0/255.224.0.0
no-route = 150.128.0.0/255.240.0.0
no-route = 150.192.0.0/255.192.0.0
no-route = 152.104.128.0/255.255.128.0
no-route = 153.0.0.0/255.192.0.0
no-route = 153.96.0.0/255.224.0.0
no-route = 157.0.0.0/255.255.0.0
no-route = 157.18.0.0/255.255.0.0
no-route = 157.61.0.0/255.255.0.0
no-route = 157.112.0.0/255.240.0.0
no-route = 157.144.0.0/255.240.0.0
no-route = 157.255.0.0/255.255.0.0
no-route = 159.226.0.0/255.255.0.0
no-route = 160.19.208.0/255.255.240.0
no-route = 160.20.48.0/255.255.252.0
no-route = 160.202.0.0/255.255.0.0
no-route = 160.238.64.0/255.255.252.0
no-route = 161.207.0.0/255.255.0.0
no-route = 162.105.0.0/255.255.0.0
no-route = 163.0.0.0/255.192.0.0
no-route = 163.96.0.0/255.224.0.0
no-route = 163.128.0.0/255.192.0.0
no-route = 163.192.0.0/255.224.0.0
no-route = 166.111.0.0/255.255.0.0
no-route = 167.139.0.0/255.255.0.0
no-route = 167.189.0.0/255.255.0.0
no-route = 167.220.244.0/255.255.252.0
no-route = 168.160.0.0/255.255.0.0
no-route = 170.179.0.0/255.255.0.0
no-route = 171.0.0.0/255.128.0.0
no-route = 171.192.0.0/255.224.0.0
no-route = 175.0.0.0/255.128.0.0
no-route = 175.128.0.0/255.192.0.0
no-route = 180.64.0.0/255.192.0.0
no-route = 180.128.0.0/255.128.0.0
no-route = 182.0.0.0/255.0.0.0
no-route = 183.0.0.0/255.192.0.0
no-route = 183.64.0.0/255.224.0.0
no-route = 183.128.0.0/255.128.0.0
no-route = 192.124.154.0/255.255.255.0
no-route = 192.140.128.0/255.255.128.0
no-route = 202.0.0.0/255.128.0.0
no-route = 202.128.0.0/255.192.0.0
no-route = 202.192.0.0/255.224.0.0
no-route = 203.0.0.0/255.0.0.0
no-route = 210.0.0.0/255.192.0.0
no-route = 210.64.0.0/255.224.0.0
no-route = 210.160.0.0/255.224.0.0
no-route = 210.192.0.0/255.224.0.0
no-route = 211.64.0.0/255.248.0.0
no-route = 211.80.0.0/255.240.0.0
no-route = 211.96.0.0/255.248.0.0
no-route = 211.136.0.0/255.248.0.0
no-route = 211.144.0.0/255.240.0.0
no-route = 211.160.0.0/255.248.0.0
no-route = 218.0.0.0/255.128.0.0
no-route = 218.160.0.0/255.224.0.0
no-route = 218.192.0.0/255.192.0.0
no-route = 219.64.0.0/255.224.0.0
no-route = 219.128.0.0/255.224.0.0
no-route = 219.192.0.0/255.192.0.0
no-route = 220.96.0.0/255.224.0.0
no-route = 220.128.0.0/255.128.0.0
no-route = 221.0.0.0/255.224.0.0
no-route = 221.96.0.0/255.224.0.0
no-route = 221.128.0.0/255.128.0.0
no-route = 222.0.0.0/255.0.0.0
no-route = 223.0.0.0/255.224.0.0
no-route = 223.64.0.0/255.192.0.0
no-route = 223.128.0.0/255.128.0.0

TOP

本帖最後由 tomleehk 於 2020-1-2 00:14 編輯

可以唔同devices 同時使用同一個client.p12連到server

留意server config 有句
max-same-clients = 10

TOP

在 Step 17. Create client .p12, 是不是每一個Client create 改 cn=client ? cn= client1.... 可不可以重用一個Client .p12?
17)  /etc/ocserv/pki/client.tmpl
      cn = client
      unit = "users"
      expiration_days = 3650   
      signing_key
      tls_www_client

TOP

明白,比較麻煩,沒有國內Public IP, 不能安裝 Openconnect server.
現在在iphone/ipad 加 CISCO anyconnect.
For 新版Ipad anyconnect client 加certifcation.
ipad 打開 email, 長按 .p12 attachment, share to anyconnect.
在ios section.
https://www.linuxbabe.com/ubuntu ... t-vpn-server-ocserv

TOP

本帖最後由 tomleehk 於 2019-12-30 13:40 編輯

ocserv server 是 server, client 是 client, client 是不能被remote access
解決方法喺router同時安裝client + server, 你remote access ocserv server, 就可以連到router, 間接config client 部分

用SIM 卡上網,就算見到有真IP, 只代表機樓/發射站, 不代表你手機

TOP

本帖最後由 yiucsw 於 2019-12-30 11:35 編輯

最近启动V2ray server, 所以要起openconnect server,有问题時可以用openconnect client. 想問能否remote access openconnect client's router(安裝在openwrt-openconnect client) 來解决问题。
在 /etc/init.d/ocserv 内 start_service 加了 Sleep 20 没有帮助。
在luci->system-startup-local startup, 加了 (sleep 11; /etc/init.d/ocserv start)&  看到2 process, 但不能access server,
最终,在luci->system-startup-local startup 加了 (sleep 30; ocserv )& 现在能access openconnect server.
我想 access 國內的 openwrt-openconnect client, 是不是可以的?
有沒有 openwrt firewall 能參考以下,我嘗試加firewall zone, interface 不能啟動。

現在國內用聯通的SIM 卡上網,是否有真IP?

TOP

本帖最後由 tomleehk 於 2019-12-30 00:48 編輯

之前d舊openwrt vesion 印象中未試過有開機startup問題
近來version 18.06.1  至 18.06.5 都沒有遇過開機startup 問題, 無加過sleep..
/etc/init.d/ocserv enable <<enter>>
就喺去enable 個startup
我一直有用luci-app-ocserv, luci 有個enable option, 不肯定有無關係

TOP

本帖最後由 yiucsw 於 2019-12-30 01:21 編輯

發現 reboot 後,ocserv 不能startup.
要加: (sleep 11; /etc/init.d/ocserv start)&
https://cndaqiang.github.io/2017/09/27/openwrt-ocserv/

System log error:
daemon.info ocserv[2670]: sec-mod: reading supplemental config from files
daemon.info ocserv[2670]: sec-mod: sec-mod initialized (socket: /var/run/ocserv-socket.4955d7de)

最終加多一句 在 system-startup-local startup.
(sleep 30; ocserv )&

TOP

本帖最後由 tomleehk 於 2016-11-9 00:13 編輯

更新 : 09-Nov-2016

參考原文 : http://blog.ltns.info/linux/open ... client_smart_proxy/

2016.09.16 更新
2016.10.24 更新
章節



成功更新至OpenWRT ver.15.05.1及使用證書認證去行 Open Connect
1) 無重新create 任何 pem, p12 file, 只喺重用15.05 work緊嗰一批files
2) 編輯啟動腳本 /etc/init.d/dnsmasq,註釋掉或刪掉對應的如下一行
...
        append_bool "$cfg" proxydnssec "--proxy-dnssec"
        # append_bool "$cfg" localservice "--local-service"
        append_bool "$cfg" quietdhcp "--quiet-dhcp"
...
3) 改用新版本的 ocserv配置文件
  1. auth = "certificate"
  2. listen-host-is-dyndns = true
  3. max-clients = 16
  4. max-same-clients = 10
  5. tcp-port = 443
  6. udp-port = 443
  7. keepalive = 32400
  8. dpd = 240
  9. mobile-dpd = 1800
  10. try-mtu-discovery = true
  11. server-cert = /etc/ocserv/server-cert.pem
  12. server-key = /etc/ocserv/server-key.pem
  13. ca-cert = /etc/ocserv/ca-cert.pem
  14. cert-user-oid = 2.5.4.3
  15. #cert-group-oid = 2.5.4.11
  16. tls-priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT:-VERS-SSL3.0"
  17. auth-timeout = 40
  18. mobile-idle-timeout
  19. cookie-timeout = 86400000
  20. rekey-time = 86400000
  21. rekey-method = ssl
  22. #connect-script = /etc/ocserv/connect-script
  23. #disconnect-script = /etc/ocserv/connect-script
  24. use-utmp = true
  25. use-occtl = true
  26. pid-file = /var/run/ocserv.pid
  27. socket-file = /var/run/ocserv-socket
  28. run-as-user = ocserv
  29. run-as-group = ocserv
  30. net-priority = 5
  31. cgroup = "cpuset,cpu:test"
  32. device = vpns
  33. default-domain = <your vpn server URL, e.g. vpn.dyndns.org>
  34. ipv4-network = 192.168.60.1
  35. ipv4-netmask = 255.255.255.0
  36. dns = 8.8.8.8
  37. ping-leases = false
  38. output-buffer = 10
  39. #route = ip
  40. route-add-cmd = "ip route add %{R} dev %{D}"
  41. route-del-cmd = "ip route delete %{R} dev %{D}"
  42. cisco-client-compat =true
  43. custom-header = "X-DTLS-MTU: 1200"
  44. custom-header = "X-CSTP-MTU: 1200"
複製代碼
無用connect-script, disconnect-script

4) 修改 /etc/init.d/ocserv
.....
     SERVICE_USE_PID=1
     START=97
     setup_config() {
.....

重新 enable ocserv

TOP

本帖最後由 tomleehk 於 2016-4-4 22:40 編輯
Ching,我係用OpenWrt Chaos Calmer 15.05。
gameplayer 發表於 2016-4-4 20:21



如果用緊  Chaos Calmer 15.05, 就要review多一次D設定嘅steps..

或者試吓用 user ID/Password authentication 嘅方法...

TOP

你用邊個OpenWRT version先 ?

15.05.1(Released: Mon, 16 Mar 2016) 定喺 15.05 ?

15.05.1(Released: Mo ...
tomleehk 發表於 2016-3-30 23:55



    Ching,我係用OpenWrt Chaos Calmer 15.05。

TOP

本帖最後由 tomleehk 於 2016-4-4 17:34 編輯
回復  tomleehk

但發現D router 都幾耐用,我N年前部asus 520GU依然用得,奈何只有16M ram,跑openwrt超lag....

cyruschan112 發表於 2016-4-4 14:48


我嘅router hardware 好小小, CPU 300MHz, 8M Rom + 32M RAM, gigabit LAN/WAN

OpenWRT 嘅 GUI 都喺有D Lag, 但可以接受,反正config 嘅嘢set好咗試好咗之後好少改..

但如果client 嘅 network 得4Mb , 升級router都唔會改善得好多囉..

Router一般真好耐用,我一次都未試過壞,只喺壞過兩,三次牛..

TOP

返回列表