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.

90 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 default_domain 'lan'
  19. option compression '1'
  20. option enable '1'
  21. config dns
  22. option ip '10.100.2.1'
  23. config routes
  24. option ip '10.100.2.0'
  25. option netmask '255.255.255.0'
  26. config ocservusers
  27. option name 'test'
  28. option password '$5$unl8uKAGNsdTh9zm$PnUHEGhDc5VHbFE2EfWwW38Bub6Y6EZ5hrFwZE1r2F1'
  29. -----------------------------------------------------------------
  30. This configuration also adds the user "test" with password "test". The
  31. password is specified in the crypt(3) format.
  32. The server can be enabled and started using:
  33. # /etc/init.d/ocserv enable
  34. # /etc/init.d/ocserv start
  35. To simplify firewall configuration, you should setup an unmanaged interface
  36. (e.g., called vpn), and will have assigned the 'vpns+' interfaces. Then a zone
  37. called vpn should be setup to handle interactions with lan. An example
  38. follows:
  39. ----/etc/config/network------------------------------------------
  40. config interface 'vpn'
  41. option proto 'none'
  42. option ifname 'vpns+'
  43. -----------------------------------------------------------------
  44. ----/etc/config/firewall-----------------------------------------
  45. config zone
  46. option input 'ACCEPT'
  47. option forward 'ACCEPT'
  48. option output 'ACCEPT'
  49. option name 'vpn'
  50. option device 'vpns+'
  51. option network 'vpn'
  52. config forwarding
  53. option dest 'lan'
  54. option src 'vpn'
  55. config forwarding
  56. option dest 'vpn'
  57. option src 'lan'
  58. config rule
  59. option target 'ACCEPT'
  60. option src 'wan'
  61. option proto 'tcp'
  62. option dest_port '4443'
  63. option name 'vpn'
  64. config rule
  65. option target 'ACCEPT'
  66. option src 'wan'
  67. option proto 'udp'
  68. option dest_port '4443'
  69. option name 'vpn'
  70. -----------------------------------------------------------------
  71. There is a luci plugin to allow configuring the server from
  72. the web environment; see the package luci-app-ocserv.