| 1 | = NXHX PPTP 手動設定 = |
| 2 | |
| 3 | 修改自 PPTP Client Debian HOWTO by James Cameron 26th May 2008 |
| 4 | These are instructions for installing PPTP Client on Debian GNU/Linux. |
| 5 | |
| 6 | Contents: |
| 7 | |
| 8 | * 安裝 Ubuntu pptp client |
| 9 | |
| 10 | apt-get install pptp-linux |
| 11 | |
| 12 | * 手動設定pptp連線 |
| 13 | Configuration, by hand |
| 14 | |
| 15 | 1. 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 | |
| 33 | 2. 建立 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 |
| 42 | refuse-eap |
| 43 | refuse-chap |
| 44 | refuse-mschap |
| 45 | …. |
| 46 | }}} |
| 47 | 3. 建立 or 修改 /etc/ppp/pap-secrets: //因為我們用的是pap認証,所以要改這個檔案,也時候也可能要改的檔案是 chap-secrets…所以要看你的認証方式而定 |
| 48 | |
| 49 | $USERNAME PPTP $PASSWORD * |
| 50 | |
| 51 | 4. 建立 /etc/ppp/peers/$TUNNEL: |
| 52 | {{{ |
| 53 | vi /etc/ppp/peers/nchc |
| 54 | pty “pptp 140.110.22.100 –nolaunchpppd” |
| 55 | name $USERNAME |
| 56 | remotename PPTP |
| 57 | file /etc/ppp/options.pptp |
| 58 | ipparam nchc |
| 59 | }}} |
| 60 | Note: 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 | |
| 63 | 5. 用 pon 來建立連線吧: |
| 64 | {{{ |
| 65 | pon nchc |
| 66 | |
| 67 | ifconfig 可以找到 ppp0 |
| 68 | ppp0 Link encap:Point-to-Point Protocol |
| 69 | inet addr:140.110.35.193 P-t-P:140.110.35.192 Mask:…. |
| 70 | }}} |
| 71 | 6. 斷線: |
| 72 | {{{ |
| 73 | poff nchc |
| 74 | }}} |
| 75 | 7. to set up routing: //這邊希望連線後預設路由就是VPN出去 |
| 76 | {{{ |
| 77 | route add default gw 140.110.35.192 |
| 78 | }}} |
| 79 | or |
| 80 | {{{ |
| 81 | vi /etc/ppp/ip-up.d/nchc |
| 82 | |
| 83 | #!/bin/sh |
| 84 | if [ "${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} |
| 87 | fi |
| 88 | }}} |
| 89 | 8. 在NXHX還要改 DNS 140.110.16.1 |
| 90 | |
| 91 | 9. 開機時啟動 //edit 2010/09/29 |
| 92 | {{{ |
| 93 | vi /etc/network/interfaces |
| 94 | auto ppp0 |
| 95 | iface ppp0 inet ppp |
| 96 | provider nchc |
| 97 | }}} |
| 98 | |
| 99 | 這樣就大功告成啦! |
| 100 | |
| 101 | 10 . option 需要視情況調整 |
| 102 | {{{ |
| 103 | #text |
| 104 | passive |
| 105 | connect-delay 10000 |
| 106 | #lcp-echo-interval 30 |
| 107 | #lcp-echo-failure 4 |
| 108 | 避免斷線… |
| 109 | }}} |
| 110 | 更多細節參考 |
| 111 | |
| 112 | http://pptpclient.sourceforge.net/howto-debian.phtml |