在openvpn客户端上网的问题

我已经在我的vps中设置了一个openvpn访问服务器。 现在我住在中国,政府封锁了许多外国网站,如脸书和推特。

我可以通过运行windows xp的桌面使用中国防火墙的vpn服务器访问twitter等。

但是,我的笔记本电脑运行xubuntu 12.04无法突破国家防火墙。 我可以通过命令“sudo openvpn –config client.ovpn”在ubuntu中通过openvpnterminal客户端连接到vpn服务器。

由于桌面工作正常,我认为vpn访问服务器的设置是可以的。 在Ubuntu客户端有任何特定的设置? 我没有更改openvpn访问服务器提供的configuration。

我GOOGLE了这个问题很多,iptables的指示,让我很困惑。 我也打开ip在Ubuntu的前进。 仍然没有工作。

xubuntu中的原始路由表:

0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0 169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0 173.224.215.16 192.168.0.1 255.255.255.255 UGH 0 0 0 wlan0 192.168.0.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0 

连接到vpn后的路由表:

  0.0.0.0 5.5.0.1 128.0.0.0 UG 0 0 0 tun0 0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0 5.5.0.0 0.0.0.0 255.255.248.0 U 0 0 0 tun0 46.xxx 192.168.0.1 255.255.255.255 UGH 0 0 0 wlan0 128.0.0.0 5.5.0.1 128.0.0.0 UG 0 0 0 tun0 169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0 173.224.215.16 192.168.0.1 255.255.255.255 UGH 0 0 0 wlan0 192.168.0.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0 

46.xxx是我的vps的公共ip。

client.ovpn:

  ... setenv FORWARD_COMPATIBLE 1 client server-poll-timeout 4 nobind remote 46.xxx 1194 udp remote 46.xxx 1194 udp remote 46.xxx 443 tcp remote 46.xxx 1194 udp remote 46.xxx 1194 udp remote 46.xxx 1194 udp remote 46.xxx 1194 udp remote 46.xxx 1194 udp dev tun dev-type tun ns-cert-type server reneg-sec 604800 sndbuf 100000 rcvbuf 100000 auth-user-pass # NOTE: LZO commands are pushed by the Access Server at connect time. # NOTE: The below line doesn't disable LZO. comp-lzo no verb 3 setenv PUSH_PEER_INFO ... 

我省略了ca,key等

提前致谢。

我发现了这个问题! 这是中国国家防火墙造成的。

中国的DNS服务器全部被污染,“twitter”,“facebook”等网站已经被redirect到不存在的目标。 通过这种方式,网站不能在中国访问。 请参阅DNScaching中毒的链接。

所以使用VPN服务器做DNS查找可以解决这个问题,只需在openvpnconfiguration文件(client.ovpn)中添加两行:

 up /etc/openvpn/update-resolv-conf down /etc/openvpn/update-resolv-conf 

还要确保resolvconf软件包安装在客户端上,因为这个脚本依赖于它。

现在的OpenVPN访问服务器对我来说是很好的突破中国国家防火墙。