How to turn on the PPTPD default logging feature.
Modify the NOLOGFD in the/ETC/PPP/OPTIONS.PPTPD, the default is not on, the NOLOGFD comment off, and then add Logfile/var/log/pptpd.log (change NOLOGFD to this, In this log you can find the PPTPD log)
After the modification, restart the next PPTPD service, you can
VPN Logon Disconnect logging script
By editing the ip-up and Ip-down scripts in/etc/ppp/, add the following configuration:
/etc/ppp/ip-up
echo "---------------Login---------------------------------------" >>/var/log/pptpd.log
echo "Time: ' Date-d today +%f_%t '" >>/var/log/pptpd.log
echo "ClientIP: $6" >>/var/log/pptpd.log
echo "Username: $PEERNAME" >>/var/log/pptpd.log
echo "Device: $ $" >>/var/log/pptpd.log
echo "Vpnip: $4" >>/var/log/pptpd.log
echo "Assignip: $ $" >>/var/log/pptpd.log
echo "-----------------------------------------------------------" >>/var/log/pptpd.log
/etc/ppp/ip-down
echo "---------------Logout--------------------------------------" >>/var/log/pptpd.log
echo "Time: ' Date-d today +%f_%t '" >>/var/log/pptpd.log
echo "ClientIP: $6" >>/var/log/pptpd.log
echo "Username: $PEERNAME" >>/var/log/pptpd.log
echo "Device: $ $" >>/var/log/pptpd.log
echo "Vpnip: $4" >>/var/log/pptpd.log
echo "Assignip: $ $" >>/var/log/pptpd.log
echo "-----------------------------------------------------------" >>/var/log/pptpd.log
After that, you can see the VPN login log by looking at the Pptpd.log file, and of course we can use another simple log format that is added in both ip-up and Ip-down.
echo "Time: ' date-d today +%f_%t ', Clientip:$6,username: $PEERNAME, assignip:$5" >>/var/log/pptpd.log
This format, only records the logon and exit time, client IP, user name, assigned to the IP, each record only the same, more convenient to view.
About the configuration of the pptpd log file