/[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.12 - (show annotations) (download) (as text)
Mon May 6 14:24:20 2013 UTC (19 months, 3 weeks ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +6 -5 lines
File MIME type: application/xml
Fix bug #466262 - Document predictable naming of interfaces

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

  ViewVC Help
Powered by ViewVC 1.1.20