/[gentoo]/xml/htdocs/doc/en/home-router-howto.xml
Gentoo

Diff of /xml/htdocs/doc/en/home-router-howto.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.4 Revision 1.5
1<?xml version='1.0' encoding='UTF-8'?> 1<?xml version='1.0' encoding='UTF-8'?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/home-router-howto.xml,v 1.4 2004/07/22 21:17:35 vapier Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/home-router-howto.xml,v 1.5 2004/07/27 00:58:04 vapier Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 4
5<guide link="/doc/en/home-router-howto.xml"> 5<guide link="/doc/en/home-router-howto.xml">
6 6
7<title>Home Router Guide</title> 7<title>Home Router Guide</title>
496If you have other common / cool examples, please <uri link="mailto:vapier@gentoo.org">e-mail me</uri>. 496If you have other common / cool examples, please <uri link="mailto:vapier@gentoo.org">e-mail me</uri>.
497</note> 497</note>
498</body> 498</body>
499</section> 499</section>
500 500
501<!--
502<section>
503<title>Traffic Shaping</title>
504<body>
505<p>
506TODO
507</p>
508</body>
509</section>
510-->
511
512<section> 501<section>
513<title>Identd (for IRC)</title> 502<title>Identd (for IRC)</title>
514<body> 503<body>
515<p> 504<p>
516Internet Relay Chat utilizes the ident service pretty heavily. Now that 505Internet Relay Chat utilizes the ident service pretty heavily. Now that
529There are a few other ident servers in portage. Depending on your needs, 518There are a few other ident servers in portage. Depending on your needs,
530I would recommend checking out <c>oidentd</c> and <c>fakeidentd</c>. 519I would recommend checking out <c>oidentd</c> and <c>fakeidentd</c>.
531</p> 520</p>
532</body> 521</body>
533</section> 522</section>
523
524<!--
525<section>
526<title>Traffic Shaping</title>
527<body>
528<p>
529This is an attempt to simply and Gentooify the <uri link="http://www.tldp.org/HOWTO/ADSL-Bandwidth-Management-HOWTO/">ADSL Bandwidth Management HOWTO</uri>
530found over at the TLDP. Feel free to refer to the original document
531for more details.
532</p>
533
534<p>
535Here we will be setting up what some people refer to as a "Packet Shaper",
536<uri link="http://en.wikipedia.org/wiki/Traffic_shaping">"Traffic Shaping"</uri>,
537or <uri link="http://en.wikipedia.org/wiki/QoS">"Quality of Service"</uri>.
538Simply put, we want to setup rules on our router that will slow down
539certain activities (like sending large e-mails or downloading from P2P
540networks) while keeping other activities (like browsing the web or playing
541online video games) reasonably fast. A 30 second difference in a video
542game is a lot worse than a 30 second difference in downloading large
543files :).
544</p>
545
546<p>
547The first thing is to make sure your kernel has all the features added to
548it. See the chapter on <uri link="#doc_chap2">Kernel setup</uri> for more
549information. Next, you will need to <c>emerge iptables iputils</c> so that
550you will have access to the <c>iptables</c>, <c>ip</c>, and <c>tc</c>
551commands.
552</p>
553
554<p>
555Before we jump into the commands, let's cover a little of the theory. The
556way this whole system works is to classify common network streams and then
557to prioritize them. You use iptables to classify network streams, iputils
558to define the different priority levels, and the kernel to adjust speeds.
559Just remember that although you can control outbound traffic pretty tightly
560(from the LAN to the WAN), your ability to control inbound traffic (from
561the WAN to the LAN) is somewhat limited. Just remember that the following
562examples are to get your feet wet; if you want more then I'd suggest
563reading up on the subject. In this example, we will be using the
564<uri link="http://luxik.cdi.cz/~devik/qos/htb/">Hierarchical Token Buckets (HTB)</uri>
565packet scheduling algorithm. Still with me? Great, let's start shaping :).
566</p>
567
568<pre caption="Setup">
569DEV=eth1 <comment>NIC connected to WAN</comment>
570RATE_OUT=100 <comment>Available outbound bandwidth (in kilobits [kb])</comment>
571RATE_IN=1400 <comment>Available inbound bandwidth (in kb)</comment>
572
573<comment>Here we initialize the priority system. The 45 is used to set the default classification level.</comment>
574ip link set dev ${DEV} qlen 30
575tc qdisc add dev ${DEV} root handle 1: htb default 45
576tc class add dev ${DEV} parent 1: classid 1:1 htb rate ${RATE_OUT}kbit
577</pre>
578
579<p>
580Here we initialized the system which will be used to prioritize all of
581our network traffic. We created our queue, told it to use the HTB
582algorithm, and set the default classification level to '45'. The
583default is completely arbitrary, as are the levels we choose from
584here on out. The only thing that matters is how the levels compare
585relatively; a level '10' packet will be given preference over a
586level '45' packet. Let's move on to declaring different levels.
587</p>
588
589<pre caption="Declaring levels">
590tc class add dev $DEV parent 1:1 classid 1:10 htb rate $rkbit ceil $tkbit prio $p
591tc qdisc add dev $DEV parent 1:10 handle 10: sfq
592</pre>
593</body>
594</section>
595-->
534 596
535<section> 597<section>
536<title>Mail Server</title> 598<title>Mail Server</title>
537<body> 599<body>
538<p> 600<p>

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20