返回列表 發帖

Installation of Openconnect Server on QNAP NAS Virtualisation Station

本帖最後由 角色 於 2018-9-13 07:13 編輯

因为之前有位member [1] 提及过逗比根据地 [2], 里面有提及过怎样一键安装Openconnect server [3,4].

由于我在香港有一台QNAP NAS TS-453 Pro (Intel-based J1900 CPU,有Virtualisation Station and Container Station),在Virtualisation Station安装Debian 8.11. 然后按照一键安装方法下载和安装Openconnect server,整个流程也非常简单。

Reference:
[1] http://www.telecom-cafe.com/foru ... =7177&pid=45276
[2] https://doub.io/
[3] https://doub.io/vpnzy-7/
[4] http://www.telecom-cafe.com/foru ... =7177&pid=45273

AnyConnect Client Manual
https://www.cisco.com/c/en/us/su ... ser-guide-list.html

Cisco AnyConnect Client Administrator Guide
https://www.cisco.com/c/en/us/su ... on-guides-list.html

从下面的link,如果用Cisco AnyConnect client是不可以把所有traffic都送到remote gateway,解决方法是用OpenConnet Client,而不是AnyConnect。
https://medium.com/@acecilia/how ... u-cant-a6a1ea1f4a58

========== 安装后遇到的问题 ==================
用Cisco Anyconnect Client连接Openconnect Server后,有些网站打不开,例如MyTV Super就能发现我用VPN,而用PPTP就没有这个问题,看起来Cisco Anyconnect没有把所有Traffic都push 到对方的Gateway。如果哪位members知道解决方法,请留言,谢谢。

终于知道答案: 就是把/etc/ocserv/ocscer.conf的所有“no-route = xxx.xxx.xxx.xxx/netmask"产走。

回復 17# 角色

openwrt平台 亦都要將 openconnect server  上嘅 config file 裏面嘅routing 全部remove 或者 remark 咗佢

TOP

回復 14# tomleehk

谢谢CHing的信息,可能版本不一样。我的就把所有no-route删去就可以了。

TOP

本帖最後由 角色 於 2018-9-13 16:22 編輯

如果你看不到MyTV Super,RTHK TV,那么就把所有no-routes都delete掉,就可以。
  1. auth = "plain[passwd=/etc/ocserv/ocpasswd]"
  2. # listen-host = [IP|HOSTNAME]
  3. tcp-port = 443
  4. udp-port = 443
  5. run-as-user = nobody
  6. run-as-group = daemon
  7. socket-file = /var/run/ocserv-socket
  8. server-cert = /etc/ocserv/ssl/server-cert.pem
  9. server-key = /etc/ocserv/ssl/server-key.pem
  10. ca-cert = /etc/ocserv/ssl/ca-cert.pem
  11. isolate-workers = true
  12. banner = "Welcome DOUB.IO"
  13. max-clients = 0
  14. max-same-clients = 0
  15. rate-limit-ms = 0
  16. server-stats-reset-time = 604800
  17. keepalive = 32400
  18. dpd = 90
  19. mobile-dpd = 1800
  20. switch-to-tcp-timeout = 25
  21. try-mtu-discovery = false
  22. tls-priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT:-VERS-SSL3.0"
  23. auth-timeout = 240
  24. idle-timeout = 86400
  25. mobile-idle-timeout = 86400
  26. min-reauth-time = 300
  27. max-ban-score = 80
  28. ban-reset-time = 1200
  29. cookie-timeout = 300
  30. deny-roaming = false
  31. rekey-time = 172800
  32. rekey-method = ssl
  33. use-occtl = true
  34. pid-file = /var/run/ocserv.pid
  35. net-priority = 6
  36. device = vpns
  37. predictable-ips = trueipv4-network = 192.168.1.0
  38. ipv4-netmask = 255.255.255.0
  39. # An alternative way of specifying the network:
  40. #ipv4-network = 192.168.1.0/24
  41. # The IPv6 subnet that leases will be given from.
  42. #ipv6-network = fda9:4efe:7e3b:03ea::/48
  43. # Specify the size of the network to provide to clients. It is
  44. # generally recommended to provide clients with a /64 network in
  45. # IPv6, but any subnet may be specified. To provide clients only
  46. # with a single IP use the prefix 128.
  47. #ipv6-subnet-prefix = 128
  48. #ipv6-subnet-prefix = 64

  49. # tunnel-all-dns = true
  50. dns = 8.8.8.8
  51. dns = 8.8.4.4
  52. ping-leases = false

  53. # Beginning of no-route, the following no-routes will be pushed to the client when connected. If all no-routes are removed, then all the traffic will be directed the remote gateway, i.e., Openconnect server gateway
  54. #no-route = 1.0.0.0/255.192.0.0
  55. #no-route = 1.64.0.0/255.224.0.0
  56. #no-route = 1.112.0.0/255.248.0.0
  57. #***
  58. #***
  59. #***
  60. #no-route = 223.0.0.0/255.224.0.0
  61. #no-route = 223.64.0.0/255.192.0.0
  62. #no-route = 223.128.0.0/255.128.0.0
  63. # End of no-route

  64. cisco-client-compat = true
  65. dtls-legacy = true
  66. default-domain = example.com
