熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

redhat 7.2下面配置VPN客戶端理論聯系實際

2013-11-13 22:22:42  來源: Oracle 

  
  作者cyp
  
  在網上看到一位大蝦的關於redhat 下面配置VPN客戶端的文章如下
    下載pppmppetargz(pppd的補丁版)pptplinuxtargz
  (pptp客戶端)假定下載文件放在/opt下
    安裝
  
    解壓縮安裝pppd
     # cd /opt
     # tar zxvf pppmppetargz C /opt
     # cd /opt/pppmppe
     # sh unpacksh ;執行這個腳本給pppd打patch
     # cd ppp
     # /configure
     # make
     # mv /usr/sbin/pppd /usr/sbin/pppdold ;原來的pppd做個備份
     # cp pppd /usr/sbin/pppd ;將新的pppd放入系統路徑
  
    解壓縮安裝pptplinux
  
     # cd /opt
     # tar zxvf pptplinuxtargz C /opt
     # cd /opt/pptplinux
     # cp optionspptp /etc/ppp/
     # mkdir /etc/pptpd/ ; 這一步不做也可以
     # tar zxvf pptplinuxtargz
     # cd pptplinux
     # make
     # cp pptp /usr/sbin
     # cp pptpcallmgr /usr/bin
  
     設置
  
     # cd /opt/pptplinux
     # /pptpcommand
  
     ) start
     ) stop
     ) setup
     ) quit
     What task would you like to do?:
  
    選設置
  
     ) List CHAP secrets
     ) Add a New CHAP secret
     ) Delete a CHAP secret
     ) List PPTP Tunnels
     ) Add a NEW PPTP Tunnel
     ) Delete a PPTP Tunnel
     ) Configure nf
     ) Select a default tunnel
     ) Quit
     ?: ;先建立一個CHAP secrets選擇
     Add a NEW CHAP secret
  
     NOTE: Any backslashes (\) must be doubled (\\)
  
     Local Name:
  
      This is the local identifier for CHAP authentication
  
     NOTE: If the server is a Windows NT machine the local name
        should be your Windows NT username including domain
        For example:
  
           domain\\username
  
     Local Name:pptp ;這裡填上pptp的登錄用戶名稱然後出現
     Remote Name:
  
     This is the remote identifier for CHAP authentication
     In most cases this can be left as the default If must be
     set if you have multiple CHAP secrets with the same local name
     and different passwords Just press ENTER to keep the default
  
     Remote Name [PPTP]: ;用默認的PPTP就行所以回車進入下一項
  
     Password:
  
     This is the password or CHAP secret for the account specified The
     password will not be echoed
  
     Password: ;在這裡敲入密碼密碼不回顯
     
    回到主選單
     
     Adding secret pptp PPTP *****
  
     ) List CHAP secrets
     ) Add a New CHAP secret
     ) Delete a CHAP secret
     ) List PPTP Tunnels
     ) Add a NEW PPTP Tunnel
     ) Delete a PPTP Tunnel
     ) Configure nf
     ) Select a default tunnel
     ) Quit
     ?: ;此時建立一個新的PPTP Tunnel選擇
     Add a NEW PPTP Tunnel
  
     ) Other
     Which configuration would you like to use?: ;只有這一個
     Tunnel Name: test ;給連接起名字test
     Server IP: ;vpn服務器的ip
     What route(s) would you like to add when the tunnel comes up?
     This is usually a route to your internal network behind the PPTP server
     You can use TUNNEL_DEV and DEF_GW as in /etc/pptpd/ config file
     TUNNEL_DEV is replaced by the device of the tunnel interface
     DEF_GW is replaced by the existing default gateway
     The syntax to use is the same as the route() command
     Enter a blank line to stop
     route: TUNNEL_DEV ;用提示的輸入
     route: ;一個就夠了回車結束
     Local Name and Remote Name should match a configured CHAP secret
     Local Name is probably your NT domain\username
     NOTE: Any backslashes (\) must be doubled (\\)
  
     Local Name: pptp
     Remote Name [PPTP]:
     Adding test pptp PPTP
     Added tunnel test
     ) List CHAP secrets
     ) Add a New CHAP secret
     ) Delete a CHAP secret
     ) List PPTP Tunnels
     ) Add a NEW PPTP Tunnel
     ) Delete a PPTP Tunnel
     ) Configure nf
     ) Select a default tunnel
     ) Quit
     ?:
  
    退出後再進入程序
     # /pptpcommand
  
     ) start
     ) stop
     ) setup
     ) quit
     What task would you like to do?: ;選開始
     ) test
     Start a tunnel to which server?: test ;在選擇要連接的名稱
  
    注意pptpcommand這個腳本有個bug開始連接後不能正常結束程序並且在連接建立後給出個錯誤的路由
  
     # route
     Kernel IP routing table
     Destination Gateway Genmask Flags Metric Ref Use Iface
      * UH ppp
      * U eth
      * U lo
     default UG eth
  
    解決方法為
    先刪除錯誤那個錯誤的路由
     # route del
    然後
  
   # route add net / dev ppp
From:http://tw.wingwit.com/Article/program/Oracle/201311/18931.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.