我在Debian Squeeze中创build了一个Seagate DockStar作为家庭networking中的小型服务器。 我想现在从我自己的networking外部访问它,所以我需要一个VPN连接。 顺便说一句,我没有一个集成VPN服务器的路由器。 我已经有一个“大”的Windows XP服务器运行,我可以通过PPTP VPN隧道访问。 这很简单,但现在在Debian中,我在设置VPN连接时遇到了一些问题。
我通过安装了pptpd
apt-get install pptpd
已经。 这是我的pptpd.conf:
# TAG: ppp # Path to the pppd program, default '/usr/sbin/pppd' on Linux # #ppp /usr/sbin/pppd # TAG: option # Specifies the location of the PPP options file. # By default PPP looks in '/etc/ppp/options' # option /etc/ppp/pptpd-options # TAG: debug # Turns on (more) debugging to syslog # #debug # TAG: stimeout # Specifies timeout (in seconds) on starting ctrl connection # # stimeout 10 # TAG: noipparam # Suppress the passing of the client's IP address to PPP, which is # done by default otherwise. # #noipparam # TAG: logwtmp # Use wtmp(5) to record client connections and disconnections. # logwtmp # TAG: bcrelay <if> # Turns on broadcast relay to clients from interface <if> # #bcrelay eth1 # TAG: localip # TAG: remoteip # Specifies the local and remote IP address ranges. # # Any addresses work as long as the local machine takes care of the # routing. But if you want to use MS-Windows networking, you should # use IP addresses out of the LAN address space and use the proxyarp # option in the pppd options file, or run bcrelay. # # You can specify single IP addresses seperated by commas or you can # specify ranges, or both. For example: # # 192.168.0.234,192.168.0.245-249,192.168.0.254 # # IMPORTANT RESTRICTIONS: # # 1. No spaces are permitted between commas or within addresses. # # 2. If you give more IP addresses than MAX_CONNECTIONS, it will # start at the beginning of the list and go until it gets # MAX_CONNECTIONS IPs. Others will be ignored. # # 3. No shortcuts in ranges! ie. 234-8 does not mean 234 to 238, # you must type 234-238 if you mean this. # # 4. If you give a single localIP, that's ok - all local IPs will # be set to the given one. You MUST still give at least one remote # IP for each simultaneous client. # # (Recommended) localip 192.168.0.120 remoteip 192.168.0.121-129 # or #localip 192.168.0.234-238,192.168.0.245 #remoteip 192.168.1.234-238,192.168.1.245
我的路由器中的DHCP服务器是以192.168.0.2开头的IP地址。 我的大型服务器分配IP到192.168.0.121到VPN客户端(服务器本身有xxx120 TP) – 正如我已经写到,在大型服务器的VPN作品,所以我刚刚设置了localip和remoteip范围从那些大服务器。
我的pptpd选项如下所示:
# Authentication # Name of the local system for authentication purposes # (must match the second field in /etc/ppp/chap-secrets entries) name pptpd # Optional: domain name to use for authentication # domain mydomain.net # Strip the domain prefix from the username before authentication. # (applies if you use pppd with chapms-strip-domain patch) #chapms-strip-domain # Encryption # Debian: on systems with a kernel built with the package # kernel-patch-mppe >= 2.4.2 and using ppp >= 2.4.2, ... # {{{ refuse-pap refuse-chap refuse-mschap # Require the peer to authenticate itself using MS-CHAPv2 [Microsoft # Challenge Handshake Authentication Protocol, Version 2] authentication. require-mschap-v2 # Require MPPE 128-bit encryption # (note that MPPE requires the use of MSCHAP-V2 during authentication) #require-mppe-128 # }}} # Network and Routing # If pppd is acting as a server for Microsoft Windows clients, this # option allows pppd to supply one or two DNS (Domain Name Server) # addresses to the clients. The first instance of this option # specifies the primary DNS address; the second instance (if given) # specifies the secondary DNS address. # Attention! This information may not be taken into account by a Windows # client. See KB311218 in Microsoft's knowledge base for more information. #ms-dns 10.0.0.1 #ms-dns 10.0.0.2 # If pppd is acting as a server for Microsoft Windows or "Samba" # clients, this option allows pppd to supply one or two WINS (Windows # Internet Name Services) server addresses to the clients. The first # instance of this option specifies the primary WINS address; the # second instance (if given) specifies the secondary WINS address. #ms-wins 10.0.0.3 #ms-wins 10.0.0.4 # Add an entry to this system's ARP [Address Resolution Protocol] # table with the IP address of the peer and the Ethernet address of this # system. This will have the effect of making the peer appear to other # systems to be on the local ethernet. # (you do not need this if your PPTP server is responsible for routing # packets to the clients -- James Cameron) proxyarp # Debian: do not replace the default route nodefaultroute # Logging # Enable connection debugging facilities. # (see your syslog configuration for where pppd sends to) #debug # Print out all the option values which have been set. # (often requested by mailing list to verify options) #dump # Miscellaneous # Create a UUCP-style lock file for the pseudo-tty to ensure exclusive # access. lock # Disable BSD-Compress compression nobsdcomp ms-dns 192.168.0.1 netmask 255.255.255.0 noipx mtu 1490 mru 1490
在chap-secrets文件中,我注册了一个用户。 (如下所示: – 这是正确的吗?)
netstat告诉我,端口1723是开放的,由pptpd监听,以及来自另一台计算机的nmap端口扫描。 DockStar上没有安装iptables。 在我的路由器中,我将每个TCP或UDP连接端口1723转发到DockStar的IP。
我试着连接一个Windoows XP,一个Windows 7和一个Mac OS X客户端。 所有人都无法build立连接。 Mac OS X只显示一般错误信息,Windows客户端显示“错误619 – 无法build立与远程计算机的连接”。 客户端被configuration为使用MSCHAPv2和在chap-secrets文件中设置的用户名和密码。
如果我尝试从我的笔记本电脑连接到同一networking中的服务器或通过WWAN连接(WiFi已closures),则无关紧要 – 每次尝试连接时都不起作用。
有没有人知道服务器的configuration有什么问题,并知道如何让它工作?
提前致谢,
iYassin
当我已经将所有端口1723stream量转发到Debian Squeeze服务器时,我不清楚你是如何将PPTP运行到Windows XP服务器的。 您可能只能从您的本地局域网内的“VPN”到WinXP服务器,这似乎是有用的。
无论如何,PPTP不仅需要TCP端口1723stream量,还需要GRE协议。 你的路由器能够正确处理GRE隧道吗? 如果它是一个普通的消费级路由器,那么我不怀疑。 即使这样,GRE也足够深奥,因此寻求帮助可能会很困难。
在你的情况下,我build议尝试一个只使用TCP和/或UDP传输的VPN解决scheme,因为这些协议是无处不在,众所周知的。 OpenVPN就是这样一个VPN解决scheme,它可用于所有主要的操作系统(Win,Mac,Linux,* BSD)。
根据你想要完成的工作,另一种可能是在Debian服务器上运行sshd,例如:
apt-get install openssh-server
所有主要的操作系统都有免费的ssh客户端,可以通过ssh连接创build隧道。
那么,我真的没有在我的Debian安装上安装日志服务。 现在我安装了rsyslog,当我尝试通过Windows 7计算机通过PPTP连接到VPN服务器时,这里是写入/ var / log / syslog的日志:
Oct 17 20:05:57 debian pptpd[769]: MGR: Launching /usr/sbin/pptpctrl to handle client Oct 17 20:05:57 debian pptpd[769]: CTRL: local address = 192.168.1.1 Oct 17 20:05:57 debian pptpd[769]: CTRL: remote address = 192.168.2.1 Oct 17 20:05:57 debian pptpd[769]: CTRL: pppd options file = /etc/ppp/pptpd-options Oct 17 20:05:57 debian pptpd[769]: CTRL: Client 192.168.0.7 control connection started Oct 17 20:05:57 debian pptpd[769]: CTRL: Received PPTP Control Message (type: 1) Oct 17 20:05:57 debian pptpd[769]: CTRL: Made a START CTRL CONN RPLY packet Oct 17 20:05:57 debian pptpd[769]: CTRL: I wrote 156 bytes to the client. Oct 17 20:05:57 debian pptpd[769]: CTRL: Sent packet to client Oct 17 20:05:57 debian pptpd[769]: CTRL: Received PPTP Control Message (type: 7) Oct 17 20:05:57 debian pptpd[769]: CTRL: Set parameters to 100000000 maxbps, 64 window size Oct 17 20:05:57 debian pptpd[769]: CTRL: Made a OUT CALL RPLY packet Oct 17 20:05:57 debian pptpd[769]: CTRL: Starting call (launching pppd, opening GRE) Oct 17 20:05:57 debian pptpd[769]: CTRL: pty_fd = 6 Oct 17 20:05:57 debian pptpd[769]: CTRL: tty_fd = 7 Oct 17 20:05:57 debian pptpd[769]: CTRL: I wrote 32 bytes to the client. Oct 17 20:05:57 debian pptpd[769]: CTRL: Sent packet to client Oct 17 20:05:57 debian pptpd[771]: CTRL (PPPD Launcher): program binary = /usr/sbin/pppd Oct 17 20:05:57 debian pptpd[771]: CTRL (PPPD Launcher): local address = 192.168.1.1 Oct 17 20:05:57 debian pptpd[771]: CTRL (PPPD Launcher): remote address = 192.168.2.1 Oct 17 20:05:57 debian pptpd[769]: CTRL: Received PPTP Control Message (type: 15) Oct 17 20:05:57 debian pptpd[769]: CTRL: Got a SET LINK INFO packet with standard ACCMs Oct 17 20:05:57 debian pppd[771]: Plugin /usr/lib/pptpd/pptpd-logwtmp.so is for pppd version 2.4.4, this is 2.4.5 Oct 17 20:05:57 debian pptpd[769]: GRE: read(fd=6,buffer=1fb40,len=8196) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax and pppd logs Oct 17 20:05:57 debian pptpd[769]: CTRL: PTY read or GRE write failed (pty,gre)=(6,7) Oct 17 20:05:57 debian pptpd[769]: CTRL: Reaping child PPP[771] Oct 17 20:05:57 debian pptpd[769]: CTRL: Client 192.168.0.7 control connection finished Oct 17 20:05:57 debian pptpd[769]: CTRL: Exiting now Oct 17 20:05:57 debian pptpd[507]: MGR: Reaped child 769
似乎GRE有些问题…但是,正如我已经说过的,到我的Windows服务器的PPTP连接正在工作(如果我将路由器中的端口转发设置回Windows服务器)。 Windows服务器使用GRE进行PPTP VPN连接吗? 如果他们这样做,我想我可以认为我的路由器有GRE支持。 我可能需要在Debian系统上设置GRE支持吗?