Page 1 of 1

Static IP assignment with PAM authentication

Posted: Sun May 13, 2012 10:10 pm
by dayknight
Is it possible?
- I have disabled client-cert auth and only would like to use username/password. Created a ccd directory and new file "user"

in the user file i added:

Code: Select all

ifconfig-push 10.8.0.50 255.255.255.0
However, it does not work - still getting it dynamically from the pool.

My objective is to see client usage. By assigning static IP to user - then i could use ip-tables or tc to throttle once they hit certain number. Any better ideas?

Any help would be appreciated.
Thanks!

Re: Static IP assignment with PAM authentication

Posted: Mon May 14, 2012 6:51 am
by janjust
add

Code: Select all

username-as-common-name
to the server config; also, use 'verb 4' to verify that the server does pick up the CCD file.

the CCD file you list will work only for a 'topology subnet' or 'dev tap' setup.

Re: Static IP assignment with PAM authentication

Posted: Mon May 14, 2012 7:10 am
by dayknight
aha - excellent - Thank you


Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
myusername,66.11.164.122:2913,13710,4189,Mon May 14 03:04:16 2012
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
10.8.0.10,myusername,66.11.164.122:2913,Mon May 14 03:04:21 2012


i am using tun interfaces - so yes - it is not picking it up - nonetheless - having username-as-common-name can certainly help with calculating usage per client.

Re: Static IP assignment with PAM authentication

Posted: Mon May 14, 2012 12:11 pm
by janjust
add

Code: Select all

ccd-exclusive
to the server config - this should cause the server to reject the connection unless the right common name (in your case , username) is specified. That makes is way easier to figure out if the right CCD file is picked up.