Centos vpn Client/Server Configuration tutorial

Source: Internet
Author: User
Tags centos iptables

 

Vpn server configuration

Configuration process:

[Root @ sv ~] # Pacman-Syu # update the system [root @ sv ~] # Pacman-S pptpd # install the pptpd service [root @ sv ~] # Cat/etc/pptpd. conf # cp/usr/share/doc/pptpd/samples/pptpd. conf/etc/pptpd. confoption/etc/ppp/options.ppt pdstimeout 2 debuglocalip 172.28.1.1 # Local IPremoteip 172.28.1.240-254 ####################### ########################## [root @ sv ~] # Cat/etc/ppp/options.ppt pd # cp/usr/share/doc/pptpd/samples/options.ppt pd/etc/options.ppt pdname pptpdrefuse-paprefuse-chaprefuse-mschaprequire-mschap-v2require-mppe-128ms-dns 8.8.8ms-dns placement ###### ######################################## #### [root @ sv ~] # Cat/etc/ppp/chap-secrets # Secrets for authentication using CHAP # client server secret IP addressest4x pptpd admin *############### ################################### [root @ sv ~] # Sysctl-w net. ipv4.ip _ forward = 1 # set kernel support forwarding [root @ sv ~] # Iptables-t nat-a postrouting-o eth0-j MASQUERADE # Support for NAT [root @ sv ~] # Iptables-t nat-a postrouting-s 172.28.1.0/24-o eth1-jMASQUERADE [root @ sv ~] # Systemctl start pptpd


Vpn client configuration

 

Client:

[Root @ hz ~] # Yum install pptp-setup [root @ hz ~] # Pptpsetup -- create vpn -- server x. x. x. x -- username byrd -- password xxxxxx -- encrypt -- startUsing interface ppp0 Connect: ppp0 <-->/dev/pts/1 CHAP authentication succeededMPPE 128-bit stateless compression enabledlocal IP address 192.168.0.234remote IP address 192.168.0.1 [root @ hz ~] # Pptpsetup -- delete vpn [root @ hz ~] # Ll/etc/ppp/peers/total 8-rw-r -- r -- 1 root 149 Apr 28 10:37 vpn [root @ hz ~] # Ifconfig ppp0 Link encap: Point-to-Point Protocol inet addr: 192.168.0.234 P-t-P: 192.168.0.1 Mask: 255.255.255.255 up pointopoint running noarp multicast mtu: 1496 Metric: 1 RX packets: 6 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 6 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 3 RX bytes: 60 (60.0 B) TX bytes: 66 (66.0 B) [root @ hz ~] # Pppd call vpn # dial-up vpn [root @ hz ~] # Killall pppd

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.