README 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. The openconnect client expects to be configured using the uci interface.
  2. To setup a VPN connection, add the following to /etc/config/network:
  3. config interface 'MYVPN'
  4. option proto 'openconnect'
  5. option interface 'wan'
  6. option server 'vpn.example.com'
  7. option port '4443'
  8. option username 'test'
  9. option password 'secret'
  10. option serverhash 'AE7FF6A0426F0A0CD0A02EB9EC3C5066FAEB0B25'
  11. option defaultroute '0'
  12. option authgroup 'DEFAULT'
  13. # For second factor auth:
  14. # when a fixed 2FA password can be used
  15. #option password2 'my-fixed-2fa-password'
  16. # RSA tokens, must be built with stoken support
  17. #option token_mode 'rsa'
  18. #option token_secret 'secret'
  19. # HOTP/TOTP tokens
  20. #option token_mode 'hotp'
  21. #option token_secret '00'
  22. The additional files are also used:
  23. /etc/openconnect/user-cert-vpn-MYVPN.pem: The user certificate
  24. /etc/openconnect/user-key-vpn-MYVPN.pem: The user private key
  25. /etc/openconnect/ca-vpn-MYVPN.pem: The CA certificate (instead of serverhash)
  26. After these are setup you can initiate the VPN using "ifup MYVPN", and
  27. deinitialize it using ifdown. You may also use the luci web interface
  28. (Network -> Interfaces -> MYVPN Connect).
  29. Note that you need to configure the firewall to allow communication between
  30. the MYVPN interface and lan.
  31. There is a luci plugin to allow configuring an openconnect interface from
  32. the web environment; see the luci-proto-openconnect package.