Skip to content

Instantly share code, notes, and snippets.

@kaypeter87
Created May 10, 2019 13:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kaypeter87/f4fb96021bf299fea110557ef8a5a611 to your computer and use it in GitHub Desktop.
Save kaypeter87/f4fb96021bf299fea110557ef8a5a611 to your computer and use it in GitHub Desktop.
SSTP Setup on Linux using Network Manager

SSTP Setup on Linux using Network Manager

These are valid for Arch Linux distribution but may work with any other distribution:

Pre-requisite:

  1. networkmanager-sstp - NetworkManager VPN plugin for SSTP
  2. sstp-client - SSTP VPN implementation that allows remote access to Microsoft Windows 2008 Server

Optional:

  • network-manager-applet - Applet frontend for managing network connections

Configuration

You can use the nm-applet GUI to create a VPN connection and load the certificate for the connection to use. Similarily, you can use the CLI to do what nm-applet does behind the backend:

Create a nmconnection file

Create a nm connection file in /etc/NetworkManager/system-connections/NAME_OF_CONNECTION.nmconnection with the following values

[connection]
id=NAMEofCONNECTION
uuid=[HEXADECIMAL Characters and '-'; eg. 2815492f-7e56-435e-b2e9-246bd7cdc664]
type=vpn
autoconnect=false [OPTIONAL, YOU CAN SET IT TO true]
permissions=
timestamp= [The time, in seconds since the Unix Epoch, that the connection was last _successfully_ fully activated. NM will manage and update this]

[vpn]
ca-cert=/etc/PATHtoCERT
domain=DOMAINNAME
gateway=GATEWAYIPorDNSname
password-flags=2 [Go here for each flag description: https://people.freedesktop.org/~lkundrak/nm-docs/nm-settings.html#secrets-flags]
proxy-password-flags=0
refuse-chap=yes
refuse-eap=yes
refuse-pap=yes
tls-ext=yes
user=YOURUSERNAME
service-type=org.freedesktop.NetworkManager.sstp

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
ip6-privacy=0
method=auto

Save and sudo systemctl restart NetworkManager

Use nm-applet GUI to connect to connection or you can use the following NetworkManager cli commands:

list all NM connections: nmcli con

start connection (wifi, vpn, etc): nmcli con up id ConnectionName

down connection: nmcli con down id ConnectionName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment