About the configuration of the pptpd log file

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.