Windows openvpn客户端连接,但IP不变

我有一台Ubuntu的机器上运行openvpn服务器。 当我尝试连接到ubuntu机器时,从不同networking上的Windows机器连接到它。 我甚至可以ping通ubuntu机器的本地ip。 但我没有得到一个公共IP地址。 这是计算机(Windows)的公共IP地址保持不变,不会更改(在cmyip上检查)。 为什么会发生这种情况,我应该如何解决这个问题?

客户端configuration:

client proto udp dev tun ca ca.crt dh dh2048.pem cert client3.crt key client3.key remote publicip 1194 cipher DES-CBC verb 2 mute 20 keepalive 10 120 comp-lzo persist-key persist-tun float resolv-retry infinite nobind 

服务器configuration:

 port 1194 proto udp dev tun0 ca keys/test/ca.crt cert keys/test/check.crt key keys/test/check.key dh keys/test/dh2048.pem server 10.180.240.0 255.255.240.0 crl-verify keys/test/crl.pem cipher DES-CBC user nobody group nogroup status servers/VPn1/logs/openvpn-status.log log-append servers/VPn1/logs/openvpn.log verb 2 mute 20 max-clients 100 local 192.168.1.101 keepalive 10 120 client-config-dir /etc/openvpn/servers/VPn1/ccd client-to-client duplicate-cn comp-lzo persist-key persist-tun ccd-exclusive route 10.22.1.0 255.255.255.0 route 10.22.2.0 255.255.255.0 route 10.22.3.0 255.255.255.0 push "route 10.180.0.0 255.255.252.0" push "route 10.22.1.0 255.255.255.0" push "route 10.22.2.0 255.255.255.0" push "route 10.22.3.0 255.255.255.0" push "dhcp-option DNS 10.180.3.12" 

ipconfig / all

 Tunnel adapter 6TO4 Adapter: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft 6to4 Adapter Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap.{}: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft ISATAP Adapter Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap. Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap. Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap. Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft ISATAP Adapter #4 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Tunnel adapter isatap.: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Microsoft ISATAP Adapter #5 Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes 

如果你想使用OpenVPN服务器作为网关,你需要推送默认路由到你的客户端。

服务器configuration:

 push "redirect-gateway def1" 

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

你的期望是不正确的。 没有什么可以告诉机器使用VPN作为它的Internet网关,所以没有必要改变它的公共IP地址。

这是适当的Windows 7和dd-wrt设置

服务器configuration:

 server 172.20.20.0 255.255.255.248 push "dhcp-option DNS 192.168.0.1" push "dhcp-option DNS 8.8.8.8" push "dhcp-option DNS 8.8.4.4" dev tun0 proto tcp port 443 keepalive 15 30 daemon verb 0 mute 5 comp-lzo duplicate-cn tls-server dh /tmp/openvpn/dh.pem ca /tmp/openvpn/ca.crt cert /tmp/openvpn/cert.pem key /tmp/openvpn/key.pem tls-auth /tmp/openvpn/ta.key 0 management localhost 14 

客户端configuration:

 client dev tun0 proto tcp port 443 remote xxx.xxx.xxx.xxx 443 remote xxx.xxx.xxx.xxx 443 nobind persist-key persist-tun ns-cert-type server comp-lzo verb 3 ca ca.crt cert client1.crt key client1.key tls-auth ta.key 1 

DD-wrt防火墙:

 iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT iptables -I FORWARD 1 --source 172.20.20.0/29 -j ACCEPT 

是的,我可以解释它如何回答原来的post,1.我的DD-Wrt家庭路由器上有一个工作的OpenVPN,其中所有的stream量都通过vpn路由。 2.正如你会注意到在我的configuration我离开dev dev0 andriod和Linux不喜欢水龙头。 当他仍然连接到家庭VPN时,原始海报认为他的IP将被改变魔术。 使用我的正确设置,重新启动路由器,然后连接客户机。 做一个IP检查,然后去一个外面的热点,再次连接客户端机器到VPN通过热点宾果您的IP现在已经改变到您的家庭公共IP。 魔法。

如果你是在你的客厅连接到你的VPN当然你的IP显示你的公共家庭IP,离开和公共WiFi再次连接到你的VPN它仍然会显示你的家庭公共IP VPN不会掩盖你的真实IP。 您将需要使用该任务的代理。 vpn分配ip的方式与普通路由器一样,但是对于vpn,你的数据是encryption的。

或使用外侧VPN。

互联网上有这么多的信息,很难find准确的信息和答案。