Last active
November 12, 2017 07:15
-
-
Save ruehowl/a08b54499ee72d1e7137588de84c6d5c to your computer and use it in GitHub Desktop.
Install pptpd server on centos7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install PPTPD server on centos7 | |
#Auther: Rahul Varghese | |
# install the latest epel repo | |
# http://download.fedoraproject.org/pub/epel/beta/7/x86_64/ | |
echo "Installing ppp and pptpd" | |
yum -y install ppp pptpd | |
# pptpd settings | |
echo 'localip 10.10.0.1' >> /etc/pptpd.conf | |
echo 'remoteip 10.10.0.100-199' >> /etc/pptpd.conf | |
echo 'ms-dns 8.8.8.8' >> /etc/ppp/options.pptpd | |
echo 'ms-dns 8.8.4.4' >> /etc/ppp/options.pptpd | |
echo 'rahul-vpn pptpd rahul123 *' >> /etc/ppp/chap-secrets # username and password | |
# system ipv4 forward | |
sysctl_file=/etc/sysctl.conf | |
if grep -xq 'net.ipv4.ip_forward' $sysctl_file; then | |
sed -i.bak -r -e "s/^.*net.ipv4.ip_forward.*/net.ipv4.ip_forward = 1/" $sysctl_file | |
else | |
echo 'net.ipv4.ip_forward = 1' >> $sysctl_file | |
fi | |
sysctl -p | |
# Create NAT rule for iptables | |
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE && iptables-save | |
echo "finished" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment