File: 3.html

package info (click to toggle)
lg-issue45 3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,472 kB
  • ctags: 159
  • sloc: makefile: 34; sh: 34
file content (158 lines) | stat: -rw-r--r-- 6,191 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<META NAME="generator" CONTENT="lgazmail v1.2M.l">
<TITLE>The Answer Guy 45: Limiting Internet Access through Cable Modems</TITLE>
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
	LINK="#3366FF" VLINK="#A000A0">
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<H4>"The Linux Gazette...<I>making Linux just a little more fun!</I>"</H4>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<center>
<H1><A NAME="answer">
	<img src="../../gx/dennis/qbubble.gif" alt="(?)" 
		border="0" align="middle">
	<font color="#B03060">The Answer Guy</font>
	<img src="../../gx/dennis/bbubble.gif" alt="(!)" 
		border="0" align="middle">
</A></H1> 
<BR>
<H4>By James T. Dennis,
	<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a><BR>
	LinuxCare,
	<A HREF="http://www.linuxcare.com/">http://www.linuxcare.com/</A> 
</H4>
</center>

<p><hr><p>
<!--  endcut ======================================================= -->
<!-- begin 3 -->
<H3 align="left"><img src="../../gx/dennis/qbubble.gif" 
	height="50" width="60" alt="(?) " border="0"
	>Limiting Internet Access through Cable Modems</H3>


<p><strong>From Chris Dahl  on Fri, 20 Aug 1999  
</strong></p>
<!-- ::
Limiting Internet Access through Cable Modems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
I have a Linux box set up at home that is connected to the Internet through
a Cable Modem. Myself and my kids share this connection through
IP-Masquerading using Windows Clients. Is there a program, or option that
will run on Linux that will allow me to control when they use the Internet
and for how long?
</STRONG></P>
<P><STRONG>
Or is this better controlled through the workstation?
</STRONG></P>
<P><STRONG>
Chris
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
	HEIGHT="28" WIDTH="50" BORDER="0"
	>
There isn't an option or program that I know of.  However,
it should be possible to write some.
</BLOCKQUOTE>
<BLOCKQUOTE>
To limit them to specific times of the day I'd just
set up a set of cron jobs that periodically remove and
replace the routes and packet filters between your kids'
systems and the Internet.
</BLOCKQUOTE>
<BLOCKQUOTE>
Let's say you give the kids' systems IP addresses like
<tt>192.168.2.*</tt>, and you give your own systems <tt>192.168.1.*</tt>
addresses.  Now you can have cron jobs that add
packet filtering REJECT statements that prevent
the masquerading system from forwarding packets from
the <tt>192.168.2.0</tt> network.
</BLOCKQUOTE>
<BLOCKQUOTE>
The exact rules would depend on your needs and the
version of the Linux kernel that was running on your
router.
</BLOCKQUOTE>
<BLOCKQUOTE>
Setting up limits own now long their connections are
allowed to persist would be more challenging.  I'd
probably look at doing that using DHCP --- where you'd
assign each kid's system an IP address (via it's
ethernet MAC address)  and you configure the leases
so that they expire in a set time.  Then you hack
the DHCP daemon's code a bit so that it refuses to reissue
those specific IP addresses within some other set time
period (say, one day).
</BLOCKQUOTE>
<BLOCKQUOTE>
Another approach would be to hack up a copy of diald
to just add and remove routes/IP masquerading entries
(read through the sources, find out where it's
calling the PPP daemon and replaces those <tt>system()</tt> calls
--- or whatever they are, with your own calls to the
<tt>ipfwadm</tt> or <tt>ipchains</tt> utilities.  The same code that adds
your masquerading entries can also use an '<tt>at</tt>' command
to schedule a time to remove them).
</BLOCKQUOTE>
<BLOCKQUOTE>
These don't sound like horribly difficult programs to
write --- although it might be easier and ultimately more
effective to enforce your household rules through
old-fashioned parental supervision.
</BLOCKQUOTE>
<!-- sig -->

<!-- end 3 -->
<!--startcut ======================================================= -->
<P> <hr> <P>
<H5 align="center"><a href="http://www.linuxgazette.com/copying.html"
	>Copyright &copy;</a> 1999, James T. Dennis 
<BR>Published in <I>The Linux Gazette</I> Issue 45 September 1999</H5>
<H6 ALIGN="center">HTML transformation  by
	<A HREF="mailto:star@starshine.org">Heather Stern</a> of
	Starshine Technical Services,
	<A HREF="http://www.starshine.org/">http://www.starshine.org/</A> 
</H6>
<P> <hr> <P>
<!-- begin tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::-->
<TABLE WIDTH="98%"><TR VALIGN="center" ALIGN="center">
<TD ROWSPAN="2" COLSPAN="2" WIDTH="42%"><A 
	HREF="../lg_answer45.html"
	><IMG SRC="../../gx/dennis/answernew.gif"
              ALT="[ Answer Guy Index ]"></A></td>
  <TD WIDTH="14%"><A HREF="1.html">1</A></TD>
  <TD WIDTH="14%"><A HREF="2.html">2</A></TD>
  <TD WIDTH="14%"><A HREF="3.html">3</A></TD>
  <TD WIDTH="14%"><A HREF="4.html">4</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
  <TD WIDTH="14%"><A HREF="5.html">5</A></TD>
  <TD WIDTH="14%"><A HREF="6.html">6</A></TD>
  <TD WIDTH="14%"><A HREF="7.html">7</A></TD>
  <TD WIDTH="14%"><A HREF="8.html">8</A></TD>
</TR><TR VALIGN="center" ALIGN="center">
  <TD><A HREF="9.html" >9</A></TD>
  <TD><A HREF="10.html">10</A></TD>
  <TD><A HREF="11.html">11</A></TD>
  <TD><A HREF="12.html">12</A></TD>
  <TD><A HREF="13.html">13</A></TD>
</TR></TABLE>
<!-- end tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::::-->
<P> <hr> <P>
<!-- begin lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<A HREF="../../index.html"
	><IMG SRC="../../gx/indexnew.gif" ALT="[ Table Of Contents ]"></A>
<A HREF="/index.html"
	><IMG SRC="../../gx/homenew.gif" ALT="[ Front Page ]"></A>
<A HREF="../lg_bytes45.html"
	><IMG SRC="../../gx/back2.gif" ALT="[ Previous Section ]"></A>
<A HREF="../lg_tips45.html"
	><IMG SRC="../../gx/fwd.gif" ALT="[ Next Section ]"></A>
<!-- end lgnav ::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
</BODY></HTML>
<!--endcut ========================================================= -->