Pptp server configuration and management

Source: Internet
Author: User
Pptp server configuration and management-Linux Enterprise Application-Linux server application information. The following is a detailed description. 1. Required software:

(: Http://sourceforge.net/project/showfiles.php? Group_id = 44827)

Dkms-2.0.6-1.noarch.rpm

Kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm

Kernelmod-0.7.1.tar.gz

Ppp-2.4.3-5.fc4.i386.rpm (more stable with ppp-2.4.4b1)

Pptpd-1.3.1-0.i386.rpm

2. Upgrade the internal renewal Module

First check whether mppe function: modprobe ppp-compress-18 & echo OK

If OK is displayed, the kernel already supports mppe. If not, install:

Dkms-2.0.6-1.noarch.rpm

Kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm

For low-end users, the kernel is installed with kernelmod-0.7.1.tar.gz (kernel source code is required)

3. Install ppp

Download the latest ppp software package from the URL above. Use the most common methods for source package: configure, make, and make install. Note: The new version does not copy the sample configuration file. You need to use make install-etcppp to install the sample configuration file. General available rpm software package:

Rpm? Fvl ppp-2.4.3-5.fc4.i386.rpm



4. Install pptpd

Download the latest pptp software package from the above URL. Use the most common methods for source package: configure, make, and make install. The pptp software package is generally used: pptpd-1.3.1-0.i386.rpm

5./etc/pptp. conf:

Ppp/usr/local/sbin/pppd

Option/etc/ppp/options.ppt pd

Bcrelay eth0

# Listen 0.0.0.0

Localip 192.168.x.x

Remoteip 192.168.x.1-254

Netmast 255.255.255.0

6./etc/ppp/options.ppt pd content is as follows:

Lock

Dump

Logfd 2

Logfile/var/log/pptpd. log

Name pptpserver

Proxyarp

Auth

Mtu 1450

Nobsdcomp

Require-mschap-v2

# Require-mppe-128

Require-mppe

Ipparam options.ppt pd

Ms-dns 192.168.x.x

Ms-dns 202.86.252.254

7./etc/ppp/ip-up content is as follows:


#! /Bin/bash

# This file shoshould not be modified -- make local changes

#/Etc/ppp/ip-up.local instead



PATH =/sbin:/usr/sbin:/bin:/usr/bin

Export PATH



LOGDEVICE = $6

REALDEVICE = $1



[-F/etc/sysconfig/network-scripts/ifcfg-$ {LOGDEVICE}] &/etc/sysconfig/network-scripts/ifup-post ifcfg-$ {LOGDEVICE}



/Etc/ppp/ip-up.ipv6to4 $ {LOGDEVICE}



#################### Log ################### #####



Pptplogdirectory = "/etc/ppp"

Dialinfo = '/sbin/ifconfig $1'

Dialtime = '/bin/date'

Userip = 'ifconfig $1 | grep inet | awk '{print $3}' | awk-F: '{print $2 }''

Localinfo = '/bin/cat/etc/ppp/chap-secrets | grep $ userip | awk' {print "username:" $1 "\ t", "localIP: "$4," logon Successfull "}''

# Username = '/bin/cat/etc/ppp/chap-secrets | grep $ userip | awk' {print $1 }''

# Remoteinfo = '/usr/bin/tail/var/log/daemon-n100 | grep "CTRL: client "| grep" control connection started "| tail-n1 | awk-F" Client "'{print $2}' | awk '{print" remoteIP :", $1 }''



If [-e $ pptplogdirectory/userlog]; then





/Bin/cat/etc/ppp/chap-secrets | grep $ userip | awk '{print logontime "\ t", "username:" $1 "\ t ", "IP:" $4, "logon Successfull" "\ t", "remoteIP: "'$ 6'} 'logontime ="'/bin/date' "> $ pptplogdirectory/userlog

#/Bin/cat/etc/ppp/chap-secrets | grep $ userip | awk '{print logontime "\ t", "username:" $1 "\ t ", "IP:" $4, "logon Successfull" "\ t", "remoteIP: "'$ 6'} 'logontime ="'/bin/date' "> $ pptplogdirectory/userlog

#/Bin/echo $0 $1 $2 $3 $4 $5 $6 $7 >>$ pptplogdirectory/userlog

#/Bin/echo $ dialtime $ localinfo $ remoteinfo> $ pptplogdirectory/userlog



#/Bin/cat/etc/ppp/chap-secrets | grep $ userip | awk '{print logontime "\ t", "username:" $1 "\ t ", "IP:" $4, "logon Successfull"} 'logontime = "'/bin/date'"> $ pptplogdirectory/userlog

#/Bin/cat/etc/ppp/chap-secrets | grep $ userip | awk '{print logontime "\ t", "username:" $1 "\ t ", "IP:" $4, "logon Successfull" "\ t ", remoteinfo} 'logontime = "'/bin/date'" remoteinfo = "'/usr/bin/tail/var/log/daemon-n100 | grep" CTRL: client "| grep" control connection started "| tail-n1 | awk-F" Client "'{print $2}' | awk '{print" remoteIP :", $1} ''" >>$ pptplogdirectory/userlog

# Echo "456" | awk '{print a $ 0b} 'a = "$ a" B = "$ B"

Else

/Bin/touch $ pptplogdirectory/userlog

Fi

######################################## ############



/Sbin/ifconfig$ 1 mtu 1446



# [-X/etc/ppp/login. sh] &/etc/ppp/login. sh "$ @"

[-X/etc/ppp/ip-up.local] & amp;/etc/ppp/ip-up.local "$ @"



Exit 0



8. The content of/etc/ppp/chat-secrets is as follows:

# Secrets for authentication using CHAP

# Client server secret IP addresses

"Test" pptpserver "dfd & 890" 192.168.x.x

9. Omitted

Ii. pptp Server Management

1. Create a user

Add one to Vi/etc/ppp/chat-secrets and specify the IP address

2. View logon logs

Tail? N100/etc/ppp/userlog
Related Article

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.