Find the answer to your Linux question:
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.
  1. #1
    Just Joined!
    Join Date
    Feb 2009
    Posts
    1

    tricky iptables question (running external script)


    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 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.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    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.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •