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

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

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

Revision 1.16 Revision 1.17
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-advanced.xml,v 1.16 2011/08/14 16:12:13 swift Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-net-advanced.xml,v 1.17 2011/08/17 08:05:11 swift Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<abstract> 11<abstract>
12Here we learn about how the configuration works - you need to know this 12Here we learn about how the configuration works - you need to know this
13before we learn about modular networking. 13before we learn about modular networking.
14</abstract> 14</abstract>
15 15
16<version>9</version> 16<version>10</version>
17<date>2011-08-13</date> 17<date>2011-08-17</date>
18 18
19<section> 19<section>
20<title>Advanced Configuration</title> 20<title>Advanced Configuration</title>
21<body> 21<body>
22 22
73You can chain these commands together. Here are some real world examples. 73You can chain these commands together. Here are some real world examples.
74</p> 74</p>
75 75
76<pre caption="Configuration examples"> 76<pre caption="Configuration examples">
77<comment># Adding three IPv4 addresses</comment> 77<comment># Adding three IPv4 addresses</comment>
78config_eth0=( 78config_eth0="192.168.0.2/24
79 "192.168.0.2/24"
80 "192.168.0.3/24" 79192.168.0.3/24
81 "192.168.0.4/24" 80192.168.0.4/24"
82)
83 81
84<comment># Adding an IPv4 address and two IPv6 addresses</comment> 82<comment># Adding an IPv4 address and two IPv6 addresses</comment>
85config_eth0=( 83config_eth0="192.168.0.2/24
86 "192.168.0.2/24"
87 "4321:0:1:2:3:4:567:89ab" 844321:0:1:2:3:4:567:89ab
88 "4321:0:1:2:3:4:567:89ac" 854321:0:1:2:3:4:567:89ac"
89) 86)
90 87
91<comment># Keep our kernel assigned address, unless the interface goes 88<comment># Keep our kernel assigned address, unless the interface goes
92# down so assign another via DHCP. If DHCP fails then add a 89# down so assign another via DHCP. If DHCP fails then add a
93# static address determined by APIPA</comment> 90# static address determined by APIPA</comment>
94config_eth0=( 91config_eth0="noop
95 "noop"
96 "dhcp" 92dhcp"
97)
98fallback_eth0=( 93fallback_eth0="null
99 "null"
100 "apipa" 94apipa"
101) 95)
102</pre> 96</pre>
103 97
104<note> 98<note>
105When using the <c>ifconfig</c> module and adding more than one address, 99When using the <c>ifconfig</c> module and adding more than one address,
162<pre caption="net.br0 dependency in /etc/conf.d/net"> 156<pre caption="net.br0 dependency in /etc/conf.d/net">
163rc_need_br0="net.eth0 net.eth1" 157rc_need_br0="net.eth0 net.eth1"
164</pre> 158</pre>
165 159
166<p> 160<p>
161That alone, however, is not sufficient. Gentoo's networking init scripts use a
162virtual dependency called <e>net</e> to inform the system when networking is
163available. Clearly, in the above case, networking should only be marked as
164available when <path>net.br0</path> is up, not when the others are. So we need
165to tell that in <path>/etc/conf.d/net</path> as well:
166</p>
167
168<pre caption="Updating virtual dependencies and provisions for networking">
169rc_net_lo_provide="!net"
170rc_net_eth0_provide="!net"
171rc_net_eth1_provide="!net"
172</pre>
173
174<p>
167For a more detailed discussion about dependency, consult the section <uri 175For a more detailed discussion about dependency, consult the section <uri
168link="?part=2&amp;chap=4#doc_chap4">Writing Init Scripts</uri> in the Gentoo 176link="?part=2&amp;chap=4#doc_chap4">Writing Init Scripts</uri> in the Gentoo
169Handbook. More information about <path>/etc/rc.conf</path> is available as 177Handbook. More information about <path>/etc/rc.conf</path> is available as
170comments within that file. 178comments within that file.
171</p> 179</p>

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20