/[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.11 - (show annotations) (download) (as text)
Fri Jun 29 15:32:13 2012 UTC (2 years, 7 months ago) by swift
Branch: MAIN
Changes since 1.10: +5 -3 lines
File MIME type: application/xml
Fix bug #416543 - Update starters instructions on networking to include DNS servers for static IP address configuration

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.10 2011/08/14 16:12:13 swift 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>10</version>
17 <date>2012-06-29</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 <p>
31 To get started configuring your network card, you need to tell the Gentoo RC
32 system about it. This is done by creating a symbolic link from
33 <path>net.lo</path> to <path>net.eth0</path> in <path>/etc/init.d</path>.
34 </p>
35
36 <pre caption="Symlinking net.eth0 to net.lo">
37 # <i>cd /etc/init.d</i>
38 # <i>ln -s net.lo net.eth0</i>
39 </pre>
40
41 <p>
42 Gentoo's RC system now knows about that interface. It also needs to know how
43 to configure the new interface. All the network interfaces are configured in
44 <path>/etc/conf.d/net</path>. Below is a sample configuration for DHCP and
45 static addresses.
46 </p>
47
48 <pre caption="Examples for /etc/conf.d/net">
49 <comment># For DHCP</comment>
50 config_eth0="dhcp"
51
52 <comment># For static IP using CIDR notation</comment>
53 config_eth0="192.168.0.7/24"
54 routes_eth0="default via 192.168.0.1"
55 dns_servers_eth0="192.168.0.1 8.8.8.8"
56
57 <comment># For static IP using netmask notation</comment>
58 config_eth0="192.168.0.7 netmask 255.255.255.0"
59 routes_eth0="default via 192.168.0.1"
60 dns_servers_eth0="192.168.0.1 8.8.8.8"
61 </pre>
62
63 <note>
64 If you do not specify a configuration for your interface then DHCP is assumed.
65 </note>
66
67 <note>
68 CIDR stands for Classless InterDomain Routing. Originally, IPv4 addresses were
69 classified as A, B, or C. The early classification system did not envision the
70 massive popularity of the Internet, and is in danger of running out of new
71 unique addresses. CIDR is an addressing scheme that allows one IP address to
72 designate many IP addresses. A CIDR IP address looks like a normal IP address
73 except that it ends with a slash followed by a number; for example,
74 192.168.0.0/16. CIDR is described in <uri
75 link="http://tools.ietf.org/html/rfc1519">RFC 1519</uri>.
76 </note>
77
78 <p>
79 Now that we have configured our interface, we can start and stop it using the
80 following commands:
81 </p>
82
83 <pre caption="Starting and stopping network scripts">
84 # <i>/etc/init.d/net.eth0 start</i>
85 # <i>/etc/init.d/net.eth0 stop</i>
86 </pre>
87
88 <impo>
89 When troubleshooting networking, take a look at <path>/var/log/rc.log</path>.
90 Unless you have <c>rc_logger="NO"</c> set in <path>/etc/rc.conf</path>, you
91 will find information on the boot activity stored in that log file.
92 </impo>
93
94 <p>
95 Now that you have successfully started and stopped your network interface, you
96 may wish to get it to start when Gentoo boots. Here's how to do this. The last
97 "rc" command instructs Gentoo to start any scripts in the current runlevel
98 that have not yet been started.
99 </p>
100
101 <pre caption="Configuring a network interface to load at boot time">
102 # <i>rc-update add net.eth0 default</i>
103 # <i>rc</i>
104 </pre>
105
106 </body>
107 </section>
108
109 </sections>

  ViewVC Help
Powered by ViewVC 1.1.20