users of the OpenVPN management interface?
Hi,
I'm currently working on ironing out some wrinkles of the management interface regarding IPv6 addresses (like the "kill" command only taking IPv4 addresses, which doesn't help if a client connects over IPv6...).
Now, I'm wondering who is actually *using* the management interface on the server side (where stuff like "status 2" makes a bigger difference).
I know about the OpenVPN Access Server, but even that one is not using all the functionality (most notably, not using "kill" but "client-kill").
Which features of the management interface are the various client applications using? Heiko?
One of the results of this work is the patch appended below - the "status 2" and "status 3" commands currently do not show the IPv6 address assigned to the client. Since the table is tagged, adding an extra column will not harm a well-behaved user (like "AS"), but might confuse an application that only looks for "stuff in the 8th column"...
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...From 18d97cf42f35b2a673dd392b9fba6d2c1c141409 Mon Sep 17 00:00:00 2001
From: Gert Doering <[email protected]...>
Date: Wed, 10 Apr 2013 20:55:37 +0200
Subject: [PATCH] Print "Virtual IPv6 Address" on management interface queries
for "status 2" or "3".
Add extra column after "Virtual Address", empty if no IPv6 address assigned to this client (or IPv6 not active at all).
--- src/openvpn/multi.c | 8 +++++--- src/openvpn/multi.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-)
src/openvpn/multi.c +5 -3
@@ -807,8 +807,8 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int*/ status_printf (so,"TITLE%c%s" , sep, title_string);status_printf (so,"TIME%c%s%c%u" , sep,time_string (now,0 , false, &gc_top), sep, (unsigned int )now); -status_printf (so,"HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername" , - sep, sep, sep, sep, sep, sep, sep, sep, sep); +status_printf (so,"HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cVirtual IPv6 Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername" , + sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);hash_iterator_init (m->hash, &hi);while ((he =hash_iterator_next (&hi))) {
@@ -817,10 +817,11 @@ multi_print_status (struct multi_context *m, struct status_output *so, const intif (!mi->halt) { - status_printf (so, "CLIENT_LIST%c%s%c%s%c%s%c" counter_format "%c" counter_format "%c%s%c%u%c%s", + status_printf (so, "CLIENT_LIST%c%s%c%s%c%s%c%s%c" counter_format "%c" counter_format "%c%s%c%u%c%s", sep, tls_common_name (mi->context.c2.tls_multi, false), sep, mroute_addr_print (&mi->real, &gc), sep, print_in_addr_t (mi->reporting_addr, IA_EMPTY_IF_UNDEF, &gc), + sep, print_in6_addr (mi->reporting_addr_ipv6, IA_EMPTY_IF_UNDEF, &gc), sep, mi->context.c2.link_read_bytes, sep, mi->context.c2.link_write_bytes, sep, time_string (mi->created, 0, false, &gc),
@@ -1847,6 +1848,7 @@ multi_connection_established (struct multi_context *m, struct multi_instance *mi/* set our client's VPN endpoint for status reporting purposes */ mi->reporting_addr = mi->context.c2.push_ifconfig_local; + mi->reporting_addr_ipv6 = mi->context.c2.push_ifconfig_ipv6_local;/* set context-level authentication flag */ mi->context.c2.context_auth =CAS_SUCCEEDED ;
src/openvpn/multi.h +1 -0
@@ -88,6 +88,7 @@ struct multi_instance {bool socket_set_called;in_addr_t reporting_addr;/* IP address shown in status listing */ +struct in6_addr reporting_addr_ipv6;/* IPv6 address in status listing */ bool did_open_context;bool did_real_hash;
Signature · 1 line
1.7.8.6
Quoted 2 lines · Gert Doering, le Thu 11 Apr 2013 10:30:02 +0200, a écrit :
Now, I'm wondering who is actually *using* the management interface on the server side (where stuff like "status 2" makes a bigger difference).
We use kill to shut down the current VPN session of somebody who has stopped paying for the service.
Samuel
Hi,
Quoted 6 lines · Samuel Thibault
Quoted 2 lines · Gert Doering, le Thu 11 Apr 2013 10:30:02 +0200, a écrit :
Now, I'm wondering who is actually *using* the management interface on the server side (where stuff like "status 2" makes a bigger difference).
We use kill to shut down the current VPN session of somebody who has stopped paying for the service.
To clarify: of these variants are you using?
kill cn : Kill the client instance(s) having common name cn. kill IP:port : Kill the client instance connecting from IP:port. client-kill CID [M] : Kill client instance CID with message M (def=RESTART)
all but "kill IP:port" work fine with clients connecting over IPv6, just "IP:port" breaks.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...Quoted 11 lines · Gert Doering, le Thu 11 Apr 2013 11:36:08 +0200, a écrit :
Quoted 6 lines · Samuel Thibault
Quoted 2 lines · Gert Doering, le Thu 11 Apr 2013 10:30:02 +0200, a écrit :
Now, I'm wondering who is actually *using* the management interface on the server side (where stuff like "status 2" makes a bigger difference).
We use kill to shut down the current VPN session of somebody who has stopped paying for the service.
To clarify: of these variants are you using?
kill cn : Kill the client instance(s) having common name cn.
This one: when the user has stopped paying for the service, the radius account gets disabled, and then we kill the cn to make sure all existing sessions are shut down, and the user can't establish another one. We don't really care how he is connected.
Samuel
Hi,
Quoted 5 lines · Gert Doering
One of the results of this work is the patch appended below - the "status 2" and "status 3" commands currently do not show the IPv6 address assigned to the client. Since the table is tagged, adding an extra column will not harm a well-behaved user (like "AS"), but might confuse an application that only looks for "stuff in the 8th column"...
Arne pointed me to an older patch from him that also adds columns, and when applying that one, it (of course) caused conflicts. So here's a new version of the "virtual IPv6 address" patch rebased on current master.
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...From c1636db75cd78907dbe88141c13a16b025800919 Mon Sep 17 00:00:00 2001
From: Gert Doering <[email protected]...>
Date: Wed, 10 Apr 2013 20:55:37 +0200
Subject: [PATCH] Print "Virtual IPv6 Address" on management interface queries
[v3]
Add extra column to management queries for "status 2" or "status 3" after "Virtual Address", empty if no IPv6 address assigned to this client (or IPv6 not active at all).
Fixing %u -> %lu format warning caused by commit 662ce6acc065bddf while at it.
--- src/openvpn/multi.c | 8 +++++--- src/openvpn/multi.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-)
src/openvpn/multi.c +5 -3
@@ -807,8 +807,8 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int*/ status_printf (so,"TITLE%c%s" , sep, title_string);status_printf (so,"TIME%c%s%c%u" , sep,time_string (now,0 , false, &gc_top), sep, (unsigned int )now); -status_printf (so,"HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername%cClient ID" , - sep, sep, sep, sep, sep, sep, sep, sep, sep, sep); +status_printf (so,"HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cVirtual IPv6 Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername%cClient ID" , + sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);hash_iterator_init (m->hash, &hi);while ((he =hash_iterator_next (&hi))) {
@@ -817,10 +817,11 @@ multi_print_status (struct multi_context *m, struct status_output *so, const intif (!mi->halt) { - status_printf (so, "CLIENT_LIST%c%s%c%s%c%s%c" counter_format "%c" counter_format "%c%s%c%u%c%s%c%u", + status_printf (so, "CLIENT_LIST%c%s%c%s%c%s%c%s%c" counter_format "%c" counter_format "%c%s%c%u%c%s%c%lu", sep, tls_common_name (mi->context.c2.tls_multi, false), sep, mroute_addr_print (&mi->real, &gc), sep, print_in_addr_t (mi->reporting_addr, IA_EMPTY_IF_UNDEF, &gc), + sep, print_in6_addr (mi->reporting_addr_ipv6, IA_EMPTY_IF_UNDEF, &gc), sep, mi->context.c2.link_read_bytes, sep, mi->context.c2.link_write_bytes, sep, time_string (mi->created, 0, false, &gc),
@@ -1848,6 +1849,7 @@ multi_connection_established (struct multi_context *m, struct multi_instance *mi/* set our client's VPN endpoint for status reporting purposes */ mi->reporting_addr = mi->context.c2.push_ifconfig_local; + mi->reporting_addr_ipv6 = mi->context.c2.push_ifconfig_ipv6_local;/* set context-level authentication flag */ mi->context.c2.context_auth =CAS_SUCCEEDED ;
src/openvpn/multi.h +1 -0
@@ -88,6 +88,7 @@ struct multi_instance {bool socket_set_called;in_addr_t reporting_addr;/* IP address shown in status listing */ +struct in6_addr reporting_addr_ipv6;/* IPv6 address in status listing */ bool did_open_context;bool did_real_hash;
Signature · 1 line
1.7.8.6
Hi,
Quoted 3 lines · Gert Doering
Arne pointed me to an older patch from him that also adds columns, and when applying that one, it (of course) caused conflicts. So here's a new version of the "virtual IPv6 address" patch rebased on current master.
And after Arne's #ifdef frenzy, my patch of course doesn't apply anymore...
v4 below :-)
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...From f7002b23551b2d21e74b35388248b5a0807c0e4b Mon Sep 17 00:00:00 2001
From: Gert Doering <[email protected]...>
Date: Wed, 10 Apr 2013 20:55:37 +0200
Subject: [PATCH] Print "Virtual IPv6 Address" on management interface queries
[v4]
Add extra column to management queries for "status 2" or "status 3" after "Virtual Address", empty if no IPv6 address assigned to this client (or IPv6 not active at all).
--- src/openvpn/multi.c | 8 +++++--- src/openvpn/multi.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-)
src/openvpn/multi.c +5 -3
@@ -807,8 +807,8 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int*/ status_printf (so,"TITLE%c%s" , sep, title_string);status_printf (so,"TIME%c%s%c%u" , sep,time_string (now,0 , false, &gc_top), sep, (unsigned int )now); -status_printf (so,"HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername%cClient ID" , - sep, sep, sep, sep, sep, sep, sep, sep, sep, sep); +status_printf (so,"HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cVirtual IPv6 Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)%cUsername%cClient ID" , + sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);hash_iterator_init (m->hash, &hi);while ((he =hash_iterator_next (&hi))) {
@@ -817,7 +817,7 @@ multi_print_status (struct multi_context *m, struct status_output *so, const intif (!mi->halt) { - status_printf (so, "CLIENT_LIST%c%s%c%s%c%s%c" counter_format "%c" counter_format "%c%s%c%u%c%s%c" + status_printf (so, "CLIENT_LIST%c%s%c%s%c%s%c%s%c" counter_format "%c" counter_format "%c%s%c%u%c%s%c" #ifdef MANAGEMENT_DEF_AUTH "%lu",#else
@@ -826,6 +826,7 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int sep,tls_common_name (mi->context.c2.tls_multi, false), sep,mroute_addr_print (&mi->real, &gc), sep,print_in_addr_t (mi->reporting_addr,IA_EMPTY_IF_UNDEF , &gc), + sep,print_in6_addr (mi->reporting_addr_ipv6,IA_EMPTY_IF_UNDEF , &gc), sep, mi->context.c2.link_read_bytes, sep, mi->context.c2.link_write_bytes, sep, time_string (mi->created, 0, false, &gc),
@@ -1857,6 +1858,7 @@ multi_connection_established (struct multi_context *m, struct multi_instance *mi/* set our client's VPN endpoint for status reporting purposes */ mi->reporting_addr = mi->context.c2.push_ifconfig_local; + mi->reporting_addr_ipv6 = mi->context.c2.push_ifconfig_ipv6_local;/* set context-level authentication flag */ mi->context.c2.context_auth =CAS_SUCCEEDED ;
src/openvpn/multi.h +1 -0
@@ -88,6 +88,7 @@ struct multi_instance {bool socket_set_called;in_addr_t reporting_addr;/* IP address shown in status listing */ +struct in6_addr reporting_addr_ipv6;/* IPv6 address in status listing */ bool did_open_context;bool did_real_hash;
Signature · 1 line
1.7.8.6
Am 11.04.13 17:09, schrieb Gert Doering:
Quoted 10 lines
Hi,
Quoted 3 lines · Gert Doering
Arne pointed me to an older patch from him that also adds columns, and when applying that one, it (of course) caused conflicts. So here's a new version of the "virtual IPv6 address" patch rebased on current master.
And after Arne's #ifdef frenzy, my patch of course doesn't apply anymore...
v4 below :-)
That patch looks good.
Arne
[Openvpn-devel] [PATCH applied] Re: Print "Virtual IPv6 Address" on management interface queries [v4]
In reply to Gert DoeringPatch has been applied to the master branch.
commit b5df9faad34a18375c0f4ef88f9fd0faf54e42a1 (master)
Author: Gert Doering <[email protected]...> Date: Wed Apr 10 20:55:37 2013 +0200
Print "Virtual IPv6 Address" on management interface queries [v4]
Signed-off-by: Gert Doering <[email protected]...>
Acked-by: Arne Schwabe <[email protected]...>
Message-Id: <[email protected]...>
URL: http://article.gmane.org/gmane.network.openvpn.devel/7503--
kind regards,
Gert Doering