Openvpn的configuration问题 – 无法ping通VPN服务器的通常的IP地址

我是一个总的VPN noob设置我的第一个openvpn在我的办公室在192.168.0.xnetworking中有一个局域网的centos虚拟机。 我已经成功configuration我的笔记本电脑从家里连接 – 它得到了一个IP地址10.10.10.6。 我认为服务器得到10.10.10.1,当我平了它响应。 但是,当我ping服务器的noraml IP地址(192.168.0.108),我什么都没有得到。

这是server.conf文件:

local 0.0.0.0 port 1194 proto udp dev tun ca ca.crt cert server.crt key server.key # This file should be kept secret dh dh1024.pem server 10.10.10.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "route 10.0.3.0 255.255.255.0" keepalive 10 120 comp-lzo user openvpn group openvpn persist-key persist-tun status openvpn-status.log verb 4 

这是我的服务器的ifconfig的VPN部分:

 tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.10.10.1 PtP:10.10.10.2 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:22 errors:0 dropped:0 overruns:0 frame:0 TX packets:22 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:1234 (1.2 KiB) TX bytes:1158 (1.1 KiB) 

这是我的笔记本电脑的ipconfig:

 Windows IP Configuration Ethernet adapter Local Area Connection 2: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::c054:233e:21f1:ac42%14 IPv4 Address. . . . . . . . . . . : 10.10.10.6 Subnet Mask . . . . . . . . . . . : 255.255.255.252 Default Gateway . . . . . . . . . : Wireless LAN adapter Wireless Network Connection: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::b98a:8bd5:6739:1e54%12 IPv4 Address. . . . . . . . . . . : 192.168.1.2 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1 Ethernet adapter Local Area Connection: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Tunnel adapter isatap.{BF535BB4-4351-4B88-8ED1-17613C04282F}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Tunnel adapter isatap.{06736C0E-354E-4806-AA58-BDA90A1B4EDC}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Tunnel adapter Local Area Connection* 9: Connection-specific DNS Suffix . : IPv6 Address. . . . . . . . . . . : 2001:0:5ef5:79fd:38e6:357c:3f57:fefd Link-local IPv6 Address . . . . . : fe80::38e6:357c:3f57:fefd%16 Default Gateway . . . . . . . . . : :: 

这是我的win7笔记本电脑的路由打印输出

 C:\Users\BenLaptop7>route print =========================================================================== Interface List 14...00 ff 06 73 6c 0e ......TAP-Win32 Adapter V9 12...00 21 6a 27 a7 fa ......Intel(R) WiFi Link 5300 AGN 11...00 21 70 d9 6e bb ......Intel(R) 82567LM Gigabit Network Connection 1...........................Software Loopback Interface 1 17...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter 15...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3 16...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface =========================================================================== IPv4 Route Table =========================================================================== Active Routes: Network Destination Netmask Gateway Interface Metric 0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.2 25 10.0.3.0 255.255.255.0 10.10.10.5 10.10.10.6 30 10.10.10.1 255.255.255.255 10.10.10.5 10.10.10.6 30 10.10.10.4 255.255.255.252 On-link 10.10.10.6 286 10.10.10.6 255.255.255.255 On-link 10.10.10.6 286 10.10.10.7 255.255.255.255 On-link 10.10.10.6 286 127.0.0.0 255.0.0.0 On-link 127.0.0.1 306 127.0.0.1 255.255.255.255 On-link 127.0.0.1 306 127.255.255.255 255.255.255.255 On-link 127.0.0.1 306 192.168.1.0 255.255.255.0 On-link 192.168.1.2 281 192.168.1.2 255.255.255.255 On-link 192.168.1.2 281 192.168.1.255 255.255.255.255 On-link 192.168.1.2 281 224.0.0.0 240.0.0.0 On-link 127.0.0.1 306 224.0.0.0 240.0.0.0 On-link 10.10.10.6 286 224.0.0.0 240.0.0.0 On-link 192.168.1.2 281 255.255.255.255 255.255.255.255 On-link 127.0.0.1 306 255.255.255.255 255.255.255.255 On-link 10.10.10.6 286 255.255.255.255 255.255.255.255 On-link 192.168.1.2 281 =========================================================================== Persistent Routes: None 

…我真的不明白,但当我第一次得到它的工作,我能够通过键入\ 10.10.10.1从Windows连接到我的服务器(它有几个Samba股份),但是最近停止工作,因为我重新启动服务器,将默认运行级别设置为5,以便我可以设置VNC客户端来使用VPN。

有谁知道我怎么能a)再次得到这个工作,并b)使我的服务器可以通过其通常的IP地址(192.168.0.108)到达VPN?

很确定,你必须推动你想要允许的所有子网,前一阵子有这个设置。

http://openvpn.net/index.php/open-source/documentation/howto.html

 First, you must advertise the 10.66.0.0/24 subnet to VPN clients as being accessible through the VPN. This can easily be done with the following server-side config file directive: push "route 10.66.0.0 255.255.255.0" 

否则,路由被locking,openvpn服务器正试图保持你的内部networking安全。 所以除非你公布路线,否则客户将不被允许看到它们。

所以你想在你的服务器configuration中做到这一点…

 push "route 10.0.3.0 255.255.255.0" push "route 192.168.0.0 255.255.255.0"