[PPTPD] VPN solves the PTY read or GRE write failed problem.

The VPN used for bypassing the Great Firewall, which was set up using a VPS, frequently experiences disconnections and connection failures (error 619, etc.) after the latest system upgrade. After investigating the system logs (syslog) on Linux, it was found that the following log content appears every time a connection fails:

GRE: read(fd=6,buffer=80504c0,len=8196) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax and pppd logs CTRL: PTY read or GRE write failed (pty,gre)=(6,7) CTRL: Reaping child PPP[13354] CTRL: Client XXX.XXX.XXX.XXX control connection finished

Initially, it was thought that there was an issue with GRE, but after checking the upgrade logs, it was found that GRE was not upgraded. Later, a solution was found through Google and Baidu. Here are the steps:

  1. Enable debug mode by modifying the /etc/ppp/pptp-options file. Find the following lines:


Remove the comment symbol at the beginning of the lines. Restart the pptpd service to enter debug mode.

  1. After analyzing the logs, it was found that the issue was caused by a version mismatch between logwtmp and pptpd. Open the /etc/pptpd.conf file and find the following line:


Comment out the logwtmp line, then restart pptpd. After reconnecting, everything should return to normal.

  1. Finally, if your server has proxyarp enabled, don't forget to run "arp -d" after each abnormal disconnection.

arp -d
sudo arp -d -a

Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.