Hi, my questions are about server-side logging.
1. I'm using "OpenVPN for Andriod" app (
github link) as a client. And, when I disconnect as a client - I don't see any new messages (in server's logs) at all. Maximum verb level, which I tested, is 5. Is it... intended? Anyway,
question: can I force openvpn-server to log information about client disconnection?
2. While I have active connections, I can check active connections (with some parameters, in my case the most important one is used bandwidth in both directions) in openvpn-status file.
If answer for the question #1 is positive,
question: is there any option to also log this "connection summary"?
3. Playing around with different options, I've found option "machine-readable-output".
Some kind of log example with this option enabled:
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.339524 14000003 client_ipX.X.X.X:57601 TLS: Initial packet from [AF_INET]client_ipX.X.X.X:57601, sid=b0e30214 e137a78f
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.485972 14000002 client_ipX.X.X.X:57601 VERIFY OK: depth=1, CN=common_name
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.486574 14000002 client_ipX.X.X.X:57601 VERIFY OK: depth=0, CN=common_name
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.487136 1 client_ipX.X.X.X:57601 peer info: IV_VER=2.5_master
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.487418 1 client_ipX.X.X.X:57601 peer info: IV_PLAT=android
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.487596 1 client_ipX.X.X.X:57601 peer info: IV_NCP=2
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.487742 1 client_ipX.X.X.X:57601 peer info: IV_CIPHERS=AES-256-GCM:AES-128-GCM:AES-256-GCM
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.487915 1 client_ipX.X.X.X:57601 peer info: IV_PROTO=22
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.488050 1 client_ipX.X.X.X:57601 peer info: IV_LZ4=1
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.488193 1 client_ipX.X.X.X:57601 peer info: IV_LZ4v2=1
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.488335 1 client_ipX.X.X.X:57601 peer info: IV_LZO=1
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.488463 1 client_ipX.X.X.X:57601 peer info: IV_COMP_STUB=1
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.488600 1 client_ipX.X.X.X:57601 peer info: IV_COMP_STUBv2=1
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.488771 1 client_ipX.X.X.X:57601 peer info: IV_TCPNL=1
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.488934 1 client_ipX.X.X.X:57601 peer info: IV_GUI_VER=de.blinkt.openvpn_0.7.22
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.489104 1 client_ipX.X.X.X:57601 peer info: IV_SSO=openurl,crtext
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.489277 40 client_ipX.X.X.X:57601 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1550', remote='link-mtu 1521'
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.489433 40 client_ipX.X.X.X:57601 WARNING: 'tun-mtu' is used inconsistently, local='tun-mtu 1500', remote='tun-mtu 1472'
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.489559 40 client_ipX.X.X.X:57601 WARNING: 'comp-lzo' is present in local config but missing in remote config, local='comp-lzo'
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.533924 14000002 client_ipX.X.X.X:57601 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 2048 bit RSA
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.534298 1 client_ipX.X.X.X:57601 [common_name] Peer Connection Initiated with [AF_INET]client_ipX.X.X.X:57601
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.534496 1 common_name/client_ipX.X.X.X:57601 MULTI_sva: pool returned IPv4=192.168.255.6, IPv6=(Not enabled)
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.534715 26000003 common_name/client_ipX.X.X.X:57601 MULTI: Learn: 192.168.255.6 -> common_name/client_ipX.X.X.X:57601
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.534888 26000003 common_name/client_ipX.X.X.X:57601 MULTI: primary virtual IP for common_name/client_ipX.X.X.X:57601: 192.168.255.6
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.535093 14000002 common_name/client_ipX.X.X.X:57601 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.535213 14000002 common_name/client_ipX.X.X.X:57601 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Aug 19 18:20:32 server_hostname ovpn_run[2519740]: 1629397232.535379 22000003 common_name/client_ipX.X.X.X:57601 SENT CONTROL [common_name]: 'PUSH_REPLY,block-outside-dns,dhcp-option DNS 8.8.8.8,dhcp-option DNS 1.1.1.1,comp-lzo no,route 192.168.255.1,topology net30,ping 10,ping-restart 60,ifconfig 192.168.255.6 192.168.255.5,peer-id 0,cipher AES-256-GCM' (status=1)
Values after unix timestamp, i.e. "14000003", "14000002", "1", "40", "26000003" - do they have any meaning? Can I use any of those as an unique connetion identifier, instead of just using "client_ip:client_port"? Or, maybe, any other way to print some kind of unique connection ID, so I can distinguish them?