Page MenuHomeVyOS Platform

Openvpn Server Op-cmd adds heading "OpenVPN status on vtunx" for every client connection
Closed, ResolvedPublicBUG

Description

Openvpn Server Op-cmd adds heading "OpenVPN status on vtunx" for every client connection

vyos@test1# run sh openvpn server

OpenVPN status on vtun20

Client CN    Remote Host      Tunnel IP    Local Host    TX bytes    RX bytes    Connected Since
-----------  ---------------  -----------  ------------  ----------  ----------  -------------------
ca-client    192.0.2.3:47694  10.10.2.2    N/A           3.9 KB      3.9 KB      2024-03-22 12:10:48

vyos@test1# run sh openvpn server

OpenVPN status on vtun20

OpenVPN status on vtun20

Client CN    Remote Host      Tunnel IP               Local Host    TX bytes    RX bytes    Connected Since
-----------  ---------------  ----------------------  ------------  ----------  ----------  -------------------
ca-client    192.0.2.3:36252  10.10.2.2               N/A           3.9 KB      4.0 KB      2024-03-22 16:58:41
windows      2001:db8::4      2001:db8:abcd:10::1001  N/A           4.8 KB      3.2 KB      2024-03-22 16:59:58

image.png (368×731 px, 22 KB)

Version:

vyos@test1:~$ sh ver
Version:          VyOS 1.5-rolling-202403210836
Release train:    current

Built by:         [email protected]
Built on:         Thu 21 Mar 2024 10:35 UTC
Build UUID:       22d8c22c-5479-4be6-8864-08280a5866f4
Build commit ID:  afd04be6c611c3

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (i440FX + PIIX, 1996)
Hardware S/N:
Hardware UUID:    98e92700-558d-4e21-9ace-2bebf484dc10

Copyright:        VyOS maintainers and contributors

And sometimes traceback error for the output:

vyos@test1# run sh openvpn server
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/openvpn.py", line 247, in <module>
    res = vyos.opmode.run(sys.modules[__name__])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/opmode.py", line 263, in run
    res = func(**args)
          ^^^^^^^^^^^^
  File "/usr/libexec/vyos/op_mode/openvpn.py", line 230, in show
    openvpn_data = _get_raw_data(mode)
                   ^^^^^^^^^^^^^^^^^^^
  File "/usr/libexec/vyos/op_mode/openvpn.py", line 177, in _get_raw_data
    d = _get_interface_status(mode, intf)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/libexec/vyos/op_mode/openvpn.py", line 120, in _get_interface_status
    client['tunnel'] = _get_tunnel_address(client['remote_host'],
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/libexec/vyos/op_mode/openvpn.py", line 51, in _get_tunnel_address
    tunnel_ip = lst[0].split(',')[0]
                ~~~^^^
IndexError: list index out of range

Details

Difficulty level
Unknown (require assessment)
Version
1.5-rolling-202403210836
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)