I have already configured my Raspberry Pi as an access point. I, now, need to see/log the details about the devices which had connected to my Pi.
My use case is to configure a metered connection through my Pi, i.e., each device which connects to my Pi should only be allowed a fixed amount of data to use (both upload and download) per day, say 1 GB per day. After the connected device exhausts this limit, it might be given access to the Pi's network on a subscription model.
The logged details should include:
- the IP given to the connected device by the DHCP server
- the MAC address of the device (planning to use this attribute to uniquely identify the device and calculate its data usage over multiple sessions in a day)
- Amount of data uploaded/downloaded per session
- Details about each session, for each device, in a day
I want my device to automatically start logging these details without any human intervention. So, I assume that I need to do this using a script which has to be configured to run on startup. Any pointers on how to achieve this will be appreciated.
I hope I have succeeded in explaining the question clearly. Thanks!