<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    ovz pptp

    Posted on 2013-09-06 17:15 H2O 閱讀(368) 評論(0)  編輯  收藏
    試了N個都是可以連上 上不了網 加了iptables也沒用 近乎絕望了。。
    用英文搜索了個老外的教程 非常給力 解決了
    感謝原作者 引用:
    http://www.maxwhale.com/pptp-vpn-on-debianubuntu-os-auto-installer/

    There are many VPN installation tutorials on google, some tutorials are not good for openVZ VPS. I found this auto installer works with Debian/Ubuntu OS on OpenVZ VPS and much easier to install.

    Check if PPP module is enable.

    cat /dev/ppp

    If you receive this message, PPP module is enable.

    cat: /dev/ppp: No such device or address

    Install:

    wget http://www.putdispenserhere.com/wp-content/uploads/pptpinstall.sh chmod +x pptpinstall.sh ./pptpinstall.sh

    Windows and Mac has application for access VPN, you don’t have to install any additional software.

    Note: this auto installer doesn’t work on any openvz VPS, I tried to install on 3 VPS,only got 1 VPS work with this script, and use recommend OS: Debian 5, 6, and Ubuntu 11.04.

    If you can’t access certain website, login SSH, and run below command:

    iptables -I FORWARD -p tcp --syn -i ppp+ -j TCPMSS --set-mss 1356

    Script Source Code:

    #!/bin/bash # Interactive PoPToP install script on a OpenVZ VPS # Tested on Debian 5, 6, and Ubuntu 11.04 # 2011 v1.1 # Author: Commander Waffles # http://www.putdispenserhere.com/pptp-debian-ubuntu-openvz-setup-script/   echo &quot;######################################################&quot; echo &quot;Interactive PoPToP Install Script for OpenVZ VPS&quot; echo &quot;by Commander Waffles http://www.putdispenserhere.com&quot; echo &quot;Should work on various deb-based Linux distos.&quot; echo &quot;Tested on Debian 5, 6, and Ubuntu 11.04&quot; echo echo &quot;Make sure to message your provider and have them enable&quot; echo &quot;IPtables and ppp modules prior to setting up PoPToP.&quot; echo echo &quot;You need to set up the server before creating more users.&quot; echo &quot;A separate user is required per connection or machine.&quot; echo &quot;######################################################&quot; echo echo echo &quot;######################################################&quot; echo &quot;Select on option:&quot; echo &quot;1) Set up new PoPToP server AND create one user&quot; echo &quot;2) Create additional users&quot; echo &quot;######################################################&quot; read x if test $x -eq 1; then     echo &quot;Enter username that you want to create (eg. client1 or john):&quot;     read u     echo &quot;Specify password that you want the server to use:&quot;     read p   # get the VPS IP ip=`ifconfig venet0:0 | grep 'inet addr' | awk {'print $2'} | sed s/.*://`   echo echo &quot;######################################################&quot; echo &quot;Downloading and Installing PoPToP&quot; echo &quot;######################################################&quot; apt-get update apt-get install pptpd   echo echo &quot;######################################################&quot; echo &quot;Creating Server Config&quot; echo &quot;######################################################&quot; cat &gt; /etc/ppp/pptpd-options &lt;&lt;END name pptpd refuse-pap refuse-chap refuse-mschap require-mschap-v2 require-mppe-128 ms-dns 8.8.8.8 ms-dns 8.8.4.4 proxyarp nodefaultroute lock nobsdcomp END # setting up pptpd.conf echo &quot;option /etc/ppp/pptpd-options&quot; &gt; /etc/pptpd.conf echo &quot;logwtmp&quot; &gt;&gt; /etc/pptpd.conf echo &quot;localip $ip&quot; &gt;&gt; /etc/pptpd.conf echo &quot;remoteip 10.1.0.1-100&quot; &gt;&gt; /etc/pptpd.conf   # adding new user echo &quot;$u   *   $p  *&quot; &gt;&gt; /etc/ppp/chap-secrets   echo echo &quot;######################################################&quot; echo &quot;Forwarding IPv4 and Enabling it on boot&quot; echo &quot;######################################################&quot; cat &gt;&gt; /etc/sysctl.conf &lt;&lt;END net.ipv4.ip_forward=1 END sysctl -p   echo echo &quot;######################################################&quot; echo &quot;Updating IPtables Routing and Enabling it on boot&quot; echo &quot;######################################################&quot; iptables -t nat -A POSTROUTING -j SNAT --to $ip # saves iptables routing rules and enables them on-boot iptables-save &gt; /etc/iptables.conf   cat &gt; /etc/network/if-pre-up.d/iptables &lt;&lt;END #!/bin/sh iptables-restore &lt; /etc/iptables.conf END   chmod +x /etc/network/if-pre-up.d/iptables cat &gt;&gt; /etc/ppp/ip-up &lt;&lt;END ifconfig ppp0 mtu 1400 END   echo echo &quot;######################################################&quot; echo &quot;Restarting PoPToP&quot; echo &quot;######################################################&quot; /etc/init.d/pptpd restart   echo echo &quot;######################################################&quot; echo &quot;Server setup complete!&quot; echo &quot;Connect to your VPS at $ip with these credentials:&quot; echo &quot;Username:$u ##### Password: $p&quot; echo &quot;######################################################&quot; # runs this if option 2 is selected elif test $x -eq 2; then     echo &quot;Enter username that you want to create (eg. client1 or john):&quot;     read u     echo &quot;Specify password that you want the server to use:&quot;     read p   # get the VPS IP ip=`ifconfig venet0:0 | grep 'inet addr' | awk {'print $2'} | sed s/.*://` # adding new user echo &quot;$u   *   $p  *&quot; &gt;&gt; /etc/ppp/chap-secrets   echo echo &quot;######################################################&quot; echo &quot;Addtional user added!&quot; echo &quot;Connect to your VPS at $ip with these credentials:&quot; echo &quot;Username:$u ##### Password: $p&quot; echo &quot;######################################################&quot; else echo &quot;Invalid selection, quitting.&quot; exit fi

    if you can't connect to website,you can try:(open fowarding by iptables)
    iptables -t nat -A POSTROUTING -s 192.3.169.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.3.169.0/24 -j TCPMSS --set-mss 1356
    service iptables save

    另外一個腳本
    #!/bin/bash

    get_char()

        {

        SAVEDSTTY
    =`stty -g`

        stty 
    -echo

        stty cbreak

        dd 
    if=/dev/tty bs=1 count=1 2> /dev/null

        stty 
    -raw

        stty echo

        stty 
    $SAVEDSTTY

        }

    clear

    ip
    =$(ifconfig | grep 'inet addr:'| grep -'127.0.0.1' | cut -d: -f2 | awk '{ print $1}')
    echo 
    "$ip"

            echo 
    "==========================="

    serverip
    =""
    while [ "$serverip" = "" ]; do
            echo 
    "Which IP is your server IP:"
            
    read -p"IP:"  serverip
    done
            echo 
    "==========================="
            echo 
    "Server IP:$serverip"
            echo 
    "==========================="
            
            echo 
    "==========================="

    ifconfig

    netdriver
    =""
    while [ "$netdriver" = "" ]; do
            echo 
    "Please input the netdriver of your server:"
            
    read -p"Net Driver:"  netdriver
    done
            echo 
    "==========================="
            echo 
    "Net Driver:$netdriver"
            echo 
    "==========================="
            
    username
    =""
    while [ "$username" = "" ]; do
            echo 
    "Please input the username of PPTP:"
            
    read -p"Username:"  username
    done
            echo 
    "==========================="
            echo 
    "PPTP Username:$username"
            echo 
    "==========================="
            
    password
    =""
    while [ "$password" = "" ]; do
            echo 
    "Please input the password of PPTP:"
            
    read -p"Password:"  password
    done
            echo 
    "==========================="
            echo 
    "PPTP Password:$password"
            echo 
    "==========================="
            
        echo 
    "Press any key to continue."        
        char
    =`get_char`
    apt
    -get -y update
    apt
    -get -y install pptpd
    sed 
    -"s#\#localip 192.168.0.1#localip 192.168.0.1#g" /etc/pptpd.conf
    sed 
    -"s#\#remoteip 192.168.0.234-238,192.168.0.245#remoteip 192.168.0.234-238,192.168.0.245#g" /etc/pptpd.conf
    wget http
    ://soft.yzs.me/pptpd-options -/etc/ppp/pptpd-options
    touch 
    /var/log/pptpd.log
    sed 
    -'s/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf
    sysctl 
    -p
    iptables 
    -t nat -A POSTROUTING -192.168.0.0/24 -$netdriver -j MASQUERADE
    iptables 
    -t nat -A POSTROUTING -192.168.0.0/24 -$netdriver -j SNAT --to-source $serverip
    echo 
    "$username * $password *">>/etc/ppp/chap-secrets
    sed 
    -"1i\iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o $netdriver -j MASQUERADE;iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o $netdriver -j SNAT --to-source $serverip" /etc/rc.local
    service pptpd restart
    #!/bin/bash

    get_char()

        {

        SAVEDSTTY
    =`stty -g`

        stty 
    -echo

        stty cbreak

        dd 
    if=/dev/tty bs=1 count=1 2> /dev/null

        stty 
    -raw

        stty echo

        stty 
    $SAVEDSTTY

        }

    clear

    username
    =""
    while [ "$username" = "" ]; do
            echo 
    "Please input the username of PPTP:"
            
    read -p"Username:"  username
    done
            echo 
    "==========================="
            echo 
    "PPTP Username:$username"
            echo 
    "==========================="
            
    password
    =""
    while [ "$password" = "" ]; do
            echo 
    "Please input the password of PPTP:"
            
    read -p"Password:"  password
    done
            echo 
    "==========================="
            echo 
    "PPTP Password:$password"
            echo 
    "==========================="
            
        echo 
    "Press any key to continue."        
        char
    =`get_char`
    echo 
    "$username * $password *">>/etc/ppp/chap-secrets
    service pptpd restart
    echo 
    "All finish."

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    posts - 0, comments - 21, trackbacks - 0, articles - 101

    Copyright © H2O

    主站蜘蛛池模板: 国产情侣久久久久aⅴ免费 | 亚洲欧美熟妇综合久久久久 | 69视频在线观看高清免费| 亚洲无码在线播放| 精品一区二区三区免费观看| 亚洲国产精品自产在线播放| 一区二区视频免费观看| 久99精品视频在线观看婷亚洲片国产一区一级在线 | 亚洲高清中文字幕免费| 三年片在线观看免费观看高清电影 | 妇女自拍偷自拍亚洲精品| 又黄又爽无遮挡免费视频| 猫咪免费人成网站在线观看入口| 亚洲国产一成久久精品国产成人综合 | 国产成人免费A在线视频| 亚洲av无码成人精品国产| 亚洲AV日韩精品一区二区三区| 男人和女人高潮免费网站| 久久久亚洲精品蜜桃臀| 99精品视频在线观看免费专区 | 黄色一级毛片免费| 国产亚洲一区二区在线观看| 久9热免费精品视频在线观看| 亚洲一级毛片免费在线观看| 青青草国产免费久久久下载| 无码精品人妻一区二区三区免费 | 亚洲人成人网毛片在线播放| 国产一级特黄高清免费大片| 久久免费99精品国产自在现线| 亚洲制服中文字幕第一区| 三年片在线观看免费观看高清电影 | 久久青青草原亚洲av无码| www.免费在线观看| 人人狠狠综合久久亚洲| 亚洲色WWW成人永久网址| 91精品国产免费久久久久久青草| 狠狠综合亚洲综合亚洲色| 亚洲国产精品一区二区久久hs | 成人免费福利视频| 人妻巨大乳hd免费看| 亚洲日本香蕉视频|