Results 1 to 2 of 2
Hi, I have an internet connection that i am sharing with my room mates for some monthly fee. I have a list of my customers "IP:Timestamp" where in timestamp is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-25-2009 #1
- Join Date
- Feb 2009
tricky iptables question (running external script)
I have an internet connection that i am sharing with my room mates for some monthly fee. I have a list of my customers "IP:Timestamp" where in timestamp is the date (%s) they paid the monthly fee. Now what I want to do is tell the iptables to read this file and compare the timestamp of each user's IP with the current timestamp and if there's already 30 days difference, it will block all that user's traffic except web, and transparently redirect him into a custom webpage saying he needs to pay again for the internet connection. once he pays again, i will just update his timestamp and he should be able to surf the internet again.
Any idea how to accomplish this? I'm thinking of writing a script which will be run by cron every, say 5 minutes and it will read the file then update the iptables rules correspondingly. You might have a better idea.
- 02-25-2009 #2
IPTABLES doesn't do this. You are going to have to write your own script to do this and then generate a rule to place into the firewall.
The adventure of a life time.
Linux User #296285