# Linux

# Debian | PPTP server

Install the PPTP server

`sudo apt install pptpd`

Open pptpd-options, find and comment out "require-mppe-128"

`sudo vi /etc/ppp/pptpd-options`

```bash
...
# Encryption
# (There have been multiple versions of PPP with encryption support,
# choose with of the following sections you will use.)


# BSD licensed ppp-2.4.2 upstream with MPPE only, kernel module ppp_mppe.o
# {{{
...
# require-mppe-128
# }}}
...
```

Open chap-secrets and create a client secret

`sudo vi /etc/ppp/chap-secrets`

```bash
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
client1         pptpd   supersecure             *
```

Open pptpd.conf and define a local and remote IP

`sudo vi /etc/pptpd.conf`

```bash
...
localip 172.16.10.1
# Supports one remote client, if you want more, you can define a range e.g. remoteip 172.16.10.2-4
remoteip 172.16.10.2
```

Open sysctl.conf and uncomment `net.ipv4.ip_forward=1` to enable IP routing.

`sudo vi /etc/sysctl.conf`

```bash
...
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1
```

Activate the change using the following command

`sudo sysctl -p`

Enable masquerading on eth0

`sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE`

Install `iptables-persistent` and select yes on saving current rules

`sudo apt install iptables-persistent`

[![image.png](https://wiki.leerkotte.net/uploads/images/gallery/2024-05/scaled-1680-/ScDgqK4J3AUmydfh-image.png)](https://wiki.leerkotte.net/uploads/images/gallery/2024-05/ScDgqK4J3AUmydfh-image.png)

Enable and start the PPTPD server

`sudo systemctl enable --now`

You should now be able to connect to the PPTP server using the username and password you created in the `chap-secrets` file.