There are two (unix) users who are allowed to connect to my Debian Wheezy server using ssh: git and peter. While git is allowed to connect from everywhere, peter (who is in the sudo group) should be only allowed to connect from my local network.
I therefore added the line
AllowUsers git email@example.com/24
to my /etc/ssh/sshd_config
And it first seemed to work, as git is allowed to connect remotely over the internet, while peter isn't.
My desktop, which has the ip address 192.168.2.24 is allowed to connect as peter, but my laptop isn't when connected using VPN (with local ip 192.168.2.201). It works when using it directly connected to my LAN.
This is what I can find in the /var/log/auth.log file. It doesn't make any sense to me, why is that IP not allowed?
Feb 2 11:44:54 srv sshd: User peter from 192.168.2.201 not allowed because not listed in AllowUsers
Feb 2 11:44:54 srv sshd: input_userauth_request: invalid user peter [preauth]