我在使用 Android 客户端连接 OpenVPN 服务器时遇到问题。
我刚刚使用提供的脚本安装了它 https://github.com/Nyr/openvpn-install(openvpn-安装.sh);
我正在运行 Ubuntu Server 16.04。
基本上,我可以使用任何 Android OpenVPN 客户端(我尝试了几个)进行连接而不会出现错误,但没有互联网连接。Android 版本 5.1。在我的 Ubuntu 笔记本电脑上使用 openvpn-networkmanager 插件,一切都很好(包括互联网导航)- 通过 3G 热点连接。
/etc/openvpn/server.conf
这是Ubuntu服务器上的内容:
port 1194
proto udp
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-auth ta.key 0
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 192.168.1.1"
keepalive 10 120
cipher AES-256-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem
这是在 Android 上启动 VPN 客户端后立即出现的 JOURNALCTL 日志 - 然后我的笔记本电脑 (HP) 上的 VPN 也启动了:
asds@asds-desk:~$ journalctl --since 14:47
Mar 25 15:47:01 asds-desk sslh[2185]: connection from modemtelecom.homenet.telecomitalia.it:52106 to asds-desk.homenet.telecomitalia. Mar 25 15:47:03 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 TLS: new session incoming connection from [AF_INET]176.200.108. Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 CRL CHECK OK: CN=ChangeMe Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 VERIFY OK: depth=1, CN=ChangeMe Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 CRL CHECK OK: CN=m3s Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 VERIFY OK: depth=0, CN=m3s Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 Data Channel Encrypt: Using 512 bit message hash 'SHA512' for H Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 Data Channel Decrypt: Using 512 bit message hash 'SHA512' for H Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 TLS: move_session: dest=TM_ACTIVE src=TM_UNTRUSTED reinit_src=1 Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 TLS: tls_multi_process: untrusted session promoted to semi-trus Mar 25 15:47:04 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM Mar 25 15:47:05 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 PUSH: Received control message: 'PUSH_REQUEST' Mar 25 15:47:05 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 send_push_reply(): safe_cap=940 Mar 25 15:47:05 asds-desk ovpn-server[1475]: m3s/176.200.108.67:48988 SENT CONTROL [m3s]: 'PUSH_REPLY,redirect-gateway def1 bypass-dh Mar 25 15:47:33 asds-desk sslh[2185]: connection from modemtelecom.homenet.telecomitalia.it:52023 to asds-desk.homenet.telecomitalia. Mar 25 15:48:05 asds-desk sslh[2185]: connection from modemtelecom.homenet.telecomitalia.it:57946 to asds-desk.homenet.telecomitalia. Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 TLS: Initial packet from [AF_INET]176.200.108.67:48819, sid=1ef5e4e Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 CRL CHECK OK: CN=ChangeMe Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 VERIFY OK: depth=1, CN=ChangeMe Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 CRL CHECK OK: CN=hp Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 VERIFY OK: depth=0, CN=hp Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 bit Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 Data Channel Encrypt: Using 512 bit message hash 'SHA512' for HMAC Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 bit Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 Data Channel Decrypt: Using 512 bit message hash 'SHA512' for HMAC Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA Mar 25 15:48:11 asds-desk ovpn-server[1475]: 176.200.108.67:48819 [hp] Peer Connection Initiated with [AF_INET]176.200.108.67:48819 Mar 25 15:48:11 asds-desk ovpn-server[1475]: hp/176.200.108.67:48819 MULTI_sva: pool returned IPv4=10.8.0.5, IPv6=(Not enabled) Mar 25 15:48:11 asds-desk ovpn-server[1475]: hp/176.200.108.67:48819 MULTI: Learn: 10.8.0.5 -> hp/176.200.108.67:48819