[Cialug] List users connected to a VPN
Matthew Nuzum
newz at bearfruit.org
Sat Jan 17 17:15:19 CST 2015
I’ve set up a VPN server using l2tp / IPSec. I’m using the simple version where you specify user credentials in /etc/ppp/chap-secrets. I’m not opposed to using system accounts, but was planning to keep it simple.
My hope is that I can easily see a list of connected users. I can currently see a list of network connections, including ip addresses, and when I look for these connections in my /var/log/auth or /var/log/syslog file I see the connections, but it always shows that PPP was started by me. (see below for log output)
When I run `last` I see many connections, all have my name on them. The list doesn’t seem to change when I connect or disconnect, so I’m not sure this command is helpful.
My ultimate goal is to create a little web page (probably static html auto-generated once a minute or something) that lists IP addresses and who is connected so that my son and his friends can play games together and lookup the others’ addresses easily.
Any tips appreciated. Here is the output from the log when I connect as user ‘eli’:
Jan 17 22:34:16 static xl2tpd[1630]: Connection established to 173.x.x.x, 51290. Local: 49789, Remote: 10 (ref=0/0). LNS session is 'default'
Jan 17 22:34:16 static xl2tpd[1630]: start_pppd: I'm running:
Jan 17 22:34:16 static xl2tpd[1630]: "/usr/sbin/pppd"
Jan 17 22:34:16 static xl2tpd[1630]: "passive"
Jan 17 22:34:16 static xl2tpd[1630]: "nodetach"
Jan 17 22:34:16 static xl2tpd[1630]: "172.16.1.1:172.16.1.31"
Jan 17 22:34:16 static xl2tpd[1630]: "refuse-pap"
Jan 17 22:34:16 static xl2tpd[1630]: "auth"
Jan 17 22:34:16 static xl2tpd[1630]: "file"
Jan 17 22:34:16 static xl2tpd[1630]: "/etc/ppp/options.xl2tpd"
Jan 17 22:34:16 static xl2tpd[1630]: "/dev/pts/3"
Jan 17 22:34:16 static xl2tpd[1630]: Call established with 173.x.x.x, Local: 33825, Remote: 11449, Serial: 1
Jan 17 22:34:16 static pppd[2386]: pppd 2.4.5 started by matt, uid 0
Jan 17 22:34:16 static pppd[2386]: Using interface ppp1
Jan 17 22:34:16 static pppd[2386]: Connect: ppp1 <--> /dev/pts/3
Jan 17 22:34:16 static pppd[2386]: Cannot determine ethernet address for proxy ARP
Jan 17 22:34:16 static pppd[2386]: local IP address 172.16.1.1
Jan 17 22:34:16 static pppd[2386]: remote IP address 172.16.1.31
--
Matthew Nuzum
newz2000 on freenode, skype, linkedin and twitter
♫ You're never fully dressed without a smile! ♫
More information about the Cialug
mailing list