Article View: bit.listserv.openbsd-pf
Article #181Re: throttle traffic by amount of time or amount of used traffic in GB?
From: Sebastian Singer
Date: Sat, 13 Apr 2013 06:07
Date: Sat, 13 Apr 2013 06:07
74 lines
4167 bytes
4167 bytes
Hi Kirk, Hi Peter, Thank you both for your quick and inspiring answers. I think I will first try setting up a table and continue with scripting around pfctl -vt tablename -T show as proposed by both of you.If I run into problems I will have a go at the solution with labels. Yours, Sebastian PS: @ Peter: your book is amazing. If I hadn't purchased it already I would have asked for a signed copy :-) S. ----------------ursprüngliche Nachricht----------------- Von: "Kirk Ismay" kirk@ismay.ca An: "Sebastian Singer" sebastian.singer@kesslar.de Kopie: "pf benzedrine.cx" Datum: Fri, 12 Apr 2013 10:23:47 -0700 ------------------------------------------------- > On 2013-04-12 1:34 AM, Sebastian Singer wrote: >> >> Just one thing: Please stick to the technical focus of the question. >> Educational advice need not be given as I have received enough of it >> in the past already. And as far as I have seen and heard I am not the >> only father having to deal with these kind of problems. Thank you. > Sebastian, > > On our family Windows box, I use this to limit the time on the computer > and ensure fair use: > http://www.timesupkidz.com/ > > It can be set to allow 1/2 hour of use and force a 15 minute break, for > example. It also has time of day restrictions. You mention WoW and > Minecraft, so windows use is a fair assumption here. > > To use PF to enforce restrictions, you could have Cron update a PF table > and add or remove all the ip's (the xbox, tablet, windows box, etc) > based on the time of day. Once you've got the table in place, you can > either do blocking rules (no access to WoW server for ips in the table), > or altq rules (throttle access to a list of IPs from the table). > > A shell/perl/whatever script run from cron could also be used to parse & > tally data used by IP from PF. Assuming you have a table called > internal listing all your IPs on your lan, the following command shows > how much data has been used per ip: > > pfctl -v -t internal -Tshow > 192.168.1.12 > Cleared: Fri Apr 12 08:13:16 2013 > In/Block: [ Packets: 0 Bytes: > 0 ] > In/Pass: [ Packets: 125 Bytes: > 9395 ] > Out/Block: [ Packets: 0 Bytes: > 0 ] > Out/Pass: [ Packets: 91 Bytes: > 6460 ] > > > AuthPF can be used to further alter pf rules, requiring your son to log > in to the gateway using ssh: > http://www.openbsd.org/faq/pf/authpf.html > > PuTTy for windows has an ssh-agent, so it should be possible to quietly > log him in to the gateway from his windows account by adding it to his > startup folder. Look at plink and pagent commands > http://the.earth.li/~sgtatham/putty/ > > Hope that helps. > > ~ Kirk > --
Technical Details
Message-ID:
<b97c2f4e5987738a50a6c13b13176248@www.kesslar.de>Path:
arc1-ca.pugleaf.net!p18ni78758wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.nobody.at!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!newsgate.newsguy.com!newsp.newsguy.com!mdrnReferences:
<51684323.5090008@ismay.ca>Show Full Headers
Complete Article Headers
X-Google-Thread: bffa70e3,a3cf27524871199c
X-Google-Attributes: gidbffa70e3,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,UTF8
X-Received: by 10.180.106.232 with SMTP id gx8mr3083668wib.2.1366252810184;
Wed, 17 Apr 2013 19:40:10 -0700 (PDT)
Path: arc1-ca.pugleaf.net!p18ni78758wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.nobody.at!news.glorb.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!newsgate.newsguy.com!newsp.newsguy.com!mdrn
From: sebastian.singer@kesslar.de (Sebastian Singer)
Newsgroups: bit.listserv.openbsd-pf
Subject: Re: throttle traffic by amount of time or amount of used traffic in GB?
Date: 12 Apr 2013 23:07:53 -0700
Organization: KINO Keßlar IntraNet Online
Lines: 77
Message-ID: <b97c2f4e5987738a50a6c13b13176248@www.kesslar.de>
References: <51684323.5090008@ismay.ca>
NNTP-Posting-Host: www.kesslar.de
Mime-Version: 1.0
NNTP-Posting-Date: 13 Apr 2013 06:07:53 GMT
X-Received-Bytes: 3427
Bytes: 3605
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit