/[gentoo]/xml/htdocs/doc/en/handbook/hb-net-start.xml
Gentoo

Contents of /xml/htdocs/doc/en/handbook/hb-net-start.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download) (as text)
Mon May 7 18:11:41 2007 UTC (7 years, 7 months ago) by nightmorph
Branch: MAIN
Changes since 1.7: +14 -14 lines
File MIME type: application/xml
2007.0 release is here; final changes and new docs

1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE sections SYSTEM "/dtd/book.dtd">
3
4 <!-- The content of this document is licensed under the CC-BY-SA license -->
5 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
6
7 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-net-start.xml,v 1.7 2006/10/28 09:17:55 neysx Exp $ -->
8
9 <sections>
10
11 <abstract>
12 A guide to quickly get your network interface up and running in most common
13 environments.
14 </abstract>
15
16 <version>8.0</version>
17 <date>2007-05-07</date>
18
19 <section>
20 <title>Getting started</title>
21 <body>
22
23 <note>
24 This document assumes that you have correctly configured your kernel, its
25 modules for your hardware and you know the interface name of your hardware.
26 We also assume that you are configuring <c>eth0</c>, but it could also be
27 <c>eth1</c>, <c>wlan0</c>, etc.
28 </note>
29
30 <note>
31 This document requires you to run <c>baselayout-1.11.11</c> or better.
32 </note>
33
34 <p>
35 To get started configuring your network card, you need to tell the Gentoo RC
36 system about it. This is done by creating a symbolic link from
37 <path>net.lo</path> to <path>net.eth0</path> in <path>/etc/init.d</path>.
38 </p>
39
40 <pre caption="Symlinking net.eth0 to net.lo">
41 # <i>cd /etc/init.d</i>
42 # <i>ln -s net.lo net.eth0</i>
43 </pre>
44
45 <p>
46 Gentoo's RC system now knows about that interface. It also needs to know how
47 to configure the new interface. All the network interfaces are configured in
48 <path>/etc/conf.d/net</path>. Below is a sample configuration for DHCP and
49 static addresses.
50 </p>
51
52 <pre caption="Examples for /etc/conf.d/net">
53 <comment># For DHCP</comment>
54 config_eth0=( "dhcp" )
55
56 <comment># For static IP using CIDR notation</comment>
57 config_eth0=( "192.168.0.7/24" )
58 routes_eth0=( "default via 192.168.0.1" )
59
60 <comment># For static IP using netmask notation</comment>
61 config_eth0=( "192.168.0.7 netmask 255.255.255.0" )
62 routes_eth0=( "default via 192.168.0.1" )
63 </pre>
64
65 <note>
66 If you do not specify a configuration for your interface then DHCP is assumed.
67 </note>
68
69 <note>
70 CIDR stands for Classless InterDomain Routing. Originally, IPv4 addresses were
71 classified as A, B, or C. The early classification system did not envision the
72 massive popularity of the Internet, and is in danger of running out of new
73 unique addresses. CIDR is an addressing scheme that allows one IP address to
74 designate many IP addresses. A CIDR IP address looks like a normal IP address
75 except that it ends with a slash followed by a number; for example,
76 192.168.0.0/16. CIDR is described in <uri link="http://rfc.net/rfc1519.html">RFC
77 1519</uri>.
78 </note>
79
80 <p>
81 Now that we have configured our interface, we can start and stop it using the
82 following commands:
83 </p>
84
85 <pre caption="Starting and stopping network scripts">
86 # <i>/etc/init.d/net.eth0 start</i>
87 # <i>/etc/init.d/net.eth0 stop</i>
88 </pre>
89
90 <impo>
91 When troubleshooting networking, it is recommended to set
92 <c>RC_VERBOSE="yes"</c> in <path>/etc/conf.d/rc</path> so that you get more
93 information about what's happening.
94 </impo>
95
96 <p>
97 Now that you have successfully started and stopped your network interface, you
98 may wish to get it to start when Gentoo boots. Here's how to do this. The last
99 "rc" command instructs Gentoo to start any scripts in the current runlevel
100 that have not yet been started.
101 </p>
102
103 <pre caption="Configuring a network interface to load at boot time">
104 # <i>rc-update add net.eth0 default</i>
105 # <i>rc</i>
106 </pre>
107
108 </body>
109 </section>
110
111 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20