- Install PPTP: sudo yum install pptp pptp-setup
- Configuration: sudo pptpsetup –create config –server [server address] –username [username] –password [pwd] –encrypt
- This command will create a file named config under /etc/ppp/peers/ with server info written inside.
- This command will also write your username and password into /etc/ppp/chap-secrets
- Register the ppp_mppe kernel module: sudo modprobe ppp_mppe
- Register the nf_conntrack_pptp kernel module: sudo modprobe nf_conntrack_pptp
- Connect to VPN PPTP: sudo pppd call config
- It will establish PPTP VPN connection. You can type command ip a I grep ppp to find the connection name (e.g. ppp1). No return indicates connection failure.
- If any error, you can look into /var/log/messages for log info
- Check IP routing table info: route -n
- Add Network Segment to current connection: route add -net 192.168.1.0 netmask 255.255.255.0 dev ppp1 (192.168.1.0 and ppp1 are taken as example )
- You can now ping the destination to check the access
- Disconnect the VPN: killall pppd
Source : https://zlthinker.github.io/Setup-VPN-on-CentOS
No comments:
Post a Comment