/[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.1 Revision 1.2
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.1 2004/07/22 05:53:40 vapier Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/home-router-howto.xml,v 1.2 2004/07/22 14:32:26 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>
32</p> 32</p>
33 33
34<p> 34<p>
35This guide will show you how to setup Network Address Translation (NAT) 35This guide will show you how to setup Network Address Translation (NAT)
36on the router (kernel and iptables), add and configure common services 36on the router (kernel and iptables), add and configure common services
37(DNS via dnsmasq, dhcp via dhcpcd, ADSL via rp-pppoe), and conclude 37(Domain Name System (DNS) via dnsmasq, dhcp via dhcpcd, ADSL via
38with more elaborate and fun things that can be done (mail caching, port 38rp-pppoe), and conclude with more elaborate and fun things that can be
39forwarding, traffic shaping, http/ftp hosting). 39done (port forwarding, traffic shaping, http/ftp hosting, caching, etc...).
40</p> 40</p>
41 41
42<p> 42<p>
43Before getting started, there's a few basic requirements you must meet. 43Before getting started, there's a few basic requirements you must meet.
44First, you'll need a computer that has at least 2 Network Interface 44First, you'll need a computer that has at least 2 Network Interface
279I bet it'd be nice if everyone else in your house could just plug 279I bet it'd be nice if everyone else in your house could just plug
280their computers into the network and things would just work. No need to 280their computers into the network and things would just work. No need to
281remember mind-numbing details or make them stare at confusing 281remember mind-numbing details or make them stare at confusing
282configuration screens! Life would be grand eh? Introducing the Dynamic 282configuration screens! Life would be grand eh? Introducing the Dynamic
283Host Configuration Protocol (DHCP) and why you should care. 283Host Configuration Protocol (DHCP) and why you should care.
284</p>
285
286<p>
287DHCP is exactly what its name implies. It's a protocol that allows you
288to dynamically configure other hosts automatically. You run a DHCP
289server on the router (dhcpd), give it all the information about your
290network (valid IPs, DNS servers, gateways, etc...), and then when the
291other hosts start up, they run a DHCP client to automatically configure
292themselves. No fuss, no muss! For even more information, you can
293always visit <uri link="http://en.wikipedia.org/wiki/DHCP">Wikipedia</uri>.
284</p> 294</p>
285 295
286<pre caption="Setting up dhcpd"> 296<pre caption="Setting up dhcpd">
287# <i>emerge dhcp</i> 297# <i>emerge dhcp</i>
288# <i>nano /etc/dhcp/dhcpd.conf</i> 298# <i>nano /etc/dhcp/dhcpd.conf</i>
318</section> 328</section>
319 329
320<section> 330<section>
321<title>DNS Server</title> 331<title>DNS Server</title>
322<body> 332<body>
333<p>
334When people want to visit a place on the internet, they remember names,
335not a string of useless numbers. After all, what's easier to remember,
336ebay.com or 66.135.192.87? This is where the DNS steps in. DNS servers
337run all over the internet, and whenever someone wants to visit 'ebay.com',
338these servers turn 'ebay.com' (what we understand) into '66.135.192.87'
339(what our computers understand). For even more information, you can
340always visit <uri link="http://en.wikipedia.org/wiki/DNS">Wikipedia</uri>.
341</p>
323 342
324<p> 343<p>
325You may have noticed in the previous section that we told the DHCP 344You may have noticed in the previous section that we told the DHCP
326clients we have a DNS server at 192.168.0.1. You may also remember that 345clients we have a DNS server at 192.168.0.1. You may also remember that
327192.168.0.1 is our little router that we're making. I don't remember 346192.168.0.1 is our little router that we're making. I don't remember
357At this point, people on your network can talk to each other and they 376At this point, people on your network can talk to each other and they
358can look up hostnames via DNS, but they still can't actually connect to 377can look up hostnames via DNS, but they still can't actually connect to
359the internet. While you may think that's great (more bandwidth for 378the internet. While you may think that's great (more bandwidth for
360you!), I bet they're not too happy just yet. 379you!), I bet they're not too happy just yet.
361</p> 380</p>
381
382<p>
383This is where NAT steps in. NAT is a way of connecting multiple computers
384in a private LAN to the internet when you only have a smaller number of
385IP addresses availabe to you. Typically you were given 1 IP by your ISP,
386but you want to let your whole house connect to the internet. NAT is the
387magic that makes this possible. For even more information, you can
388always visit <uri link="http://en.wikipedia.org/wiki/NAT">Wikipedia</uri>.
389</p>
390
391<note>
392Before we get started, make sure you have iptables on your system. Although
393it is automatically installed on most systems, you may not have it. If you
394don't, just run <c>emerge iptables</c>.
395</note>
362 396
363<pre caption="Setting up iptables"> 397<pre caption="Setting up iptables">
364<comment>First we flush our current rules</comment> 398<comment>First we flush our current rules</comment>
365# <i>iptables -F</i> 399# <i>iptables -F</i>
366# <i>iptables -t nat -F</i> 400# <i>iptables -t nat -F</i>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20