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

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

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

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

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20