This guide describes how to configure a client connection on a Debian 12 workstation to a PPTP server in order to gain remote access.
The workstation is connected to the Internet and does not have an external IP address for direct connection. In order for us to gain remote access, we connect to a PPTP server previously configured on VDS Debian 12, through which we can configure port forwarding and connect to the device.
Cm. also: Configuring a PPTP server on VDS Debian 12.
1. Install the PPTP client
apt install pptp-linux
1.1 Basic settings
All basic settings are stored in the file /etc/ppp/options.pptp We need to create a connection file that will link to the settings file.
touch /etc/ppp/peers/my
pty "pptp 234.xxx.234.xxx --nolaunchpppd"
name user2
remotename PPTP
require-mppe-128
persist
maxfail 50
holdoff 30
file /etc/ppp/options.pptp
ipparam my
234.xxx.234.xxx - IP address of our VDS server with the configured service
user2 - username
persist - will reconnect if disconnected
maxfail - maximum number of reconnection attempts
holdoff - time in seconds between attempts
1.2 User settings, open the file /etc/ppp/chap-secrets
Let's indicate the data that we created on the server for user user2
# client server secret IP addresses
user2 PPTP password2 10.10.10.10
1.3 Connection and disconnection
1.3.1 Connecting to the PPTP server
pon my
1.3.2 Disconnecting from the PPTP server
poff my
To check, use the command ifconfig | grep ppp
1.4 Automatic connection at startup
At the end of the /etc/network/interfaces file, add the lines
auto ppp0
iface ppp0 inet ppp
provider my
1.4.1 Checking automatic connection
/etc/init.d/networking restart
ifconfig
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1396
inet 10.10.10.10 netmask 255.255.255.255 destination 10.10.10.1
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 14 bytes 338 (338.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 14 bytes 344 (344.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Done, now the workstation will connect to the server and will be able to access from the VDS server via local IP. If necessary, you can configure port forwarding on the VDS server itself.