Koozali.org formerly Contribs.org

How do I list vpn connections and disconnect specific ones

How do I list vpn connections and disconnect specific ones
« on: June 01, 2013, 01:38:05 PM »
I have sme 7.6
How can I list who is connected via VPN through our SME server and then terminate individual connections.
Im not looking at blocking them, but rather seeing who is connected then dropping them so they disconnect.

Sometimes we have vendors who connect up to get to the network and then forget to disconnect.

Thanks.

Re: How do I list vpn connections and disconnect specific ones
« Reply #1 on: June 03, 2013, 02:07:17 AM »
I think you can identify the login ids using the 'last' command. Nevertheless you can find connections by searching for pptp and ppp in the messages logfile. To disconnect, identify the process id of the pppd process which is controlling that connection, and then kill it.

Re: How do I list vpn connections and disconnect specific ones
« Reply #2 on: June 03, 2013, 09:02:22 AM »
I use radiusContext to view (accumulated) VPN Usage, but live view and drop I presume Charlie's hint is the way forward.
...

Re: How do I list vpn connections and disconnect specific ones
« Reply #3 on: June 03, 2013, 12:14:16 PM »
Thanks CB I will look at those ideas. I had forgotten about the last command.
Cant say Im familier with radiuscontext.

I have been looking at netstat and iptstat.

Regards

Offline Curly

  • ***
  • 114
Re: How do I list vpn connections and disconnect specific ones
« Reply #4 on: June 03, 2013, 09:27:09 PM »
I always look at:

The start-time of the ppp processes , it gives me the login-time of the ppp-process and an ip-address

  root      9977  9976  0 21:13 ?        00:00:00 /usr/sbin/pppd local file /etc/ppp/options.pptpd 460800 10.0.1.150:10.0.1.198

then I check

  /var/log/radius/accounting.log 

this gives me for that login-time a username

and using

  pppstats

I get a live view of the total traffic. To split the trafic for different users, you could use iptraf .
.......................................

Re: How do I list vpn connections and disconnect specific ones
« Reply #5 on: June 04, 2013, 04:54:39 AM »
Thanks Curly thanks for your tips.