我正在尝试让我的客户端通过运行OpenVPN的VPS转发所有流量。如您所见,它将允许对域和原始IP地址执行ping操作,但是将不允许通过curl和traceroute进行的通信没有任何内容。未连接到VPN时,流量正常工作。
所有信息都在这里:https : //pastebin.com/tGspNefn
谢谢。
由于以下解决方案,配置工作正常:
服务器:
port <integer>
proto udp
dev tun
ca ca.crt
cert vpnserver.crt
key vpnserver.key # This file should be kept secret
dh dh4096.pem
tls-auth ta.key 0
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway autolocal"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
cipher AES-256-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
客户:
client
dev tun
proto udp
remote x.x.x.x <port number>
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert vpnclient.crt
key vpnclient.key
tls-auth ta.key 1
ns-cert-type server
cipher AES-256-CBC
comp-lzo
verb 3
/sbin/route add -net 0.0.0.0 netmask 128.0.0.0 gw 10.8.0.5
为什么要使用netmask 128.0.0.0?