Thanks Mike that works perfectly and is just what I needed, nice grepable single line in the log.<br><br><div class="gmail_quote">On Mon, Mar 26, 2012 at 12:54 PM, Mike Quin <span dir="ltr">&lt;<a href="mailto:mike@elite.uk.com">mike@elite.uk.com</a>&gt;</span> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div class="HOEnZb"><div class="h5">On Thu, Mar 22, 2012 at 02:01:07PM +0000, Paul Mcclung wrote:<br>

<br>
&gt; I have a small server running ubuntu 11.04 and acting as a vpn server. I<br>
&gt; would like to be able to log who is connected when and what ip they are<br>
&gt; allocated but I cannot seem to find any info on this. Any help would be<br>
&gt; much appreciated.<br>
<br>
</div></div>PPTP logging is a big ugly due to the design of the service, which<br>
means that the various bits of pertinent information are spread across<br>
various lines of the log file, some being logged by the pptp daemon<br>
managing the connection, and some by the pppd daemon which is launched<br>
to do the packet-shuffling part.<br>
<br>
What I do is use a couple of shell scripts, run when the PPP interface<br>
comes up or goes down to collate the useful parts and spit them out as<br>
a single syslog line. We comma separate these for later processing but<br>
you could easily change them for readability if you prefer.<br>
<br>
/etc/ppp/ip-up.d/vpn-ifup:<br>
<br>
#!/bin/sh<br>
# IFUP,Proccess ID,Endpoint Address,Authenticated Username,Tunnel Address,Interface Name,Pseudo Terminal<br>
logger -t VPN &quot;IFUP,$PPPD_PID,$PPP_IPPARAM,$PEERNAME,$PPP_REMOTE,$IFNAME,$PPP_TTY&quot;<br>
<br>
/etc/ppp/ip-down.d/vpn-ifdown:<br>
<br>
#!/bin/sh<br>
# IFDOWN,Process ID,Endpoint Address,Authenticated Username,Seconds Connected,Bytes Received,Bytes Sent<br>
logger -t VPN &quot;IFDOWN,$PPPD_PID,$PPP_IPPARAM,$PEERNAME,$CONNECT_TIME,$BYTES_RCVD,$BYTES_SENT&quot;<br>
<br>
Our PPTP servers run on Debian but I would not expect Ubuntu to be<br>
signifcantly different.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Mike Quin &lt;<a href="mailto:mike@elite.uk.com">mike@elite.uk.com</a>&gt;<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Falkirk mailing list<br>
<a href="mailto:Falkirk@mailman.lug.org.uk">Falkirk@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/falkirk" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/falkirk</a><br>
</div></div></blockquote></div><br>