You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.6 KiB

  1. The openconnect server expects to be configured using the uci interface.
  2. It is recommended to setup a dynamic DNS address with openwrt prior
  3. to starting the server. That is because during the first startup
  4. a certificate file which contain the setup dynamic DNS name will be
  5. created.
  6. To setup a server the provides access to LAN with network address
  7. 10.100.2.0/255.255.255.0 using the VPN address range
  8. 10.100.3.0/255.255.255.0 add the following to /etc/config/ocserv:
  9. ----/etc/config/ocserv-------------------------------------------
  10. config ocserv 'config'
  11. option port '4443'
  12. option dpd '120'
  13. option max_clients '8'
  14. option max_same '2'
  15. option netmask '255.255.255.0'
  16. option ipaddr '10.100.3.0'
  17. option auth 'plain'
  18. option zone 'vpn'
  19. option default_domain 'lan'
  20. option compression '1'
  21. option enable '1'
  22. config dns
  23. option ip '10.100.2.1'
  24. config routes
  25. option ip '10.100.2.0'
  26. option netmask '255.255.255.0'
  27. config ocservusers
  28. option name 'test'
  29. option password '$5$unl8uKAGNsdTh9zm$PnUHEGhDc5VHbFE2EfWwW38Bub6Y6EZ5hrFwZE1r2F1'
  30. -----------------------------------------------------------------
  31. This configuration also adds the user "test" with password "test". The
  32. password is specified in the crypt(3) format.
  33. The server can be enabled and started using:
  34. # /etc/init.d/ocserv enable
  35. # /etc/init.d/ocserv start
  36. To simplify firewall configuration, you should setup an unmanaged interface
  37. (e.g., called vpn), and will have assigned the 'vpns+' interfaces. Then a zone
  38. called vpn should be setup to handle interactions with lan. An example
  39. follows:
  40. ----/etc/config/network------------------------------------------
  41. config interface 'vpn'
  42. option proto 'none'
  43. option ifname 'vpns+'
  44. -----------------------------------------------------------------
  45. ----/etc/config/firewall-----------------------------------------
  46. config zone
  47. option input 'ACCEPT'
  48. option forward 'REJECT'
  49. option output 'ACCEPT'
  50. option name 'vpn'
  51. option device 'vpns+'
  52. option network 'vpn'
  53. config forwarding
  54. option dest 'lan'
  55. option src 'vpn'
  56. config forwarding
  57. option dest 'vpn'
  58. option src 'lan'
  59. config rule
  60. option target 'ACCEPT'
  61. option src 'wan'
  62. option proto 'tcp'
  63. option dest_port '4443'
  64. option name 'vpn'
  65. config rule
  66. option target 'ACCEPT'
  67. option src 'wan'
  68. option proto 'udp'
  69. option dest_port '4443'
  70. option name 'vpn'
  71. -----------------------------------------------------------------
  72. There is a luci plugin to allow configuring the server from
  73. the web environment; see the package luci-app-ocserv.