banner
ximalaya

ximalaya

这里是openkava 的blog,关注程序开发的一切技术。 ZZ 表示转载的文章,如涉及版权,请和我联系删除。 在这里你可以看到关于以下技术的文章: 移动开发技术,ANDROID ,IOS,WINDOWS PHONE平台开发,企业ERP开发,动态脚本PYTHON ,OPENGL ES 3D技术,游戏开发技术,HTML5 ,JAVASCRIPT ,MYSQL,AMAZON EC2 ,GOOGLE GAE ,GOOGLE CLOUD SQL 等 。 本站发展历程: 2010年,正式把所有的blog移到这里,租用godaddy的空间,记录生活和工作上的一些心得。 下面是关于我的个人介绍,写在这里权当凑字数啦。 职业:软件开发,开发经验6年,管理经验3年; 工作上使用的技术:C#, SQL SERVER 个人使用的技术:PYTHON,PHP, CSS, JAVA ,ANDROID ,object-c 等等 联系我请发邮件:<a href="http://blog.openkava.com/openkava@gmail.png"><img class="alignnone size-full wp-image-96" title="邮箱" src="http://blog.openkava.com/openkava@gmail.png" alt="" width="174" height="24" /></a>

amazon pptpd 安装运行成功

需要下面脚本运行,可以使用 amazon 免费的一年的 vpn
可以翻墙了。#

Automaticlly install pptpd on Amazon EC2 Amazon Linux#

#

Ripped from http://blog.diahosting.com/linux-tutorial/pptpd/#

pptpd source rpm packing by it's authors#

#

WARNING:#

first ms-dns setting to 172.16.0.23, 172.16.0.23 was showing on my#

/etc/resolv.conf, I'm not sure this is the same on all Amazon AWS zones.#

#

You need to adjust your "Security Groups" which you are using too.#

The security rules which I'm using looks like:#

=================================#

ALL tcp 0 65535 0.0.0.0/0#

ALL udp 0 65535 0.0.0.0/0#

=================================#

#

Authors: yinhm#

Version: 0.1.0#

URL: http://yinhm.appspot.com/#

Edit by: Alvin Ye#

Run by: curl -s https://gist.github.com/999866.txt | sudo bash#

yum -y install make

yum remove -y pptpd ppp ppp-devel
iptables --flush POSTROUTING --table nat
iptables --flush FORWARD
rm -rf /etc/pptpd.conf
rm -rf /etc/ppp

yum -y install rpm-build gcc
yum -y install ppp ppp-devel

mkdir ~/src
cd ~/src
wget http://yinhm.github.com/downloads/pptpd-1.3.4-1.amzn1.src.rpm

rpmbuild --rebuild pptpd-1.3.4-1.amzn1.src.rpm

below line is error is is x64 ,so change the path and is ok#

rpm -i ../rpmbuild/RPMS/i386/pptpd-1.3.4-1.*.i386.rpm

sed -i 's/^logwtmp/#logwtmp/g' /etc/pptpd.conf

sed -i 's/^net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf
sysctl -p
echo "localip 192.168.240.1" >> /etc/pptpd.conf
echo "remoteip 192.168.240.2-100" >> /etc/pptpd.conf
echo "ms-dns 208.67.222.222" >> /etc/ppp/options.pptpd
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd

pass=openssl rand 8 -base64
if [ "$1" != "" ]
then pass=$1
fi

echo "vpn pptpd ${pass} *" >> /etc/ppp/chap-secrets

iptables -t nat -A POSTROUTING -s 192.168.240.0/24 -j SNAT --to-source ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk 'NR==1 { print $1}'
iptables -A FORWARD -p tcp --syn -s 192.168.240.0/24 -j TCPMSS --set-mss 1356
service iptables save

chkconfig iptables on
chkconfig pptpd on

service iptables start
service pptpd start

echo -e "VPN service is installed, your VPN username is \033[1mvpn\033[0m, VPN password is \033[1m${pass}\033[1m"

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.