Changes between Initial Version and Version 1 of waue/2011/0401


Ignore:
Timestamp:
Apr 11, 2011, 6:39:19 PM (14 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/2011/0401

    v1 v1  
     1= NXHX PPTP 手動設定 =
     2
     3修改自 PPTP Client Debian HOWTO by James Cameron 26th May 2008
     4These are instructions for installing PPTP Client on Debian GNU/Linux.
     5
     6Contents:
     7
     8 * 安裝 Ubuntu pptp client
     9
     10apt-get install pptp-linux
     11
     12 * 手動設定pptp連線
     13Configuration, by hand
     14
     151. obtain from your PPTP Server administrator:
     16
     17 * the IP address or host name of the server ($SERVER),
     18 * the name you wish to use to refer to the tunnel ($TUNNEL),
     19 * the authentication domain name ($DOMAIN),
     20 * the username you are to use ($USERNAME),
     21 * the password you are to use ($PASSWORD),
     22 * whether encryption is required.
     23
     24基本上要開始之前要對 VPN SERVER 有所了解,最起碼要知道ServerIP, Domain, Username, Password, 最容易告不清楚就是 “加密”與”壓縮”
     25以 NXHX公司為例
     26 * $SERVER = 140.110.22.100
     27 * $TUNNEL = nchc //自己定義就好
     28 * $DOMAIN = //沒有
     29 * $USERNAME = ….
     30 * $PASSWORD = ….
     31 * 以 pap 認証,允許不加密資料…
     32
     332. 建立 or 修改 /etc/ppp/options.pptp:
     34
     35預設是 lock noauth nobsdcomp nodeflate refuse-pap refuse-chap refuse-eap refuse mschap
     36,而NXHX因為要用到PAP,所以把 refuse-pap 給住解掉。
     37{{{
     38#!text
     39# We won’t do PAP, EAP, CHAP, or MSCHAP, but we will accept MSCHAP-V2
     40# (you may need to remove these refusals if the server is not using MPPE)
     41#refuse-pap
     42refuse-eap
     43refuse-chap
     44refuse-mschap
     45….
     46}}}
     473. 建立 or 修改 /etc/ppp/pap-secrets: //因為我們用的是pap認証,所以要改這個檔案,也時候也可能要改的檔案是 chap-secrets…所以要看你的認証方式而定
     48
     49$USERNAME PPTP $PASSWORD *
     50
     514. 建立 /etc/ppp/peers/$TUNNEL:
     52{{{
     53vi /etc/ppp/peers/nchc
     54pty “pptp 140.110.22.100 –nolaunchpppd”
     55name $USERNAME
     56remotename PPTP
     57file /etc/ppp/options.pptp
     58ipparam nchc
     59}}}
     60Note: if you do not need MPPE support, then remove the require-mppe-128 option from this file and /etc/ppp/options.pptp.
     61// 原本範例有 require-mppe-128 因為我們不需要 所以拿掉了
     62
     635. 用 pon 來建立連線吧:
     64{{{
     65pon nchc
     66
     67ifconfig 可以找到 ppp0
     68ppp0 Link encap:Point-to-Point Protocol
     69inet addr:140.110.35.193 P-t-P:140.110.35.192 Mask:….
     70}}}
     716. 斷線:
     72{{{
     73poff nchc
     74}}}
     757. to set up routing: //這邊希望連線後預設路由就是VPN出去
     76{{{
     77route add default gw 140.110.35.192
     78}}}
     79or
     80{{{
     81vi /etc/ppp/ip-up.d/nchc
     82
     83#!/bin/sh
     84if [ "${PPP_IPPARAM}" = "nchc" ]; then
     85    /sbin/route add -net 140.x.0.0/16   dev ${IFNAME}
     86    /sbin/route add -net 2xx.1xx.1xx.0/24 dev ${IFNAME}
     87fi
     88}}}
     898. 在NXHX還要改 DNS 140.110.16.1
     90
     919. 開機時啟動 //edit 2010/09/29
     92{{{
     93vi /etc/network/interfaces
     94auto ppp0
     95iface ppp0 inet ppp
     96provider nchc
     97}}}
     98
     99這樣就大功告成啦!
     100
     10110 . option 需要視情況調整
     102{{{
     103#text
     104passive
     105connect-delay 10000
     106#lcp-echo-interval 30
     107#lcp-echo-failure 4
     108避免斷線…
     109}}}
     110更多細節參考
     111
     112http://pptpclient.sourceforge.net/howto-debian.phtml