複製代碼

TOP

回復 14# tomleehk

能显示香港IP。

Cisco AnyConnect Client有个routing table,如果不在list的IP就走香港的Gateway。

TOP

本帖最後由 tomleehk 於 2018-8-30 17:05 編輯

現在不能試,因正處於香港

但你用Anyconnect連接server之後,用browser開whatismyipaddress com, 確認可以出到香港ip?

ocserv.conf 裡面
route = ip...
route = ip...
route = ip...

可以試吓全部清除, 一句不留

我嘅config一句不留, 全部 target ip 經openconnect server 出去 target ip

TOP

本帖最後由 角色 於 2018-8-30 14:31 編輯

如果十这样可能十OpenConnect  Server的settings不一样,我用default的,可能需要更改一下才能正常看。

下面的RTHK网站,用v2ray能打开,用OpenConnect就打不开。

http://www.rthk.hk/

你的OpenConnect Server + Cisco AnyConnect Client是否能打开?

TOP

我在免费区看,出来的结果如下:



不知道CHing你是否能看到,而且没有上面的message?
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

TOP

本帖最後由 tomleehk 於 2018-8-30 14:11 編輯

亦不是trusted cert , 只喺普通self signed

安裝過程就喺之前Post 過

喺外地如果唔Connect server,mytv client當然喺會出類似外地不能觀看嘅message,一旦connect 之後就可以正常觀看

TOP

那就奇怪,我的cert不是trusted,难度不是trusted,routing就有区别?

CHing,你的cert是trusted吗?

TOP

本帖最後由 tomleehk 於 2018-8-30 11:04 編輯

奇怪了..

我用Cisco Anyconnect + Openconnect server 這組合在外地看 myTV 或 之後嘅myTV  super 用了多年, ー直可以成功看到

openconnect server 在 openwrt上安裝
行cert 走443port
Cisco Anyconnect client ( IOS, Android, Windows )

TOP

虽然public的Cisco AnyConnect client有很多pre-set settings,对于完全翻墙是行不通的,但是一般用是可以的,还有是非常稳定。OpenConnect Server是有OpenConnect client,但是需要自己compile才可以。

有个后背的OpenConnect Server + Cisco AnyConnect Client是不错的选择。至于Cisco AnyConnect client是否可以更改settings,是可以的,但是要subscribe Cisco AnyConnect service, 这对于我们来说,根本没有可能,所以大家都别想,除非是公司去subscribe。

TOP

用Openconnect Server + Cisco AnyConnect Client不能打开的网站:

1. http://www.rthk.hk/
2. https://www.mingpao.com/
3. 在myTV Super不能观看免费区的节目

如果您知道怎样解救,欢迎跟帖指教。

TOP

本帖最後由 角色 於 2018-8-27 01:23 編輯

如果要熟悉Openconnect,我们就需要认识ocserv.conf,下面有不同的samples

Sample 1:
https://gist.github.com/wongsyrone/55165ce767f7248656cc

Sample 2:
https://ocserv.gitlab.io/www/rec ... guration-basic.html

Sample 3:
http://www.mmcaijing.com/25859.html

TOP

本帖最後由 角色 於 2018-8-26 23:45 編輯

安装完,有的时候修改ocserv.conf,然后重新启动。下面有不同的commands。
  1. /etc/init.d/ocserv start
  2. # 启动 ocserv
  3. /etc/init.d/ocserv stop
  4. # 停止 ocserv
  5. /etc/init.d/ocserv restart
  6. # 重启 ocserv
  7. /etc/init.d/ocserv status
  8. # 查看 ocserv 运行状态
  9. /etc/init.d/ocserv log
  10. # 查看 ocserv 运行日志
  11. /etc/init.d/ocserv test
  12. # 测试 ocserv 配置文件是否正确
複製代碼
#

我没有用上面的commands,而用
  1. 启动系统 service ocserv start
複製代碼

TOP

返回列表