RTNETLINK answers: No such device

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
ks_zealot
OpenVpn Newbie
Posts: 1
Joined: Fri Nov 25, 2022 3:38 pm

RTNETLINK answers: No such device

Post by ks_zealot » Fri Nov 25, 2022 3:45 pm

I tried to create vpn client for Android from scratch and have issue with openvpn.
Openvpn compiled from sources with android support.

Code: Select all

OpenVPN 2.5.8 arm-unknown-linux-gnueabi [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Nov 25 2022
library versions: OpenSSL 1.1.1g  21 Apr 2020, LZO 2.09
Originally developed by James Yonan
Copyright (C) 2002-2022 OpenVPN Inc <sales@openvpn.net>
Compile time defines: enable_async_push=no enable_comp_stub=no enable_crypto_ofb_cfb=yes enable_debug=no enable_def_auth=yes enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown enable_fast_install=needless enable_fragment=yes enable_iproute2=yes enable_libtool_lock=yes enable_lz4=yes enable_lzo=yes enable_management=yes enable_multihome=yes enable_pam_dlopen=no enable_pedantic=no enable_pf=yes enable_pkcs11=no enable_plugin_auth_pam=no enable_plugin_down_root=no enable_plugins=no enable_port_share=yes enable_selinux=no enable_server=no enable_shared=no enable_shared_with_static_runtimes=no enable_small=no enable_static=yes enable_strict=no enable_strict_options=no enable_systemd=no enable_werror=no enable_win32_dll=yes enable_x509_alt_username=no with_aix_soname=aix with_crypto_library=openssl with_gnu_ld=yes with_mem_check=no with_openssl_engine=auto with_sysroot=no
I have totally working client config downloaded from vpngate

Code: Select all

###############################################################################
# OpenVPN 2.0 Sample Configuration File
# for PacketiX VPN / SoftEther VPN Server
# 
# !!! AUTO-GENERATED BY SOFTETHER VPN SERVER MANAGEMENT TOOL !!!
# 
# !!! YOU HAVE TO REVIEW IT BEFORE USE AND MODIFY IT AS NECESSARY !!!
# 
# This configuration file is auto-generated. You might use this config file
# in order to connect to the PacketiX VPN / SoftEther VPN Server.
# However, before you try it, you should review the descriptions of the file
# to determine the necessity to modify to suitable for your real environment.
# If necessary, you have to modify a little adequately on the file.
# For example, the IP address or the hostname as a destination VPN Server
# should be confirmed.
# 
# Note that to use OpenVPN 2.0, you have to put the certification file of
# the destination VPN Server on the OpenVPN Client computer when you use this
# config file. Please refer the below descriptions carefully.


###############################################################################
# Specify the type of the layer of the VPN connection.
# 
# To connect to the VPN Server as a "Remote-Access VPN Client PC",
#  specify 'dev tun'. (Layer-3 IP Routing Mode)
#
# To connect to the VPN Server as a bridging equipment of "Site-to-Site VPN",
#  specify 'dev tap'. (Layer-2 Ethernet Bridgine Mode)

dev tun
;push "redirect-gateway def1"

;redirect-gateway def1
###############################################################################
# Specify the underlying protocol beyond the Internet.
# Note that this setting must be correspond with the listening setting on
# the VPN Server.
# 
# Specify either 'proto tcp' or 'proto udp'.

proto tcp


###############################################################################
# The destination hostname / IP address, and port number of
# the target VPN Server.
# 
# You have to specify as 'remote <HOSTNAME> <PORT>'. You can also
# specify the IP address instead of the hostname.
# 
# Note that the auto-generated below hostname are a "auto-detected
# IP address" of the VPN Server. You have to confirm the correctness
# beforehand.
# 
# When you want to connect to the VPN Server by using TCP protocol,
# the port number of the destination TCP port should be same as one of
# the available TCP listeners on the VPN Server.
# 
# When you use UDP protocol, the port number must same as the configuration
# setting of "OpenVPN Server Compatible Function" on the VPN Server.

;remote public-vpn-68.opengw.net 443
remote 219.100.37.17 443

###############################################################################
# The HTTP/HTTPS proxy setting.
# 
# Only if you have to use the Internet via a proxy, uncomment the below
# two lines and specify the proxy address and the port number.
# In the case of using proxy-authentication, refer the OpenVPN manual.

;http-proxy-retry
;http-proxy [proxy server] [proxy port]


###############################################################################
# The encryption and authentication algorithm.
# 
# Default setting is good. Modify it as you prefer.
# When you specify an unsupported algorithm, the error will occur.
# 
# The supported algorithms are as follows:
#  cipher: [NULL-CIPHER] NULL AES-128-CBC AES-192-CBC AES-256-CBC BF-CBC
#          CAST-CBC CAST5-CBC DES-CBC DES-EDE-CBC DES-EDE3-CBC DESX-CBC
#          RC2-40-CBC RC2-64-CBC RC2-CBC
#  auth:   SHA SHA1 MD5 MD4 RMD160

cipher AES-128-CBC
auth SHA1


###############################################################################
# Other parameters necessary to connect to the VPN Server.
# 
# It is not recommended to modify it unless you have a particular need.

resolv-retry infinite
nobind
persist-key
persist-tun
client
verb 3
#auth-user-pass


###############################################################################
# The certificate file of the destination VPN Server.
# 
# The CA certificate file is embedded in the inline format.
# You can replace this CA contents if necessary.
# Please note that if the server certificate is not a self-signed, you have to
# specify the signer's root certificate (CA) here.

<ca>
-----BEGIN CERTIFICATE-----
MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB
iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw
MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV
BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU
aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy
dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK
AoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B
3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLod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Cy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZ
XHlKYC6SQK5MNyosycdiyA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/
qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB
VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB
L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG
jjxDah2nGN59PRbxYvnKkKj9
-----END CERTIFICATE-----

</ca>


###############################################################################
# The client certificate file (dummy).
# 
# In some implementations of OpenVPN Client software
# (for example: OpenVPN Client for iOS),
# a pair of client certificate and private key must be included on the
# configuration file due to the limitation of the client.
# So this sample configuration file has a dummy pair of client certificate
# and private key as follows.

<cert>
-----BEGIN CERTIFICATE-----
MIICxjCCAa4CAQAwDQYJKoZIhvcNAQEFBQAwKTEaMBgGA1UEAxMRVlBOR2F0ZUNs
aWVudENlcnQxCzAJBgNVBAYTAkpQMB4XDTEzMDIxMTAzNDk0OVoXDTM3MDExOTAz
MTQwN1owKTEaMBgGA1UEAxMRVlBOR2F0ZUNsaWVudENlcnQxCzAJBgNVBAYTAkpQ
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5h2lgQQYUjwoKYJbzVZA
5VcIGd5otPc/qZRMt0KItCFA0s9RwReNVa9fDRFLRBhcITOlv3FBcW3E8h1Us7RD
4W8GmJe8zapJnLsD39OSMRCzZJnczW4OCH1PZRZWKqDtjlNca9AF8a65jTmlDxCQ
CjntLIWk5OLLVkFt9/tScc1GDtci55ofhaNAYMPiH7V8+1g66pGHXAoWK6AQVH67
XCKJnGB5nlQ+HsMYPV/O49Ld91ZN/2tHkcaLLyNtywxVPRSsRh480jju0fcCsv6h
p/0yXnTB//mWutBGpdUlIbwiITbAmrsbYnjigRvnPqX1RNJU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ZCZ9ffho
zXedFj486IFoc5gnTp2N6jsnVj4LCGIhlVHlYGozKKFqJcQVGsHCqq1oz2zjW6LS
oRYIHgECgYEA8zZrkCwNYSXJuODJ3m/hOLVxcxgJuwXoiErWd0E42vPanjjVMhnt
KY5l8qGMJ6FhK9LYx2qCrf/E0XtUAZ2wVq3ORTyGnsMWre9tLYs55X+ZN10Tc75z
4hacbU0hqKN1HiDmsMRY3/2NaZHoy7MKnwJJBaG48l9CCTlVwMHocIECgYEA8jby
dGjxTH+6XHWNizb5SRbZxAnyEeJeRwTMh0gGzwGPpH/sZYGzyu0SySXWCnZh3Rgq
5uLlNxtrXrljZlyi2nQdQgsq2YrWUs0+zgU+22uQsZpSAftmhVrtvet6MjVjbByY
DADciEVUdJYIXk+qnFUJyeroLIkTj7WYKZ6RjksCgYBoCFIwRDeg42oK89RFmnOr
LymNAq4+2oMhsWlVb4ejWIWeAk9nc+GXUfrXszRhS01mUnU5r5ygUvRcarV/T3U7
TnMZ+I7Y4DgWRIDd51znhxIBtYV5j/C/t85HjqOkH+8b6RTkbchaX3mau7fpUfds
Fq0nhIq42fhEO8srfYYwgQKBgQCyhi1N/8taRwpk+3/IDEzQwjbfdzUkWWSDk9Xs
H/pkuRHWfTMP3flWqEYgW/LW40peW2HDq5imdV8+AgZxe/XMbaji9Lgwf1RY005n
KxaZQz7yqHupWlLGF68DPHxkZVVSagDnV/sztWX6SFsCqFVnxIXifXGC4cW5Nm9g
va8q4QKBgQCEhLVeUfdwKvkZ94g/GFz731Z2hrdVhgMZaU/u6t0V95+YezPNCQZB
wmE9Mmlbq1emDeROivjCfoGhR3kZXW1pTKlLh6ZMUQUOpptdXva8XxfoqQwa3enA
M7muBbF0XN7VO80iJPv+PmIZdEIAkpwKfi201YB+BafCIuGxIF50Vg==
-----END RSA PRIVATE KEY-----

</key>
And during connection I receive error message on verb 4

Code: Select all

./openvpn --config /sdcard/Download/vpngate_public-vpn-68.opengw.net_tcp_443.ovpn --dev-node /dev/tun --verb 4                                                                                                 
2022-11-25 15:32:14 us=710850 DEPRECATED OPTION: --cipher set to 'AES-128-CBC' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM). Future OpenVPN version will ignore --cipher for cipher negotiations. Add 'AES-128-CBC' to --data-ciphers or change --cipher 'AES-128-CBC' to --data-ciphers-fallback 'AES-128-CBC' to silence this warning.
2022-11-25 15:32:14 us=712254 Current Parameter Settings:
2022-11-25 15:32:14 us=712330   config = '/sdcard/Download/vpngate_public-vpn-68.opengw.net_tcp_443.ovpn'
2022-11-25 15:32:14 us=712390   mode = 0
2022-11-25 15:32:14 us=712447   persist_config = DISABLED
2022-11-25 15:32:14 us=712499   persist_mode = 1
2022-11-25 15:32:14 us=712556   show_ciphers = DISABLED
2022-11-25 15:32:14 us=712609   show_digests = DISABLED
2022-11-25 15:32:14 us=712662   show_engines = DISABLED
2022-11-25 15:32:14 us=712714   genkey = DISABLED
2022-11-25 15:32:14 us=712769   genkey_filename = '[UNDEF]'
2022-11-25 15:32:14 us=712822   key_pass_file = '[UNDEF]'
2022-11-25 15:32:14 us=712875   show_tls_ciphers = DISABLED
2022-11-25 15:32:14 us=712933   connect_retry_max = 0
2022-11-25 15:32:14 us=712986 Connection profiles [0]:
2022-11-25 15:32:14 us=713051   proto = tcp-client
2022-11-25 15:32:14 us=713106   local = '[UNDEF]'
2022-11-25 15:32:14 us=713158   local_port = '[UNDEF]'
2022-11-25 15:32:14 us=713210   remote = '219.100.37.17'
2022-11-25 15:32:14 us=713263   remote_port = '443'
2022-11-25 15:32:14 us=713319   remote_float = DISABLED
2022-11-25 15:32:14 us=713372   bind_defined = DISABLED
2022-11-25 15:32:14 us=713425   bind_local = DISABLED
2022-11-25 15:32:14 us=713480   bind_ipv6_only = DISABLED
2022-11-25 15:32:14 us=713535   connect_retry_seconds = 5
2022-11-25 15:32:14 us=713588   connect_timeout = 120
2022-11-25 15:32:14 us=713643   socks_proxy_server = '[UNDEF]'
2022-11-25 15:32:14 us=713698   socks_proxy_port = '[UNDEF]'
2022-11-25 15:32:14 us=713753   tun_mtu = 1500
2022-11-25 15:32:14 us=713804   tun_mtu_defined = ENABLED
2022-11-25 15:32:14 us=713864   link_mtu = 1500
2022-11-25 15:32:14 us=713916   link_mtu_defined = DISABLED
2022-11-25 15:32:14 us=713968   tun_mtu_extra = 0
2022-11-25 15:32:14 us=714018   tun_mtu_extra_defined = DISABLED
2022-11-25 15:32:14 us=714077   mtu_discover_type = -1
2022-11-25 15:32:14 us=714130   fragment = 0
2022-11-25 15:32:14 us=714182   mssfix = 1450
2022-11-25 15:32:14 us=714232   explicit_exit_notification = 0
2022-11-25 15:32:14 us=714284   tls_auth_file = '[UNDEF]'
2022-11-25 15:32:14 us=714340   key_direction = not set
2022-11-25 15:32:14 us=714392   tls_crypt_file = '[UNDEF]'
2022-11-25 15:32:14 us=714445   tls_crypt_v2_file = '[UNDEF]'
2022-11-25 15:32:14 us=714499 Connection profiles END
2022-11-25 15:32:14 us=714554   remote_random = DISABLED
2022-11-25 15:32:14 us=714605   ipchange = '[UNDEF]'
2022-11-25 15:32:14 us=714657   dev = 'tun'
2022-11-25 15:32:14 us=714710   dev_type = '[UNDEF]'
2022-11-25 15:32:14 us=714765   dev_node = '/dev/tun'
2022-11-25 15:32:14 us=714819   lladdr = '[UNDEF]'
2022-11-25 15:32:14 us=714871   topology = 1
2022-11-25 15:32:14 us=714922   ifconfig_local = '[UNDEF]'
2022-11-25 15:32:14 us=714974   ifconfig_remote_netmask = '[UNDEF]'
2022-11-25 15:32:14 us=715026   ifconfig_noexec = DISABLED
2022-11-25 15:32:14 us=715079   ifconfig_nowarn = DISABLED
2022-11-25 15:32:14 us=715131   ifconfig_ipv6_local = '[UNDEF]'
2022-11-25 15:32:14 us=715185   ifconfig_ipv6_netbits = 0
2022-11-25 15:32:14 us=715243   ifconfig_ipv6_remote = '[UNDEF]'
2022-11-25 15:32:14 us=715296   shaper = 0
2022-11-25 15:32:14 us=715347   mtu_test = 0
2022-11-25 15:32:14 us=715396   mlock = DISABLED
2022-11-25 15:32:14 us=715449   keepalive_ping = 0
2022-11-25 15:32:14 us=715502   keepalive_timeout = 0
2022-11-25 15:32:14 us=715554   inactivity_timeout = 0
2022-11-25 15:32:14 us=715620   inactivity_minimum_bytes = 0
2022-11-25 15:32:14 us=715672   ping_send_timeout = 0
2022-11-25 15:32:14 us=715726   ping_rec_timeout = 0
2022-11-25 15:32:14 us=715780   ping_rec_timeout_action = 0
2022-11-25 15:32:14 us=715833   ping_timer_remote = DISABLED
2022-11-25 15:32:14 us=715889   remap_sigusr1 = 0
2022-11-25 15:32:14 us=715941   persist_tun = ENABLED
2022-11-25 15:32:14 us=715993   persist_local_ip = DISABLED
2022-11-25 15:32:14 us=716048   persist_remote_ip = DISABLED
2022-11-25 15:32:14 us=716101   persist_key = ENABLED
2022-11-25 15:32:14 us=716154   passtos = DISABLED
2022-11-25 15:32:14 us=716206   resolve_retry_seconds = 1000000000
2022-11-25 15:32:14 us=716262   resolve_in_advance = DISABLED
2022-11-25 15:32:14 us=716315   username = '[UNDEF]'
2022-11-25 15:32:14 us=716366   groupname = '[UNDEF]'
2022-11-25 15:32:14 us=716418   chroot_dir = '[UNDEF]'
2022-11-25 15:32:14 us=716470   cd_dir = '[UNDEF]'
2022-11-25 15:32:14 us=716521   writepid = '[UNDEF]'
2022-11-25 15:32:14 us=716574   up_script = '[UNDEF]'
2022-11-25 15:32:14 us=716627   down_script = '[UNDEF]'
2022-11-25 15:32:14 us=716678   down_pre = DISABLED
2022-11-25 15:32:14 us=716730   up_restart = DISABLED
2022-11-25 15:32:14 us=716781   up_delay = DISABLED
2022-11-25 15:32:14 us=716833   daemon = DISABLED
2022-11-25 15:32:14 us=716884   inetd = 0
2022-11-25 15:32:14 us=716936   log = DISABLED
2022-11-25 15:32:14 us=716992   suppress_timestamps = DISABLED
2022-11-25 15:32:14 us=717044   machine_readable_output = DISABLED
2022-11-25 15:32:14 us=717096   nice = 0
2022-11-25 15:32:14 us=717149   verbosity = 4
2022-11-25 15:32:14 us=717200   mute = 0
2022-11-25 15:32:14 us=717251   status_file = '[UNDEF]'
2022-11-25 15:32:14 us=717304   status_file_version = 1
2022-11-25 15:32:14 us=717356   status_file_update_freq = 60
2022-11-25 15:32:14 us=717407   occ = ENABLED
2022-11-25 15:32:14 us=717459   rcvbuf = 0
2022-11-25 15:32:14 us=717510   sndbuf = 0
2022-11-25 15:32:14 us=717562   mark = 0
2022-11-25 15:32:14 us=717617   sockflags = 0
2022-11-25 15:32:14 us=717668   fast_io = DISABLED
2022-11-25 15:32:14 us=717721   comp.alg = 0
2022-11-25 15:32:14 us=717773   comp.flags = 0
2022-11-25 15:32:14 us=717826   route_script = '[UNDEF]'
2022-11-25 15:32:14 us=717880   route_default_gateway = '[UNDEF]'
2022-11-25 15:32:14 us=717934   route_default_metric = 0
2022-11-25 15:32:14 us=717987   route_noexec = DISABLED
2022-11-25 15:32:14 us=718036   route_delay = 0
2022-11-25 15:32:14 us=718090   route_delay_window = 30
2022-11-25 15:32:14 us=718143   route_delay_defined = DISABLED
2022-11-25 15:32:14 us=718196   route_nopull = DISABLED
2022-11-25 15:32:14 us=718253   route_gateway_via_dhcp = DISABLED
2022-11-25 15:32:14 us=718309   allow_pull_fqdn = DISABLED
2022-11-25 15:32:14 us=718366   [redirect_default_gateway local=0]
2022-11-25 15:32:14 us=718422   management_addr = '[UNDEF]'
2022-11-25 15:32:14 us=718477   management_port = '[UNDEF]'
2022-11-25 15:32:14 us=718530   management_user_pass = '[UNDEF]'
2022-11-25 15:32:14 us=718585   management_log_history_cache = 250
2022-11-25 15:32:14 us=718639   management_echo_buffer_size = 100
2022-11-25 15:32:14 us=718694   management_write_peer_info_file = '[UNDEF]'
2022-11-25 15:32:14 us=718748   management_client_user = '[UNDEF]'
2022-11-25 15:32:14 us=718805   management_client_group = '[UNDEF]'
2022-11-25 15:32:14 us=718859   management_flags = 0
2022-11-25 15:32:14 us=718912   shared_secret_file = '[UNDEF]'
2022-11-25 15:32:14 us=718967   key_direction = not set
2022-11-25 15:32:14 us=719019   ciphername = 'AES-128-CBC'
2022-11-25 15:32:14 us=719070   ncp_enabled = ENABLED
2022-11-25 15:32:14 us=719124   ncp_ciphers = 'AES-256-GCM:AES-128-GCM:AES-128-CBC'
2022-11-25 15:32:14 us=719180   authname = 'SHA1'
2022-11-25 15:32:14 us=719233   prng_hash = 'SHA1'
2022-11-25 15:32:14 us=719284   prng_nonce_secret_len = 16
2022-11-25 15:32:14 us=719345   keysize = 0
2022-11-25 15:32:14 us=719399   engine = DISABLED
2022-11-25 15:32:14 us=719451   replay = ENABLED
2022-11-25 15:32:14 us=719502   mute_replay_warnings = DISABLED
2022-11-25 15:32:14 us=719557   replay_window = 64
2022-11-25 15:32:14 us=719609   replay_time = 15
2022-11-25 15:32:14 us=719660   packet_id_file = '[UNDEF]'
2022-11-25 15:32:14 us=719715   test_crypto = DISABLED
2022-11-25 15:32:14 us=719768   tls_server = DISABLED
2022-11-25 15:32:14 us=719822   tls_client = ENABLED
2022-11-25 15:32:14 us=719875   ca_file = '[INLINE]'
2022-11-25 15:32:14 us=719928   ca_path = '[UNDEF]'
2022-11-25 15:32:14 us=719979   dh_file = '[UNDEF]'
2022-11-25 15:32:14 us=720031   cert_file = '[INLINE]'
2022-11-25 15:32:14 us=720083   extra_certs_file = '[UNDEF]'
2022-11-25 15:32:14 us=720135   priv_key_file = '[INLINE]'
2022-11-25 15:32:14 us=720190   pkcs12_file = '[UNDEF]'
2022-11-25 15:32:14 us=720243   cipher_list = '[UNDEF]'
2022-11-25 15:32:14 us=720297   cipher_list_tls13 = '[UNDEF]'
2022-11-25 15:32:14 us=721430   tls_cert_profile = '[UNDEF]'
2022-11-25 15:32:14 us=721514   tls_verify = '[UNDEF]'
2022-11-25 15:32:14 us=721547   tls_export_cert = '[UNDEF]'
2022-11-25 15:32:14 us=721568   verify_x509_type = 0
2022-11-25 15:32:14 us=721666   verify_x509_name = '[UNDEF]'
2022-11-25 15:32:14 us=721721   crl_file = '[UNDEF]'
2022-11-25 15:32:14 us=721800   ns_cert_type = 0
2022-11-25 15:32:14 us=721867   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=721919   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=721973   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722052   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722130   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722207   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722285   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722364   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722441   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722518   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722598   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722676   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722753   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722829   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722905   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=722980   remote_cert_ku[i] = 0
2022-11-25 15:32:14 us=723055   remote_cert_eku = '[UNDEF]'
2022-11-25 15:32:14 us=723219   ssl_flags = 0
2022-11-25 15:32:14 us=723239   tls_timeout = 2
2022-11-25 15:32:14 us=723262   renegotiate_bytes = -1
2022-11-25 15:32:14 us=723281   renegotiate_packets = 0
2022-11-25 15:32:14 us=723301   renegotiate_seconds = 3600
2022-11-25 15:32:14 us=723320   handshake_window = 60
2022-11-25 15:32:14 us=723339   transition_window = 3600
2022-11-25 15:32:14 us=723359   single_session = DISABLED
2022-11-25 15:32:14 us=723379   push_peer_info = DISABLED
2022-11-25 15:32:14 us=723497   tls_exit = DISABLED
2022-11-25 15:32:14 us=723520   tls_crypt_v2_metadata = '[UNDEF]'
2022-11-25 15:32:14 us=723556   server_network = 0.0.0.0
2022-11-25 15:32:14 us=723580   server_netmask = 0.0.0.0
2022-11-25 15:32:14 us=723606   server_network_ipv6 = ::
2022-11-25 15:32:14 us=723627   server_netbits_ipv6 = 0
2022-11-25 15:32:14 us=723648   server_bridge_ip = 0.0.0.0
2022-11-25 15:32:14 us=723724   server_bridge_netmask = 0.0.0.0
2022-11-25 15:32:14 us=724016   server_bridge_pool_start = 0.0.0.0
2022-11-25 15:32:14 us=724040   server_bridge_pool_end = 0.0.0.0
2022-11-25 15:32:14 us=724061   ifconfig_pool_defined = DISABLED
2022-11-25 15:32:14 us=724084   ifconfig_pool_start = 0.0.0.0
2022-11-25 15:32:14 us=724107   ifconfig_pool_end = 0.0.0.0
2022-11-25 15:32:14 us=724130   ifconfig_pool_netmask = 0.0.0.0
2022-11-25 15:32:14 us=724150   ifconfig_pool_persist_filename = '[UNDEF]'
2022-11-25 15:32:14 us=724169   ifconfig_pool_persist_refresh_freq = 600
2022-11-25 15:32:14 us=724305   ifconfig_ipv6_pool_defined = DISABLED
2022-11-25 15:32:14 us=724337   ifconfig_ipv6_pool_base = ::
2022-11-25 15:32:14 us=724418   ifconfig_ipv6_pool_netbits = 0
2022-11-25 15:32:14 us=724475   n_bcast_buf = 256
2022-11-25 15:32:14 us=724495   tcp_queue_limit = 64
2022-11-25 15:32:14 us=724515   real_hash_size = 256
2022-11-25 15:32:14 us=724536   virtual_hash_size = 256
2022-11-25 15:32:14 us=724556   client_connect_script = '[UNDEF]'
2022-11-25 15:32:14 us=724576   learn_address_script = '[UNDEF]'
2022-11-25 15:32:14 us=724596   client_disconnect_script = '[UNDEF]'
2022-11-25 15:32:14 us=724617   client_config_dir = '[UNDEF]'
2022-11-25 15:32:14 us=724638   ccd_exclusive = DISABLED
2022-11-25 15:32:14 us=724658   tmp_dir = '/data/local/tmp'
2022-11-25 15:32:14 us=724679   push_ifconfig_defined = DISABLED
2022-11-25 15:32:14 us=724701   push_ifconfig_local = 0.0.0.0
2022-11-25 15:32:14 us=724724   push_ifconfig_remote_netmask = 0.0.0.0
2022-11-25 15:32:14 us=724744   push_ifconfig_ipv6_defined = DISABLED
2022-11-25 15:32:14 us=724767   push_ifconfig_ipv6_local = ::/0
2022-11-25 15:32:14 us=724789   push_ifconfig_ipv6_remote = ::
2022-11-25 15:32:14 us=724808   enable_c2c = DISABLED
2022-11-25 15:32:14 us=724828   duplicate_cn = DISABLED
2022-11-25 15:32:14 us=724847   cf_max = 0
2022-11-25 15:32:14 us=724867   cf_per = 0
2022-11-25 15:32:14 us=724887   max_clients = 1024
2022-11-25 15:32:14 us=724907   max_routes_per_client = 256
2022-11-25 15:32:14 us=724927   auth_user_pass_verify_script = '[UNDEF]'
2022-11-25 15:32:14 us=724946   auth_user_pass_verify_script_via_file = DISABLED
2022-11-25 15:32:14 us=724966   auth_token_generate = DISABLED
2022-11-25 15:32:14 us=724985   auth_token_lifetime = 0
2022-11-25 15:32:14 us=725005   auth_token_secret_file = '[UNDEF]'
2022-11-25 15:32:14 us=725025   port_share_host = '[UNDEF]'
2022-11-25 15:32:14 us=725045   port_share_port = '[UNDEF]'
2022-11-25 15:32:14 us=725065   vlan_tagging = DISABLED
2022-11-25 15:32:14 us=725084   vlan_accept = all
2022-11-25 15:32:14 us=725103   vlan_pvid = 1
2022-11-25 15:32:14 us=725211   client = ENABLED
2022-11-25 15:32:14 us=725291   pull = ENABLED
2022-11-25 15:32:14 us=725443   auth_user_pass_file = '[UNDEF]'
2022-11-25 15:32:14 us=725533 OpenVPN 2.5.8 arm-unknown-linux-gnueabi [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Nov 25 2022
2022-11-25 15:32:14 us=725572 library versions: OpenSSL 1.1.1g  21 Apr 2020, LZO 2.09
2022-11-25 15:32:14 us=726062 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
2022-11-25 15:32:14 us=729442 Control Channel MTU parms [ L:1623 D:1210 EF:40 EB:0 ET:0 EL:3 ]
2022-11-25 15:32:14 us=729665 Data Channel MTU parms [ L:1623 D:1450 EF:123 EB:406 ET:0 EL:3 ]
2022-11-25 15:32:14 us=729758 Local Options String (VER=V4): 'V4,dev-type tun,link-mtu 1559,tun-mtu 1500,proto TCPv4_CLIENT,cipher AES-128-CBC,auth SHA1,keysize 128,key-method 2,tls-client'
2022-11-25 15:32:14 us=729781 Expected Remote Options String (VER=V4): 'V4,dev-type tun,link-mtu 1559,tun-mtu 1500,proto TCPv4_SERVER,cipher AES-128-CBC,auth SHA1,keysize 128,key-method 2,tls-server'
2022-11-25 15:32:14 us=729835 TCP/UDP: Preserving recently used remote address: [AF_INET]219.100.37.17:443
2022-11-25 15:32:14 us=729984 Socket Buffers: R=[1048576->1048576] S=[524288->524288]
2022-11-25 15:32:14 us=730015 Attempting to establish TCP connection with [AF_INET]219.100.37.17:443 [nonblock]
2022-11-25 15:32:15 us=115724 TCP connection established with [AF_INET]219.100.37.17:443
2022-11-25 15:32:15 us=116130 TCP_CLIENT link local: (not bound)
2022-11-25 15:32:15 us=116199 TCP_CLIENT link remote: [AF_INET]219.100.37.17:443
2022-11-25 15:32:15 us=425239 TLS: Initial packet from [AF_INET]219.100.37.17:443, sid=3ac29b8e 899d7e8e
2022-11-25 15:32:16 us=150168 VERIFY OK: depth=2, C=US, ST=New Jersey, L=Jersey City, O=The USERTRUST Network, CN=USERTrust RSA Certification Authority
2022-11-25 15:32:16 us=157612 VERIFY OK: depth=1, C=GB, ST=Greater Manchester, L=Salford, O=Sectigo Limited, CN=Sectigo RSA Domain Validation Secure Server CA
2022-11-25 15:32:16 us=161093 VERIFY OK: depth=0, CN=*.opengw.net
2022-11-25 15:32:16 us=858742 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, peer certificate: 2048 bit RSA, signature: RSA-SHA256
2022-11-25 15:32:16 us=859122 [*.opengw.net] Peer Connection Initiated with [AF_INET]219.100.37.17:443
2022-11-25 15:32:17 us=311645 SENT CONTROL [*.opengw.net]: 'PUSH_REQUEST' (status=1)
2022-11-25 15:32:21 us=159634 PUSH: Received control message: 'PUSH_REPLY,ping 3,ping-restart 10,ifconfig 10.234.77.33 10.234.77.34,dhcp-option DNS 10.234.254.254,dhcp-option DNS 8.8.8.8,route-gateway 10.234.77.34,redirect-gateway def1'
2022-11-25 15:32:21 us=160271 WARNING: You have specified redirect-gateway and redirect-private at the same time (or the same option multiple times). This is not well supported and may lead to unexpected results
2022-11-25 15:32:21 us=160683 OPTIONS IMPORT: timers and/or timeouts modified
2022-11-25 15:32:21 us=160756 OPTIONS IMPORT: --ifconfig/up options modified
2022-11-25 15:32:21 us=160807 OPTIONS IMPORT: route options modified
2022-11-25 15:32:21 us=160854 OPTIONS IMPORT: route-related options modified
2022-11-25 15:32:21 us=160901 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
2022-11-25 15:32:21 us=160960 Using peer cipher 'AES-128-CBC'
2022-11-25 15:32:21 us=161587 Outgoing Data Channel: Cipher 'AES-128-CBC' initialized with 128 bit key
2022-11-25 15:32:21 us=161690 Outgoing Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
2022-11-25 15:32:21 us=161776 Incoming Data Channel: Cipher 'AES-128-CBC' initialized with 128 bit key
2022-11-25 15:32:21 us=161844 Incoming Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
2022-11-25 15:32:21 us=164529 TUN/TAP device tun0 opened
2022-11-25 15:32:21 us=164659 do_ifconfig, ipv4=1, ipv6=0
2022-11-25 15:32:21 us=164742 /system/bin/ip link set dev tun0 up mtu 1500
2022-11-25 15:32:21 us=201717 /system/bin/ip link set dev tun0 up
2022-11-25 15:32:21 us=219727 /system/bin/ip addr add dev tun0 local 10.234.77.33 peer 10.234.77.34
2022-11-25 15:32:21 us=233116 /system/bin/ip route add 219.100.37.17/32 via 0.0.0.0
RTNETLINK answers: No such device
2022-11-25 15:32:21 us=242999 ERROR: Linux route add command failed: external program exited with error status: 2
2022-11-25 15:32:21 us=243142 /system/bin/ip route add 0.0.0.0/1 via 10.234.77.34
2022-11-25 15:32:21 us=253319 /system/bin/ip route add 128.0.0.0/1 via 10.234.77.34
2022-11-25 15:32:21 us=263064 Initialization Sequence Completed
Device I used as host is Android 9

Code: Select all

Linux localhost 4.4.153-perf+ #1 SMP PREEMPT Wed Jul 22 17:46:56 2020 aarch64
Is there any way to run openvpn on android device like this?

User avatar
ordex
OpenVPN Inc.
Posts: 444
Joined: Wed Dec 28, 2016 2:32 am
Location: IRC #openvpn-devel @ libera.chat

Re: RTNETLINK answers: No such device

Post by ordex » Tue Nov 29, 2022 9:43 pm

It seems OpenVPN was unable to retrieve the default gateway and therefore it is trying to use 0.0.0.0 as netxhop when adding the server host route.
This can't work and so the command fails.

If you check route.c, when compiling for android, the route command should go via the management interface and not executed directly with iproute.

It doesn't seem like you are really compiling openvpn for Android (otherwise TARGET_ANDROID would be set)

Post Reply