SSTP Server
SSTP is a form of VPN tunnel that provides a mechanism to transport PPP traffic through an SSL/TLS channel. SSL/TLS provides transport-level security with key negotiation, encryption and traffic integrity checking. The use of SSL/TLS over TCP port 443 allows SSTP to pass through virtually all firewalls and proxy servers except for authenticated web proxies.
SSTP is available for Linux, BSD, and Windows.
VyOS utilizes accel-ppp to provide SSTP server functionality. We support both local and RADIUS authentication.
As SSTP provides PPP via a SSL/TLS channel the use of either publicly signed certificates or private PKI is required.
Configuring SSTP Server
Certificates
Using our documentation chapter - PKI generate and install CA and Server certificate
vyos@vyos:~$ generate pki ca install CA
vyos@vyos:~$ generate pki certificate sign CA install Server
Configuration
set vpn sstp authentication local-users username test password 'test'
set vpn sstp authentication mode 'local'
set vpn sstp client-ip-pool SSTP-POOL range '10.0.0.2-10.0.0.100'
set vpn sstp default-pool 'SSTP-POOL'
set vpn sstp gateway-address '10.0.0.1'
set vpn sstp ssl ca-certificate 'CA1'
set vpn sstp ssl certificate 'Server'
Set authentication backend. The configured authentication backend is used for all queries.
radius: All authentication queries are handled by a configured RADIUS server.
local: All authentication queries are handled locally.
Create <user> for local authentication on this system. The users password will be set to <pass>.
Use this command to define the first IP address of a pool of
addresses to be given to SSTP clients. If notation x.x.x.x-x.x.x.x
,
it must be within a /24 subnet. If notation x.x.x.x/x
is
used there is possibility to set host/netmask.
Specifies single <gateway> IP address to be used as local address of PPP interfaces.
Configuring RADIUS authentication
To enable RADIUS based authentication, the authentication mode needs to be changed within the configuration. Previous settings like the local users still exist within the configuration, however they are not used if the mode has been changed from local to radius. Once changed back to local, it will use all local accounts again.
set vpn sstp authentication mode radius
Configure RADIUS <server> and its required shared <secret> for communicating with the RADIUS server.
Since the RADIUS server would be a single point of failure, multiple RADIUS servers can be setup and will be used subsequentially. For example:
set vpn sstp authentication radius server 10.0.0.1 key 'foo'
set vpn sstp authentication radius server 10.0.0.2 key 'foo'
Note
Some RADIUS severs use an access control list which allows or denies queries, make sure to add your VyOS router to the allowed client list.
RADIUS source address
If you are using OSPF as your IGP, use the interface connected closest to the RADIUS server. You can bind all outgoing RADIUS requests to a single source IP e.g. the loopback interface.
Source IPv4 address used in all RADIUS server queires.
Note
The source-address
must be configured to that of an interface.
Best practice would be a loopback or dummy interface.
RADIUS advanced options
Configure RADIUS <server> and its required port for authentication requests.
Mark RADIUS server as offline for this given <time> in seconds.
Timeout to wait reply for Interim-Update packets. (default 3 seconds)
Specifies IP address for Dynamic Authorization Extension server (DM/CoA)
Port for Dynamic Authorization Extension server (DM/CoA)
Secret for Dynamic Authorization Extension server (DM/CoA)
Maximum number of tries to send Access-Request/Accounting-Request queries
Value to send to RADIUS server in NAS-Identifier attribute and to be matched in DM/CoA requests.
Value to send to RADIUS server in NAS-IP-Address attribute and to be matched in DM/CoA requests. Also DM/CoA server will bind to that address.
Source IPv4 address used in all RADIUS server queires.
Specifies which RADIUS server attribute contains the rate limit information. The default attribute is Filter-Id.
Note
If you set a custom RADIUS attribute you must define it on both dictionaries on the RADIUS server and client.
Specifies the vendor dictionary, This dictionary needs to be present in /usr/share/accel-ppp/radius.
Received RADIUS attributes have a higher priority than parameters defined within the CLI configuration, refer to the explanation below.
Allocation clients ip addresses by RADIUS
If the RADIUS server sends the attribute Framed-IP-Address
then this IP
address will be allocated to the client and the option default-pool
within
the CLI config will being ignored.
If the RADIUS server sends the attribute Framed-Pool
, then the IP address
will be allocated from a predefined IP pool whose name equals the attribute
value.
If the RADIUS server sends the attribute Stateful-IPv6-Address-Pool
, the
IPv6 address will be allocated from a predefined IPv6 pool prefix
whose
name equals the attribute value.
If the RADIUS server sends the attribute Delegated-IPv6-Prefix-Pool
, an
IPv6 delegation prefix will be allocated from a predefined IPv6 pool delegate
whose name equals the attribute value.
Note
Stateful-IPv6-Address-Pool
and Delegated-IPv6-Prefix-Pool
are defined in
RFC6911. If they are not defined in your RADIUS server, add new dictionary.
The client’s interface can be put into a VRF context via a RADIUS Access-Accept
packet, or changed via RADIUS CoA. Accel-VRF-Name
is used for these
purposes. This is a custom ACCEL-PPP attribute. Define it in your RADIUS
server.
Renaming clients interfaces by RADIUS
If the RADIUS server uses the attribute NAS-Port-Id
, ppp tunnels will be
renamed.
Note
The value of the attribute NAS-Port-Id
must be less than 16
characters, otherwise the interface won’t be renamed.
IPv6
Specifies IPv6 negotiation preference.
require - Require IPv6 negotiation
prefer - Ask client for IPv6 negotiation, do not fail if it rejects
allow - Negotiate IPv6 only if client requests
deny - Do not negotiate IPv6 (default value)
Use this comand to set the IPv6 address pool from which an SSTP client will get an IPv6 prefix of your defined length (mask) to terminate the SSTP endpoint at their side. The mask length can be set between 48 and 128 bits long, the default value is 64.
Use this command to configure DHCPv6 Prefix Delegation (RFC3633) on SSTP. You will have to set your IPv6 pool and the length of the delegation prefix. From the defined IPv6 pool you will be handing out networks of the defined length (delegation-prefix). The length of the delegation prefix can be set between 32 and 64 bits long.
Use this command to define default IPv6 address pool name.
set vpn sstp ppp-options ipv6 allow
set vpn sstp client-ipv6-pool IPv6-POOL delegate '2001:db8:8003::/48' delegation-prefix '56'
set vpn sstp client-ipv6-pool IPv6-POOL prefix '2001:db8:8002::/48' mask '64'
set vpn sstp default-ipv6-pool IPv6-POOL
IPv6 Advanced Options
Accept peer interface identifier. By default this is not defined.
Specifies if a fixed or random interface identifier is used for IPv6. The default is fixed.
random - Random interface identifier for IPv6
x:x:x:x - Specify interface identifier for IPv6
Specifies the peer interface identifier for IPv6. The default is fixed.
random - Random interface identifier for IPv6
x:x:x:x - Specify interface identifier for IPv6
ipv4-addr - Calculate interface identifier from IPv4 address.
calling-sid - Calculate interface identifier from calling-station-id.
Scripting
Script to run when the session interface is changed by RADIUS CoA handling
Script to run when the session interface about to terminate
Script to run before the session interface comes up
Advanced Options
Authentication Advanced Options
Assign a static IP address to <user> account.
Rate limit the download bandwidth for <user> to <bandwidth> kbit/s.
Rate limit the upload bandwidth for <user> to <bandwidth> kbit/s.
Client IP Pool Advanced Options
PPP Advanced Options
Disable Compression Control Protocol (CCP). CCP is enabled by default.
Specifies number of interfaces to cache. This prevents interfaces from being removed once the corresponding session is destroyed. Instead, interfaces are cached for later use in new sessions. This should reduce the kernel-level interface creation/deletion rate. Default value is 0.
Specifies IPv4 negotiation preference.
require - Require IPv4 negotiation
prefer - Ask client for IPv4 negotiation, do not fail if it rejects
allow - Negotiate IPv4 only if client requests (Default value)
deny - Do not negotiate IPv4
Defines the maximum <number> of unanswered echo requests. Upon reaching the value <number>, the session will be reset. Default value is 3.
If this option is specified and is greater than 0, then the PPP module will send LCP echo requests every <interval> seconds. Default value is 30.
Specifies timeout in seconds to wait for any peer activity. If this option is specified it turns on adaptive lcp echo functionality and “lcp-echo-failure” is not used. Default value is 0.
Defines the minimum acceptable MTU. If a client tries to negotiate an MTU lower than this it will be NAKed, and disconnected if it rejects a greater MTU. Default value is 100.
Specifies MPPE negotiation preference.
require - ask client for mppe, if it rejects drop connection
prefer - ask client for mppe, if it rejects don’t fail. (Default value)
deny - deny mppe
Default behavior - don’t ask the client for mppe, but allow it if the client wants. Please note that RADIUS may override this option by MS-MPPE-Encryption-Policy attribute.
Global Advanced options
Connected clients should use <address> as their DNS server. This command accepts both IPv4 and IPv6 addresses. Up to two nameservers can be configured for IPv4, up to three for IPv6.
Windows Internet Name Service (WINS) servers propagated to client
Configuring SSTP client
Once you have setup your SSTP server there comes the time to do some basic testing. The Linux client used for testing is called sstpc. sstpc requires a PPP configuration/peer file.
If you use a self-signed certificate, do not forget to install CA on the client side.
The following PPP configuration tests MSCHAP-v2:
$ cat /etc/ppp/peers/vyos
usepeerdns
#require-mppe
#require-pap
require-mschap-v2
noauth
lock
refuse-pap
refuse-eap
refuse-chap
refuse-mschap
#refuse-mschap-v2
nobsdcomp
nodeflate
debug
You can now “dial” the peer with the follwoing command: sstpc --log-level 4
--log-stderr --user vyos --password vyos vpn.example.com -- call vyos
.
A connection attempt will be shown as:
$ sstpc --log-level 4 --log-stderr --user vyos --password vyos vpn.example.com -- call vyos
Mar 22 13:29:12 sstpc[12344]: Resolved vpn.example.com to 192.0.2.1
Mar 22 13:29:12 sstpc[12344]: Connected to vpn.example.com
Mar 22 13:29:12 sstpc[12344]: Sending Connect-Request Message
Mar 22 13:29:12 sstpc[12344]: SEND SSTP CRTL PKT(14)
Mar 22 13:29:12 sstpc[12344]: TYPE(1): CONNECT REQUEST, ATTR(1):
Mar 22 13:29:12 sstpc[12344]: ENCAP PROTO(1): 6
Mar 22 13:29:12 sstpc[12344]: RECV SSTP CRTL PKT(48)
Mar 22 13:29:12 sstpc[12344]: TYPE(2): CONNECT ACK, ATTR(1):
Mar 22 13:29:12 sstpc[12344]: CRYPTO BIND REQ(4): 40
Mar 22 13:29:12 sstpc[12344]: Started PPP Link Negotiation
Mar 22 13:29:15 sstpc[12344]: Sending Connected Message
Mar 22 13:29:15 sstpc[12344]: SEND SSTP CRTL PKT(112)
Mar 22 13:29:15 sstpc[12344]: TYPE(4): CONNECTED, ATTR(1):
Mar 22 13:29:15 sstpc[12344]: CRYPTO BIND(3): 104
Mar 22 13:29:15 sstpc[12344]: Connection Established
$ ip addr show ppp0
164: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1452 qdisc fq_codel state UNKNOWN group default qlen 3
link/ppp promiscuity 0
inet 100.64.2.2 peer 100.64.1.1/32 scope global ppp0
valid_lft forever preferred_lft forever
Monitoring
vyos@vyos:~$ show sstp-server sessions
ifname | username | ip | ip6 | ip6-dp | calling-sid | rate-limit | state | uptime | rx-bytes | tx-bytes
--------+----------+----------+-----+--------+----------------+------------+--------+----------+----------+----------
sstp0 | test | 10.0.0.2 | | | 192.168.10.100 | | active | 00:15:46 | 16.3 KiB | 210 B
vyos@vyos:~$ show sstp-server statistics
uptime: 0.01:21:54
cpu: 0%
mem(rss/virt): 6688/100464 kB
core:
mempool_allocated: 149420
mempool_available: 146092
thread_count: 1
thread_active: 1
context_count: 6
context_sleeping: 0
context_pending: 0
md_handler_count: 7
md_handler_pending: 0
timer_count: 2
timer_pending: 0
sessions:
starting: 0
active: 1
finishing: 0
sstp:
starting: 0
active: 1
Troubleshooting
vyos@vyos:~$sudo journalctl -u accel-ppp@sstp -b 0
Feb 28 17:03:04 vyos accel-sstp[2492]: sstp: new connection from 192.168.10.100:49852
Feb 28 17:03:04 vyos accel-sstp[2492]: sstp: starting
Feb 28 17:03:04 vyos accel-sstp[2492]: sstp: started
Feb 28 17:03:04 vyos accel-sstp[2492]: :: recv [HTTP <SSTP_DUPLEX_POST /sra_{BA195980-CD49-458b-9E23-C84EE0ADCD75}/ HTTP/1.1>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: recv [HTTP <SSTPCORRELATIONID: {48B82435-099A-4158-A987-052E7570CFAA}>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: recv [HTTP <Content-Length: 18446744073709551615>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: recv [HTTP <Host: vyos.io>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: send [HTTP <HTTP/1.1 200 OK>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: send [HTTP <Date: Wed, 28 Feb 2024 17:03:04 GMT>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: send [HTTP <Content-Length: 18446744073709551615>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: recv [SSTP SSTP_MSG_CALL_CONNECT_REQUEST]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: send [SSTP SSTP_MSG_CALL_CONNECT_ACK]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: lcp_layer_init
Feb 28 17:03:04 vyos accel-sstp[2492]: :: auth_layer_init
Feb 28 17:03:04 vyos accel-sstp[2492]: :: ccp_layer_init
Feb 28 17:03:04 vyos accel-sstp[2492]: :: ipcp_layer_init
Feb 28 17:03:04 vyos accel-sstp[2492]: :: ipv6cp_layer_init
Feb 28 17:03:04 vyos accel-sstp[2492]: :: ppp establishing
Feb 28 17:03:04 vyos accel-sstp[2492]: :: lcp_layer_start
Feb 28 17:03:04 vyos accel-sstp[2492]: :: send [LCP ConfReq id=56 <auth PAP> <mru 1452> <magic 1cd9ad05>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: recv [LCP ConfReq id=0 <mru 4091> <magic 345f64ca> <pcomp> <accomp> < d 3 6 >]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: send [LCP ConfRej id=0 <pcomp> <accomp> < d 3 6 >]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: recv [LCP ConfReq id=1 <mru 4091> <magic 345f64ca>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: send [LCP ConfNak id=1 <mru 1452>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: recv [LCP ConfReq id=2 <mru 1452> <magic 345f64ca>]
Feb 28 17:03:04 vyos accel-sstp[2492]: :: send [LCP ConfAck id=2]
Feb 28 17:03:07 vyos accel-sstp[2492]: :: fsm timeout 9
Feb 28 17:03:07 vyos accel-sstp[2492]: :: send [LCP ConfReq id=56 <auth PAP> <mru 1452> <magic 1cd9ad05>]
Feb 28 17:03:07 vyos accel-sstp[2492]: :: recv [LCP ConfAck id=56 <auth PAP> <mru 1452> <magic 1cd9ad05>]
Feb 28 17:03:07 vyos accel-sstp[2492]: :: lcp_layer_started
Feb 28 17:03:07 vyos accel-sstp[2492]: :: auth_layer_start
Feb 28 17:03:07 vyos accel-sstp[2492]: :: recv [LCP Ident id=3 <MSRASV5.20>]
Feb 28 17:03:07 vyos accel-sstp[2492]: :: recv [LCP Ident id=4 <MSRAS-0-MSEDGEWIN10>]
Feb 28 17:03:07 vyos accel-sstp[2492]: [50B blob data]
Feb 28 17:03:07 vyos accel-sstp[2492]: :: recv [PAP AuthReq id=3]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: connect: ppp0 <--> sstp(192.168.10.100:49852)
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: ppp connected
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: send [PAP AuthAck id=3 "Authentication succeeded"]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: test: authentication succeeded
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: auth_layer_started
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: ccp_layer_start
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: ipcp_layer_start
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: ipv6cp_layer_start
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: recv [SSTP SSTP_MSG_CALL_CONNECTED]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: IPV6CP: discarding packet
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: send [LCP ProtoRej id=88 <8057>]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: recv [IPCP ConfReq id=7 <addr 0.0.0.0> <dns1 0.0.0.0> <wins1 0.0.0.0> <dns2 0.0.0.0> <wins2 0.0.0.0>]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: send [IPCP ConfReq id=25 <addr 10.0.0.1>]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: send [IPCP ConfRej id=7 <dns1 0.0.0.0> <wins1 0.0.0.0> <dns2 0.0.0.0> <wins2 0.0.0.0>]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: recv [IPCP ConfAck id=25 <addr 10.0.0.1>]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: recv [IPCP ConfReq id=8 <addr 0.0.0.0>]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: send [IPCP ConfNak id=8 <addr 10.0.0.5>]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: recv [IPCP ConfReq id=9 <addr 10.0.0.5>]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: send [IPCP ConfAck id=9]
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: ipcp_layer_started
Feb 28 17:03:07 vyos accel-sstp[2492]: ppp0:test: rename interface to 'sstp0'
Feb 28 17:03:07 vyos accel-sstp[2492]: sstp0:test: sstp: ppp: started