furlongm / openvpn-monitor

openvpn-monitor is a web based OpenVPN monitor, that shows current connection information, such as users, location and data transferred.
http://openvpn-monitor.openbytes.ie
GNU General Public License v3.0
950 stars 291 forks source link

VPN IP on clients list #184

Open elgui02 opened 3 years ago

elgui02 commented 3 years ago

Hi, i have a little bug show the ip on the vpn client list

image

furlongm commented 3 years ago

Can you provide the debug output as per the README?

elgui02 commented 3 years ago

The session part is DEBUG: === begin sessions {'fddd:1194:1194:1194::1000': {'bytes_recv': 44887187, 'bytes_sent': 1164759077, 'client_id': '9', 'connected_since': datetime.datetime(2020, 10, 16, 20, 6, 36), 'last_seen': datetime.datetime(2020, 10, 16, 23, 36, 59), 'local_ip': IPv6Address('fddd:1194:1194:1194::1000'), 'peer_id': '2', 'port': 17711, 'remote_ip': IPv4Address('186.151.122.246'), 'username': 'client'},

elgui02 commented 3 years ago

Ok y see all the debug output

== end raw data
DEBUG:
 === begin split line
deque(['TITLE', 'OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Sep  5 2019'])
=== end split line
DEBUG:
 === begin split line
deque(['TIME', 'Fri Oct 16 23:37:06 2020', '1602891426'])
=== end split line
DEBUG:
 === begin split line
deque(['HEADER', 'CLIENT_LIST', 'Common Name', 'Real Address', 'Virtual Address', 'Virtual IPv6 Address', 'Bytes Received', 'Bytes Sent', 'Connected Since', 'Connected Since (time_t)', 'Username', 'Client ID', 'Peer ID'])
=== end split line
DEBUG:
 === begin split line
deque(['CLIENT_LIST', 'slutz', '190.148.52.214:43542', '10.8.0.7', 'fddd:1194:1194:1194::1005', '2964569', '2600332', 'Fri Oct 16 19:46:39 2020', '1602877599', 'UNDEF', '5', '5'])
=== end split line
DEBUG:
 === begin split line
deque(['CLIENT_LIST', 'client', '186.151.122.246:17711', '10.8.0.2', 'fddd:1194:1194:1194::1000', '44887187', '1164759077', 'Fri Oct 16 20:06:36 2020', '1602878796', 'UNDEF', '9', '2'])
=== end split line
DEBUG:
 === begin split line
deque(['CLIENT_LIST', 'slcsm', '190.148.52.18:54381', '10.8.0.6', 'fddd:1194:1194:1194::1004', '27787774', '3257472', 'Fri Oct 16 19:46:39 2020', '1602877599', 'UNDEF', '4', '4'])
=== end split line
DEBUG:
 === begin split line
deque(['CLIENT_LIST', 'slmb', '190.148.52.62:17343', '10.8.0.5', 'fddd:1194:1194:1194::1003', '3266399', '10150276', 'Fri Oct 16 19:46:39 2020', '1602877599', 'UNDEF', '0', '0'])
=== end split line
DEBUG:
 === begin split line
deque(['CLIENT_LIST', 'slmz', '190.148.51.197:22128', '10.8.0.10', 'fddd:1194:1194:1194::1008', '1414361', '3905779', 'Fri Oct 16 22:12:59 2020', '1602886379', 'UNDEF', '10', '7'])
=== end split line
DEBUG:
 === begin split line
deque(['CLIENT_LIST', 'lkit', '190.104.119.57:46149', '10.8.0.8', 'fddd:1194:1194:1194::1006', '2091978', '1450219', 'Fri Oct 16 19:46:42 2020', '1602877602', 'UNDEF', '7', '3'])
=== end split line
DEBUG:
 === begin split line
deque(['CLIENT_LIST', 'lkstk', '190.104.119.185:31089', '10.8.0.9', 'fddd:1194:1194:1194::1007', '2085318', '5102226', 'Fri Oct 16 19:46:42 2020', '1602877602', 'UNDEF', '6', '6'])
=== end split line
DEBUG:
 === begin split line
deque(['HEADER', 'ROUTING_TABLE', 'Virtual Address', 'Common Name', 'Real Address', 'Last Ref', 'Last Ref (time_t)'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', 'fddd:1194:1194:1194::1006', 'lkit', '190.104.119.57:46149', 'Fri Oct 16 19:46:42 2020', '1602877602'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', 'fddd:1194:1194:1194::1008', 'slmz', '190.148.51.197:22128', 'Fri Oct 16 22:13:00 2020', '1602886380'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', 'fddd:1194:1194:1194::1007', 'lkstk', '190.104.119.185:31089', 'Fri Oct 16 19:46:42 2020', '1602877602'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', 'fddd:1194:1194:1194::1004', 'slcsm', '190.148.52.18:54381', 'Fri Oct 16 19:46:39 2020', '1602877599'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', '10.8.0.2', 'client', '186.151.122.246:17711', 'Fri Oct 16 23:37:06 2020', '1602891426'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', 'fddd:1194:1194:1194::1000', 'client', '186.151.122.246:17711', 'Fri Oct 16 23:36:59 2020', '1602891419'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', 'fddd:1194:1194:1194::1005', 'slutz', '190.148.52.214:43542', 'Fri Oct 16 19:46:39 2020', '1602877599'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', '10.8.0.6', 'slcsm', '190.148.52.18:54381', 'Fri Oct 16 23:37:06 2020', '1602891426'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', '10.8.0.5', 'slmb', '190.148.52.62:17343', 'Fri Oct 16 23:37:06 2020', '1602891426'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', '10.8.0.9', 'lkstk', '190.104.119.185:31089', 'Fri Oct 16 23:37:06 2020', '1602891426'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', 'fddd:1194:1194:1194::1003', 'slmb', '190.148.52.62:17343', 'Fri Oct 16 19:46:39 2020', '1602877599'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', '10.8.0.7', 'slutz', '190.148.52.214:43542', 'Fri Oct 16 23:37:05 2020', '1602891425'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', '10.8.0.10', 'slmz', '190.148.51.197:22128', 'Fri Oct 16 23:37:06 2020', '1602891426'])
=== end split line
DEBUG:
 === begin split line
deque(['ROUTING_TABLE', '10.8.0.8', 'lkit', '190.104.119.57:46149', 'Fri Oct 16 23:37:06 2020', '1602891426'])
=== end split line
DEBUG:
 === begin split line
deque(['GLOBAL_STATS', 'Max bcast/mcast queue length', '0'])
=== end split line
DEBUG:
 === begin split line
deque(['END'])
=== end split line
DEBUG:
 === begin sessions
{'fddd:1194:1194:1194::1000': {'bytes_recv': 44887187,
                               'bytes_sent': 1164759077,
                               'client_id': '9',
                               'connected_since': datetime.datetime(2020, 10, 16, 20, 6, 36),
                               'last_seen': datetime.datetime(2020, 10, 16, 23, 36, 59),
                               'local_ip': IPv6Address('fddd:1194:1194:1194::1000'),
                               'peer_id': '2',
                               'port': 17711,
                               'remote_ip': IPv4Address('186.151.122.246'),
                               'username': 'client'},
 'fddd:1194:1194:1194::1003': {'bytes_recv': 3266399,
                               'bytes_sent': 10150276,
                               'client_id': '0',
                               'connected_since': datetime.datetime(2020, 10, 16, 19, 46, 39),
                               'last_seen': datetime.datetime(2020, 10, 16, 19, 46, 39),
                               'local_ip': IPv6Address('fddd:1194:1194:1194::1003'),
                               'peer_id': '0',
                               'port': 17343,
                               'remote_ip': IPv4Address('190.148.52.62'),
                               'username': 'slmb'},
 'fddd:1194:1194:1194::1004': {'bytes_recv': 27787774,
                               'bytes_sent': 3257472,
                               'client_id': '4',
                               'connected_since': datetime.datetime(2020, 10, 16, 19, 46, 39),
                               'last_seen': datetime.datetime(2020, 10, 16, 19, 46, 39),
                               'local_ip': IPv6Address('fddd:1194:1194:1194::1004'),
                               'peer_id': '4',
                               'port': 54381,
                               'remote_ip': IPv4Address('190.148.52.18'),
                               'username': 'slcsm'},
 'fddd:1194:1194:1194::1005': {'bytes_recv': 2964569,
                               'bytes_sent': 2600332,
                               'client_id': '5',
                               'connected_since': datetime.datetime(2020, 10, 16, 19, 46, 39),
                               'last_seen': datetime.datetime(2020, 10, 16, 19, 46, 39),
                               'local_ip': IPv6Address('fddd:1194:1194:1194::1005'),
                               'peer_id': '5',
                               'port': 43542,
                               'remote_ip': IPv4Address('190.148.52.214'),
                               'username': 'slutz'},
 'fddd:1194:1194:1194::1006': {'bytes_recv': 2091978,
                               'bytes_sent': 1450219,
                               'client_id': '7',
                               'connected_since': datetime.datetime(2020, 10, 16, 19, 46, 42),
                               'last_seen': datetime.datetime(2020, 10, 16, 19, 46, 42),
                               'local_ip': IPv6Address('fddd:1194:1194:1194::1006'),
                               'peer_id': '3',
                               'port': 46149,
                               'remote_ip': IPv4Address('190.104.119.57'),
                               'username': 'lkit'},
 'fddd:1194:1194:1194::1007': {'bytes_recv': 2085318,
                               'bytes_sent': 5102226,
                               'client_id': '6',
                               'connected_since': datetime.datetime(2020, 10, 16, 19, 46, 42),
                               'last_seen': datetime.datetime(2020, 10, 16, 19, 46, 42),
                               'local_ip': IPv6Address('fddd:1194:1194:1194::1007'),
                               'peer_id': '6',
                               'port': 31089,
                               'remote_ip': IPv4Address('190.104.119.185'),
                               'username': 'lkstk'},
 'fddd:1194:1194:1194::1008': {'bytes_recv': 1414361,
                               'bytes_sent': 3905779,
                               'client_id': '10',
                               'connected_since': datetime.datetime(2020, 10, 16, 22, 12, 59),
                               'last_seen': datetime.datetime(2020, 10, 16, 22, 13),
                               'local_ip': IPv6Address('fddd:1194:1194:1194::1008'),
                               'peer_id': '7',
                               'port': 22128,
                               'remote_ip': IPv4Address('190.148.51.197'),
                               'username': 'slmz'}}
=== end sessions
DEBUG:
 === begin vpns
{'VPN1': {'host': 'localhost',
          'name': 'Staff VPN',
          'port': '5555',
          'release': 'OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] '
                     '[LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Sep  '
                     '5 2019',
          'sessions': {'fddd:1194:1194:1194::1000': {'bytes_recv': 44887187,
                                                     'bytes_sent': 1164759077,
                                                     'client_id': '9',
                                                     'connected_since': datetime.datetime(2020, 10, 16, 20, 6, 36),
                                                     'last_seen': datetime.datetime(2020, 10, 16, 23, 36, 59),
                                                     'local_ip': IPv6Address('fddd:1194:1194:1194::1000'),
                                                     'peer_id': '2',
                                                     'port': 17711,
                                                     'remote_ip': IPv4Address('186.151.122.246'),
                                                     'username': 'client'},
                       'fddd:1194:1194:1194::1003': {'bytes_recv': 3266399,
                                                     'bytes_sent': 10150276,
                                                     'client_id': '0',
                                                     'connected_since': datetime.datetime(2020, 10, 16, 19, 46, 39),
                                                     'last_seen': datetime.datetime(2020, 10, 16, 19, 46, 39),
                                                     'local_ip': IPv6Address('fddd:1194:1194:1194::1003'),
                                                     'peer_id': '0',
                                                     'port': 17343,
                                                     'remote_ip': IPv4Address('190.148.52.62'),
                                                     'username': 'slmb'},
                       'fddd:1194:1194:1194::1004': {'bytes_recv': 27787774,
                                                     'bytes_sent': 3257472,
                                                     'client_id': '4',
                                                     'connected_since': datetime.datetime(2020, 10, 16, 19, 46, 39),
                                                     'last_seen': datetime.datetime(2020, 10, 16, 19, 46, 39),
                                                     'local_ip': IPv6Address('fddd:1194:1194:1194::1004'),
                                                     'peer_id': '4',
                                                     'port': 54381,
                                                     'remote_ip': IPv4Address('190.148.52.18'),
                                                     'username': 'slcsm'},
                       'fddd:1194:1194:1194::1005': {'bytes_recv': 2964569,
                                                     'bytes_sent': 2600332,
                                                     'client_id': '5',
                                                     'connected_since': datetime.datetime(2020, 10, 16, 19, 46, 39),
                                                     'last_seen': datetime.datetime(2020, 10, 16, 19, 46, 39),
                                                     'local_ip': IPv6Address('fddd:1194:1194:1194::1005'),
                                                     'peer_id': '5',
                                                     'port': 43542,
                                                     'remote_ip': IPv4Address('190.148.52.214'),
                                                     'username': 'slutz'},
                       'fddd:1194:1194:1194::1006': {'bytes_recv': 2091978,
                                                     'bytes_sent': 1450219,
                                                     'client_id': '7',
                                                     'connected_since': datetime.datetime(2020, 10, 16, 19, 46, 42),
                                                     'last_seen': datetime.datetime(2020, 10, 16, 19, 46, 42),
                                                     'local_ip': IPv6Address('fddd:1194:1194:1194::1006'),
                                                     'peer_id': '3',
                                                     'port': 46149,
                                                     'remote_ip': IPv4Address('190.104.119.57'),
                                                     'username': 'lkit'},
                       'fddd:1194:1194:1194::1007': {'bytes_recv': 2085318,
                                                     'bytes_sent': 5102226,
                                                     'client_id': '6',
                                                     'connected_since': datetime.datetime(2020, 10, 16, 19, 46, 42),
                                                     'last_seen': datetime.datetime(2020, 10, 16, 19, 46, 42),
                                                     'local_ip': IPv6Address('fddd:1194:1194:1194::1007'),
                                                     'peer_id': '6',
                                                     'port': 31089,
                                                     'remote_ip': IPv4Address('190.104.119.185'),
                                                     'username': 'lkstk'},
                       'fddd:1194:1194:1194::1008': {'bytes_recv': 1414361,
                                                     'bytes_sent': 3905779,
                                                     'client_id': '10',
                                                     'connected_since': datetime.datetime(2020, 10, 16, 22, 12, 59),
                                                     'last_seen': datetime.datetime(2020, 10, 16, 22, 13),
                                                     'local_ip': IPv6Address('fddd:1194:1194:1194::1008'),
                                                     'peer_id': '7',
                                                     'port': 22128,
                                                     'remote_ip': IPv4Address('190.148.51.197'),
                                                     'username': 'slmz'}},
          'show_disconnect': False,
          'socket_connected': True,
          'state': {'connected': 'CONNECTED',
                    'local_ip': IPv4Address('10.8.0.1'),
                    'mode': 'Server',
                    'remote_ip': '',
                    'success': 'SUCCESS',
                    'up_since': datetime.datetime(2020, 10, 16, 19, 46, 36)},
          'stats': {'bytesin': 90032132, 'bytesout': 1211600095, 'nclients': 7},
          'version': Version('2.4.7')}}
=== end vpns
elgui02 commented 3 years ago

but the problem is when show on the page with ipv6

elgui02 commented 3 years ago

making test on the code found the error here image but i don't know why

furlongm commented 3 years ago

Is the problem that you don't want the ipv6 addresses showing? It seems like these are valid ip addresses?