How to install PPTP VPN on Rocky Linux 8
PPTP on Rocky Linux is provided by the EPEL repository, so enable EPEL repo by running
1 |
dnf install epel-release -y |
Install the pptpd package
1 |
dnf install -y pptpd |
Edit file
1 |
vi /etc/pptpd.conf |
At end of the file, add
1 2 |
localip 10.0.0.1 remoteip 10.0.0.100-200 |
Edit file
1 |
vi /etc/ppp/options.pptpd |
At the end, add
1 2 |
ms-dns 1.1.1.1 ms-dns 8.8.8.8 |
Start PPTPD VPN
To set PPTPD VPN server to start on boot, run
1 |
systemctl enable pptpd |
To start VPN
1 |
systemctl start pptpd |
To stop VPN
1 |
systemctl stop pptpd |
To check status, run
1 |
systemctl status pptpd |
Create a VPN user
To create a VPN user, edit the file
1 |
vi /etc/ppp/chap-secrets |
Inside you can add your VPN user and password. For example
1 |
serverok pptpd ooyeegei8Ienai * |
This will create a VPN user with the username “serverok” and password “ooyeegei8Ienai”.
After adding a user you need to restart the PPTPD service with the command
1 |
systemctl restart pptpd |
Confire firewall to allow VPN connection
Install firewalld with command
1 |
dnf install firewalld -y |
Enable and start firewalld
1 2 3 |
systemctl enable firewalld systemctl start firewalld systemctl status firewalld |
Open ports needed for PPTPD VPN on the firewall
1 2 3 4 |
firewall-cmd --permanent --zone=public --add-port=1723/tcp firewall-cmd --permanent --add-rich-rule='rule protocol value="gre" accept' firewall-cmd --permanent --zone=public --add-masquerade firewall-cmd --reload |
Enable IP forwarding by editing the file
1 |
vi /etc/sysctl.conf |
In the file, add
1 |
net.ipv4.ip_forward = 1 |
Run
1 |
sysctl -p |
See PPTPD VPN