自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Centos 6.5 64位安裝VPN

系統(tǒng) Linux
本文講解了Centos 6.5 64位安裝VPN。

一、首先檢查你VPS的PPP和TUN有沒有啟用:

 

  1. cat /dev/ppp   

  2. cat /dev/net/tun  

顯示結(jié)果為:

  1. cat: /dev/ppp: No such device or address
  2. cat: /dev/net/tun: File descriptor in bad state 

表明通過,上述兩條只要有一個沒通過都不行。如果沒有啟用,你可以給VPS提供商Submit 一個 Ticket請求開通:

  1. Hello   
  2. Could you enabled TUN-TAP for me? I want run pptp-vpn on my VPS.   
  3. Thank you.  

確認 PPP 和 TUN 啟用后,開始安裝 ppp 和 iptables:

  1. yum install -y ppp iptables  

二、安裝pptp:

  1. rpm -ivh http://acelnmp.googlecode.com/files/pptpd-1.3.3-1.rhel4.1.i386.rpm(適用32位系統(tǒng))   
  2. rpm -ivh http://acelnmp.googlecode.com/files/pptpd-1.3.3-1.rhel4.x86_64.rpm(適用64位系統(tǒng))  

三、配置pptp,編輯/etc/pptpd.conf文件:

  1. vim /etc/pptpd.conf  

把下面字段前面的#去掉:

  1. localip 192.168.0.1   
  2. remoteip 192.168.0.234-238,192.168.0.245  

四、編輯/etc/ppp/options.pptpd 文件:

  1. vim /etc/ppp/options.pptpd  

http://www.tofree.net/posts/236.html

去掉ms-dns前面的#,并使用Google的DNS服務(wù)器,修改成如下字段:

  1. ms-dns 8.8.8.8   
  2. ms-dns 8.8.4.4  

http://www.tofree.net/posts/236.html

五、設(shè)置VPN賬號密碼,編輯/etc/ppp/chap-secrets這個文件:

  1. vim /etc/ppp/chap-secrets  

http://www.tofree.net/posts/236.html

六、修改內(nèi)核設(shè)置,使其支持轉(zhuǎn)發(fā),編輯 /etc/sysctl.conf 文件:

  1. vim /etc/sysctl.conf  

將“net.ipv4.ip_forward”的值改為1,同時在“net.ipv4.tcp_syncookies = 1”前面加#

http://www.tofree.net/posts/236.html

七、使 sysctl.conf 配置文件生效并添加 iptables 轉(zhuǎn)發(fā)規(guī)則:

  1. sysctl -p iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to-source ***.***.***.*** (***.***.***.***為你VPS的公網(wǎng)IP地址)   
  2. iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 1723 -j ACCEPT #注:這條命令盡量放在防火墻列表前面幾條不然可能會阻止  

保存iptables轉(zhuǎn)發(fā)規(guī)則:

  1. /etc/init.d/iptables save  

重啟 iptables:

  1. /etc/init.d/iptables restart  

重啟pptp服務(wù):

  1. /etc/init.d/pptpd restart  

設(shè)置開機自動運行pptp服務(wù):

  1. chkconfig pptpd on  

設(shè)置開機自動運行iptables服務(wù):

  1. chkconfig iptables on  

http://www.tofree.net/posts/236.html 

到此安裝配置結(jié)束了。

======================以下是疑難問題解答=================================

iptables轉(zhuǎn)發(fā)規(guī)則寫錯了會出現(xiàn)錯誤678提示(親歷),可用

iptables -F 刪除舊規(guī)則再配置!

iptables使用方法見http://hi.baidu.com/756091339/item/41c7515418213a474fff207b

如果出現(xiàn)錯誤619則輸入命令

  1. rm /dev/ppp  
  2. mknod /dev/ppp c 108 0 

還不管用的話(有時出現(xiàn)錯誤651),請下載vps 上/var/log/messages 查看日志,最后發(fā)現(xiàn):

  1. Jan  2 07:26:11 fr pptpd[1604]: CTRL: Starting call (launching pppd, opening GRE) Jan 2 07:26:11 fr pppd[1605]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so is for pppd version 2.4.3, this is 2.4.5 Jan 2 07:26:11 fr pptpd[1604]: GRE: read(fd=6,buffer=804fa20,len=8196) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax and pppd logs Jan  2 07:26:11 fr pptpd[1604]: CTRL: PTY read or GRE write failed (pty,gre)=(6,7)  
  2. Jan  2 07:26:11 fr pptpd[1604]: CTRL: Client X.X.X.X control connection finished 

logwtmp插件版本不兼容出錯了

vi /etc/pptpd.conf

找到logwtmp,在前面加#

  1. service pptpd restart 

就解決了?。。?/span>

如果你需要圖形化管理VPN的話,建議使用Webmin:

  1. rpm -ivh http://nchc.dl.sourceforge.net/project/webadmin/webmin/1.510/webmin-1.510-1.noarch.rpm 

注意:如果虛擬機內(nèi)核不支持MPPE的話,無法使用加密,用WINDOWS默認VPN連接會顯示“證書信任錯誤”。

解決方法:修改/etc/ppp/options.pptpd注釋掉require-mppe-128這行,然后windows的vpn撥號的屬性改為可選加密,再次連接就成功了。

另外附上有用命令:

使用命令查看pptpd服務(wù)進程、端口和接口 使用ps命令檢查pptpd進程:

  1. ps -ef |grep pptpd  

使用netstat命令檢查pptpd運行的端口:

  1. netstat -nutap | grep pptpd  

使用ifconfig命令查看ppp0接口

centos設(shè)置VPN后,客戶端連接提示錯誤800! 

我是直接把iptables關(guān)閉了!哈哈 反正先連接進去再說了。

  1. iptables -P INPUT ACCEPT  
  2. iptables -P OUTPUT ACCEPT  
  3. iptables -F  
  4. iptables -X  
  5. iptables -P INPUT ACCEPT  
  6. iptables -P OUTPUT ACCEPT  
  7. /etc/init.d/iptables save   

原文鏈接:http://my.oschina.net/u/593517/blog/298714

責(zé)任編輯:牛小雨 來源: elson的博客
相關(guān)推薦

2014-02-19 14:54:58

CentOS 6.5Xen

2014-07-04 11:29:52

CentOSLinux壓縮工具

2012-08-07 14:39:59

Windows 8操作系統(tǒng)

2014-10-17 10:45:29

運維centos6.5安裝包

2021-10-19 22:22:17

電腦硬件微軟

2013-12-04 16:24:47

CentOSCentOS 6.5

2010-12-17 17:25:22

Office 2010

2013-11-27 09:37:38

CentOSCentOS 6.4VPN Server

2018-04-10 15:10:34

Windows64位32位

2017-12-28 10:26:31

系統(tǒng)CPU64位

2013-12-16 17:35:14

2020-11-03 06:55:41

系統(tǒng)版本64位

2009-12-17 10:05:07

LinuxdtAgeiaPhys

2011-07-28 09:42:58

Windows 764位32位

2015-09-10 16:06:06

32位64位Windows 10

2012-05-29 10:47:36

Windows 7操作系統(tǒng)

2021-03-02 15:02:07

Windows 7微軟操作系統(tǒng)

2011-04-22 09:49:56

Windows 732位64位

2010-03-22 14:22:21

Python安裝

2010-07-12 09:14:17

Windows 864位32位
點贊
收藏

51CTO技術(shù)棧公眾號