gpt4 book ai didi

Android 4 OpenVPN App tun_builder_error (topology net30)

转载 作者:行者123 更新时间:2023-11-29 17:49:57 26 4
gpt4 key购买 nike

我在我的服务器上运行了一个 OpenVPN 服务器,我想连接多个设备(智能手机、笔记本电脑、台式电脑、平板电脑……)。我可以毫无问题地将笔记本电脑与 Linux 或 Mac OS X 或我的 Windows 8 平板电脑连接起来。所以这项工作非常好。

但是当我想将我的 Nexus 5 连接到 Android 4.4.2 时,OpenVPN 应用程序给我以下错误:

12:53:32.106 -- EVENT: TUN Error: tun_builder_error: ifconfig addresses are not in the same /30 subnet (topology net30)

这是我的 client.conf.:

client
dev tun
proto udp
remote xx.xx.xx.xx 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun

ca ca.crt
cert Nexus5.crt
key Nexus5.key

ns-cert-type server

comp-lzo
verb 3
pull

以及对应的server.conf:

script-security 2
port 1194
proto udp
dev tun

ca ca.crt
cert server.crt
key server.key
dh dh1024.pem

server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.8.0.0 255.255.255.0"
client-config-dir ccd

push "redirect-gateway def1"

push "dhcp-option DNS 208.67.220.220"
up ./up-script.sh
down ./down-script.sh

client-to-client
keepalive 10 120

comp-lzo

user nobody
group nogroup

persist-key
persist-tun

status openvpn-status.log
log openvpn.log
verb 3

ccd/Nexus5 文件:

ifconfig-push 10.8.0.11 255.255.255.0

我为每个客户端使用相同的 client.conf(当然是改编的证书)。它适用于所有设备,但 Nexus 5 除外。经过研究,我读到它可能有助于添加

push "topology subnet"

到 server.conf。但是没有客户端可以再连接,所以这无济于事。你能发现我的配置文件或其他任何错误吗?

这是来自 Nexus 5 OpenVPN 应用程序的日志:

12.53.30.522 -- ---- OpenVPN Start ----
12.53.30.523 -- EVENT: CORE_THREAD_ACTIVE
12.53.30.531 -- UNUSED OPTIONS
4 [resolv-retry] [infinite]
5 [nobind]
6 [user] [nobody]
7 [group] [nogroup]
8 [persist-key]
9 [persist-tun]
15 [verb 3]
16 [pull]

12:53:30:531 -- EVENT: RESOLVE
12:53:30.534 -- LZO-ASYM init swap=0 asym=0
12:53:30.534 -- Contacting xx.xx.xx.xx:1194 via UDP
12:53:30.535 -- EVENT: WAIT
12:53:30.537 -- Connecting to xx.xx.xx.xx:1194 via UDPv4
12:53:30.572 -- EVENT: CONNECTING
12:53:30.575 -- Tunnel Options:V4,dev-type tun,link-mtu 1542,tun-mtu 1500,proto UDPv4,comp-lzo,cipher BF-CBC,auth SHA1,keysize 128,key-method 2,tls-client
12:53:30.775 -- Peer Info:
IV_GUI_VER=net.oopenvpn.connect.android
1.1.13-53
IV_VER=3.0
IV_PLAT=android
IV_NCP=1
IV_LZO=1

12:53:30.779 -- VERIFY OK: depth=1
..
12:53:30.780 -- VERIFY OK: depth=0
..
12:53:31.121 -- SSL Handshake: TLSv1.0/TLS-DHE-RSA-WITH-AES-256-CBC-SHA
12:53:31.122 -- Session is ACTIVE
12:53:31.123 -- EVENT: GET_CONFIG
12:53:31.130 -- Sending PUSH_REQUEST to server...
12:53:31.165 -- OPTIONS:
0 [route] [10.8.0.0] [255.255.255.0]
1 [redirect-gateway] [def1]
2 [dhcp-option] [DNS] [208.67.220.220]
3 [route] [10.8.0.0] [255.255.255.0]
4 [topology] [net30]
5 [ping] [10]
6 [ping-restart] [120]
7 [ifconfig] [10.8.0.11] [255.255.255.0]

12:53:31.166 -- LZO-ASYM init swap=0 asym=0
12:53:31.167 -- EVENT: ASSIGN_IP
12:53:31.177 -- TUN Error: tun_builder_error: ifconfig addresses are not on the same /30 subnet (topology 30)
12:53:31.181 -- EVENT: TUN_SETUP_FAILED
info='tun_builder_error: ifconfig addresses are not on the same /30 subnet (topology 30)'
12:53:31.188 -- EVENT: DISCONNECTED
12:53:31.198 -- EVENT: CORE_THREAD_INACTIVE
12:53:31.199 -- Tunnel bytes per CPU second: 0
12:53:31.200 -- ---- OpenVPN Stop ----

谢谢!

最佳答案

问题解决:

我这样配置客户端到客户端的路由:

ifconfig-push 10.8.0.11 255.255.255.0

Android 版 OpenVPN 应用程序中的日志表明,不必有子网掩码,而是第二个(不同的)IP 地址。配置 VPN,documentation总是好的。

它说

Each pair of ifconfig-push addresses represent the virtual client and server IP endpoints. They must be taken from successive /30 subnets in order to be compatible with Windows clients and the TAP-Windows driver.

现在看起来像这样:

ifconfig-push 10.8.0.13 10.8.0.14

此外,该文档还包含一个包含 IP 地址对示例的表格。更改此设置后,它又可以工作了。我不知道为什么 Android 有问题,而 OS X、Linux 和 Windows 上的其他客户端没有。但重要的是它又开始工作了。

关于Android 4 OpenVPN App tun_builder_error (topology net30),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23592277/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com