我使用以下方式安装了 OpenVPNhttps://github.com/Angristan/OpenVPN-install但我无法通过它访问互联网。它连接正常,根据计数器显示有几千字节通过,但我无法浏览互联网。目标是让 iPhone 通过 VPN 连接到互联网。我还可能错过了什么?
转发已开启:
% sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
伪装已打开(通过安装脚本):
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- 10.8.0.0/24 anywhere
OpenVPN 将客户端列为已连接:
OpenVPN CLIENT LIST
Updated,Sun Aug 26 18:54:09 2018
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
UNDEF,94.*.*.*:24174,108,66,Sun Aug 26 18:54:07 2018
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
GLOBAL STATS
Max bcast/mcast queue length,1
END
服务器.conf:
port 1194
proto tcp
dev tun
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 1.0.0.1"
push "dhcp-option DNS 1.1.1.1"
push "redirect-gateway def1 bypass-dhcp"
crl-verify crl.pem
ca ca.crt
cert server_**********.crt
key server_**********.key
tls-auth tls-auth.key 0
dh dh.pem
auth SHA256
cipher AES-128-CBC
tls-server
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-128-GCM-SHA256
status /var/log/openvpn/status.log
verb 3
duplicate-cn
客户端.ovpn:
client
proto tcp-client
remote my.dns.name 1194
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_********** name
auth SHA256
auth-nocache
cipher AES-128-CBC
tls-client
tls-version-min 1.2
tls-cipher TLS-DHE-RSA-WITH-AES-128-GCM-SHA256
setenv opt block-outside-dns
verb 3
<ca>
-----BEGIN CERTIFICATE-----
***
-----END CERTIFICATE-----
</ca>
<cert>
***
-----BEGIN CERTIFICATE-----
***
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
***
-----END PRIVATE KEY-----
</key>
key-direction 1
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
***
-----END OpenVPN Static key V1-----
</tls-auth>