AW: AW: Read Client Hostname

Matthias Mandlmeier matthias.mandlmeier at
Fri Mar 4 08:35:57 PST 2016

If I understand it correctly there is at the moment no possibility to get the hostname value in the up or down scripts. If this is correct does ocserv has the possibitlity to forward the DHCP Request to another DHCP Server and the external DHCP Server will do the DNS Update? An other idea that I have if it is possible that the Up Script will be executed at a later time when the Hostname is known by ocserv?



-----Ursprüngliche Nachricht-----
Von: Nikos Mavrogiannopoulos [mailto:n.mavrogiannopoulos at] 
Gesendet: Freitag, 4. März 2016 17:01
An: Matthias Mandlmeier <matthias.mandlmeier at>
Cc: openconnect-devel <openconnect-devel at>
Betreff: Re: AW: Read Client Hostname

On Thu, Mar 3, 2016 at 7:00 PM, Matthias Mandlmeier <matthias.mandlmeier at> wrote:
> I tested it with the the ocserv-script and added the value $Hostname in it get the Hostname.
> The Line in the ocserv-script now looks like echo "User '$USERNAME' from '$IP_REAL' connected. Local IP is '$IP_REMOTE' Hostname is '$Hostname'" >> /etc/ocserv/test2.txt and output it to a file that I can see the variables. When a client connects I get the following Output "User 'test' from 'X.X.X.X' connected. Local IP is 'X.X.X.X' Hostname is ''" and the Value of the Hostname variable is empty all other variables in the script has the correct value in it. In the debug log I see the correct hostname in this entry HTTP: X-CSTP-Hostname.

You're right, that's indeed an issue. It seems that the hostname information is only known to ocserv after the user successfully connects so it cannot forward it to the up-down scripts. Due to a bug it wasn't even available on occtl (fixed now in master branch). Not sure what we can do there except document the fact that this variable is not provided to the up script.


More information about the openconnect-devel mailing list