I am making an attempt to configure an OpenVPN shopper. The server will not be mine and I am unable to change its configuration. I might prefer to arrange the routes by myself (utilizing the route-up
and route-pre-down
scripts), as a result of I want to use this VPN just for some visitors.
Usually OpenVPN exposes the $ifconfig_remote
env var to the scripts, which I can use because the gateway. Nevertheless that env var will not be accessible with this server. I learn on-line that this occurs with topology subnet
, which is certainly a flag that the server pushes.
These are all of the atmosphere variables the scripts see: config
, tls_serial_hex_1
, tls_serial_hex_0
, tls_serial_hex_2
, CLIENT_CERT
, X509_0_CN
, verb
, daemon
, ifconfig_remote
, X509_1_O
, X509_1_C
, untrusted_port
, dev
, X509_2_C
, X509_2_O
, daemon_pid
, tun_mtu
, PWD
, dev_type
, untrusted_ip
, daemon_log_redirect
, remote_port_1
, remote_port_3
, remote_port_2
, remote_port_5
, remote_port_4
, X509_1_CN
, tls_serial_2
, tls_serial_1
, tls_serial_0
, redirect_gateway
, trusted_port
, link_mtu
, X509_2_OU
, script_context
, foreign_option_1
, SHLVL
, tls_digest_sha256_1
, tls_digest_sha256_0
, tls_digest_sha256_2
, proto_3
, proto_2
, proto_1
, proto_5
, proto_4
, tls_id_0
, tls_id_1
, tls_id_2
, script_type
, remote_3
, remote_2
, remote_1
, remote_5
, remote_4
, common_name
, ifconfig_local
, daemon_start_time
, trusted_ip
, tls_digest_2
, tls_digest_1
, tls_digest_0
, X509_2_CN
, _
.
None of them accommodates the gateway’s IP deal with. ifconfig_remote
, route_vpn_gateway
or different variables helpful to me do not even exist as shell/native variables.
That is all the management message pushed by the server: PUSH_REPLY,redirect-gateway def1,explicit-exit-notify,dhcp-option DNS 10.96.0.1,sndbuf 524288,rcvbuf 524288,tun-ipv6,route-gateway 10.96.0.1,topology subnet,ping 10,ping-restart 60,socket-flags TCP_NODELAY,ifconfig 10.96.0.60 255.255.0.0,peer-id 786436,cipher AES-256-GCM
.
I’ve tried to make use of pull-filter
to disregard each redirect-gateway
and topology
, however the latter does not appear to get ignored.
How can I retrieve the gateway’s IP deal with from the script referred to as by that OpenVPN shopper, in order that I can arrange my customized community routes?