MYIR
Banned
Step 1: Install PPP and TUN
TUN device is the virtual network card under Linux, you should confirm whether you have start the PPP and TUN of your VPS up.
cat /dev/ppp cat: /dev/ppp: No such device or address
cat /dev/net/tun cat: /dev/net/tun: File descriptor in bad state
Above indicates it approved, remember, the two above have to approve at the same time. You could submit a ticket to VPS supply to ask approval if it cant start-up.
Prepare to set PPP and iptables up after you have confirmed PPP and TUN have stared-up.
Step 2:Set PPP,ipables and pptp up:
apt-get update
apt-get install ppp iptables pptpd
Step 3: Configure pptp:
pptp protocol usement is based on point to point cryptographic technology(MPPE)of Microsoft. Edit /etc/pptpd.conf file:
vi /etc/pptpd.conf
Delete "#" ahead of the below field.
localip 192.168.0.1
remoteip 192.168.0.234-238,192.168.0.245
Key point: You must confirm that the configuration of pptpd.conf must be ended up at empty line, or it would show"Starting pptpd"when start pptd server up, then, it will
be blocked all the time, and you can't start the server up.
Step 4: Configure ppp:
PPP protocol usement is based on the way of identity verification of PPP protocol.Edit /etc/ppp/options file:
vi /etc/ppp/options
Delete "#"ahead of ms-dns, utilize the DNS server of Google, and amend it as below:
ms-dns 8.8.8.8
ms-dns 8.8.4.4
Step 5:Set VNP account and pass word up:
Edit /etc/ppp/chap-secrets file:
vi /etc/ppp/chap-secrets
Add the contents:
freedom pptpd 123456 *
Freedom is the username of VNP, "123456"is the pass word, "*"indicates all IP would be approved.
Step 6:Amend the core configuration, set IPv4 retransmission up
Edit /etc/sysctl.conf file:
vi /etc/sysctl.conf
Amend “net.ipv4.ip_forward”figure to 1:
net.ipv4.ip_forward=1
At the same time, add "#"at the head of “net.ipv4.tcp_syncookies = 1”
# net.ipv4.tcp_syncookies = 1
Make sysctl.conf configuration file work, command:
sysctl -p
Step 7: Add retransmission rules of iptables:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to-source 188.10.10.100
192.168.0.0 match the third localip network segment, 188.10.10.100 is the public network of your VPS.
Then, save the retransmission rules of iptables
iptables-save
Restart PPTP server up
/etc/init.d/pptpd restart
Write the last three commands into :/etc/rc.local file if you want to start your PC up.
Hereto, we finish the work!
TUN device is the virtual network card under Linux, you should confirm whether you have start the PPP and TUN of your VPS up.
cat /dev/ppp cat: /dev/ppp: No such device or address
cat /dev/net/tun cat: /dev/net/tun: File descriptor in bad state
Above indicates it approved, remember, the two above have to approve at the same time. You could submit a ticket to VPS supply to ask approval if it cant start-up.
Prepare to set PPP and iptables up after you have confirmed PPP and TUN have stared-up.
Step 2:Set PPP,ipables and pptp up:
apt-get update
apt-get install ppp iptables pptpd
Step 3: Configure pptp:
pptp protocol usement is based on point to point cryptographic technology(MPPE)of Microsoft. Edit /etc/pptpd.conf file:
vi /etc/pptpd.conf
Delete "#" ahead of the below field.
localip 192.168.0.1
remoteip 192.168.0.234-238,192.168.0.245
Key point: You must confirm that the configuration of pptpd.conf must be ended up at empty line, or it would show"Starting pptpd"when start pptd server up, then, it will
be blocked all the time, and you can't start the server up.
Step 4: Configure ppp:
PPP protocol usement is based on the way of identity verification of PPP protocol.Edit /etc/ppp/options file:
vi /etc/ppp/options
Delete "#"ahead of ms-dns, utilize the DNS server of Google, and amend it as below:
ms-dns 8.8.8.8
ms-dns 8.8.4.4
Step 5:Set VNP account and pass word up:
Edit /etc/ppp/chap-secrets file:
vi /etc/ppp/chap-secrets
Add the contents:
freedom pptpd 123456 *
Freedom is the username of VNP, "123456"is the pass word, "*"indicates all IP would be approved.
Step 6:Amend the core configuration, set IPv4 retransmission up
Edit /etc/sysctl.conf file:
vi /etc/sysctl.conf
Amend “net.ipv4.ip_forward”figure to 1:
net.ipv4.ip_forward=1
At the same time, add "#"at the head of “net.ipv4.tcp_syncookies = 1”
# net.ipv4.tcp_syncookies = 1
Make sysctl.conf configuration file work, command:
sysctl -p
Step 7: Add retransmission rules of iptables:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to-source 188.10.10.100
192.168.0.0 match the third localip network segment, 188.10.10.100 is the public network of your VPS.
Then, save the retransmission rules of iptables
iptables-save
Restart PPTP server up
/etc/init.d/pptpd restart
Write the last three commands into :/etc/rc.local file if you want to start your PC up.
Hereto, we finish the work!