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

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

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

Revision 1.9 Revision 1.10
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-modules.xml,v 1.9 2005/12/21 13:01:38 jkt Exp $ --> 7<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/hb-net-modules.xml,v 1.10 2005/12/22 19:55:49 jkt Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<version>1.4</version> 11<version>1.5</version>
12<date>2005-09-07</date> 12<date>2005-12-22</date>
13 13
14<section> 14<section>
15<title>Network Modules</title> 15<title>Network Modules</title>
16<body> 16<body>
17 17
48<section> 48<section>
49<title>Interface Handlers</title> 49<title>Interface Handlers</title>
50<body> 50<body>
51 51
52<p> 52<p>
53We provide two interface handlers presently: ifconfig and iproute2. You need one 53We provide two interface handlers presently: <c>ifconfig</c> and
54of these to do any kind of network configuration. 54<c>iproute2</c>. You need one of these to do any kind of network configuration.
55</p>
56
57<p> 55</p>
56
57<p>
58ifconfig is the current Gentoo default and it's included in the system profile. 58<c>ifconfig</c> is the current Gentoo default and it's included in the system
59iproute2 is a more powerful and flexible package, but it's not included by 59profile. <c>iproute2</c> is a more powerful and flexible package, but it's not
60default. 60included by default.
61</p> 61</p>
62 62
63<pre caption="To install iproute2"> 63<pre caption="To install iproute2">
64# <i>emerge sys-apps/iproute2</i> 64# <i>emerge sys-apps/iproute2</i>
65 65
66<comment># To prefer iproute2 over ifconfig if both are installed</comment> 66<comment># To prefer iproute2 over ifconfig if both are installed</comment>
67modules=( "iproute2" ) 67modules=( "iproute2" )
68</pre> 68</pre>
69 69
70<p> 70<p>
71As both ifconfig and iproute2 do very similar things we allow their basic 71As both <c>ifconfig</c> and <c>iproute2</c> do very similar things we allow
72configuration to work with each other. For example both the below code snippets 72their basic configuration to work with each other. For example both the below
73work regardless of which module you are using. 73code snippet work regardless of which module you are using.
74</p> 74</p>
75 75
76<pre caption="ifconfig and iproute2 examples"> 76<pre caption="ifconfig and iproute2 examples">
77config_eth0=( "192.168.0.2/24" ) 77config_eth0=( "192.168.0.2/24" )
78config_eth0=( "192.168.0.2 netmask 255.255.255.0" ) 78config_eth0=( "192.168.0.2 netmask 255.255.255.0" )
91<p> 91<p>
92DHCP is a means of obtaining network information (IP address, DNS servers, 92DHCP is a means of obtaining network information (IP address, DNS servers,
93Gateway, etc) from a DHCP server. This means that if there is a DHCP server 93Gateway, etc) from a DHCP server. This means that if there is a DHCP server
94running on the network, you just have to tell each client to use DHCP and it 94running on the network, you just have to tell each client to use DHCP and it
95sets up the network all by itself. Of course, you will have to configure for 95sets up the network all by itself. Of course, you will have to configure for
96other things like wireless, ppp or other things if required before you can use 96other things like wireless, PPP or other things if required before you can use
97DHCP. 97DHCP.
98</p> 98</p>
99 99
100<p> 100<p>
101DHCP can be provided by dhclient, dhcpcd, pump or udhcpc. Each DHCP module has 101DHCP can be provided by <c>dhclient</c>, <c>dhcpcd</c>, <c>pump</c> or
102its pros and cons - here's a quick run down. 102<c>udhcpc</c>. Each DHCP module has its pros and cons - here's a quick run down.
103</p> 103</p>
104 104
105<table> 105<table>
106<tr> 106<tr>
107 <th>DHCP Module</th> 107 <th>DHCP Module</th>
108 <th>Package</th> 108 <th>Package</th>
109 <th>Pros</th> 109 <th>Pros</th>
110 <th>Cons</th> 110 <th>Cons</th>
111</tr> 111</tr>
112<tr> 112<tr>
113 <ti>dhclient</ti> 113 <ti><c>dhclient</c></ti>
114 <ti>net-misc/dhcp</ti> 114 <ti><c>net-misc/dhcp</c></ti>
115 <ti> 115 <ti>
116 Made by ISC, the same people who make the BIND DNS software. Very 116 Made by ISC, the same people who make the BIND DNS software. Very
117 configurable 117 configurable
118 </ti> 118 </ti>
119 <ti> 119 <ti>
120 Configuration is overly complex, software is quite bloated, cannot get 120 Configuration is overly complex, software is quite bloated, cannot get
121 NTP servers from DHCP, does not send hostname by default 121 NTP servers from DHCP, does not send hostname by default
122 </ti> 122 </ti>
123</tr> 123</tr>
124<tr> 124<tr>
125 <ti>dhcpcd</ti> 125 <ti><c>dhcpcd</c></ti>
126 <ti>net-misc/dhcpcd</ti> 126 <ti><c>net-misc/dhcpcd</c></ti>
127 <ti> 127 <ti>
128 Long time Gentoo default, no reliance on outside tools 128 Long time Gentoo default, no reliance on outside tools
129 </ti> 129 </ti>
130 <ti> 130 <ti>
131 No longer maintained upstream, can be slow at times, does not daemonize 131 No longer maintained upstream, can be slow at times, does not daemonize
132 when lease is infinite 132 when lease is infinite
133 </ti> 133 </ti>
134</tr> 134</tr>
135<tr> 135<tr>
136 <ti>pump</ti> 136 <ti><c>pump</c></ti>
137 <ti>net-misc/pump</ti> 137 <ti><c>net-misc/pump</c></ti>
138 <ti> 138 <ti>
139 Lightweight, no reliance on outside tools 139 Lightweight, no reliance on outside tools
140 </ti> 140 </ti>
141 <ti> 141 <ti>
142 No longer maintained upstream, unreliable, especially over modems, cannot 142 No longer maintained upstream, unreliable, especially over modems, cannot
143 get NIS servers from DHCP 143 get NIS servers from DHCP
144 </ti> 144 </ti>
145</tr> 145</tr>
146<tr> 146<tr>
147 <ti>udhcpc</ti> 147 <ti><c>udhcpc</c></ti>
148 <ti>net-misc/udhcp</ti> 148 <ti><c>net-misc/udhcp</c></ti>
149 <ti> 149 <ti>
150 Lightweight - smallest dhcp client around, made for embedded systems 150 Lightweight - smallest DHCP client around, made for embedded systems
151 </ti> 151 </ti>
152 <ti> 152 <ti>
153 Unproven - no distro uses it by default, cannot define a timeout beyond 3 153 Unproven - no distro uses it by default, cannot define a timeout beyond 3
154 seconds 154 seconds
155 </ti> 155 </ti>
156</tr> 156</tr>
157</table> 157</table>
158 158
159<p> 159<p>
160If you have more than one DHCP client installed, you need to specify which one 160If you have more than one DHCP client installed, you need to specify which one
161to use - otherwise we default to dhcpcd if available. 161to use - otherwise we default to <c>dhcpcd</c> if available.
162</p>
163
164<p> 162</p>
163
164<p>
165To send specific options to the dhcp module, use module_eth0="..." 165To send specific options to the DHCP module, use <c>module_eth0="..."</c>
166<e>(change module to the DHCP module you're using - ie dhcpcd_eth0)</e> 166<e>(change module to the DHCP module you're using - ie <c>dhcpcd_eth0</c>)</e>
167</p> 167</p>
168 168
169<p> 169<p>
170We try and make DHCP relatively agnostic - as such we support the following 170We try and make DHCP relatively agnostic - as such we support the following
171commands using the dhcp_eth0 variable. The default is not to set any of them 171commands using the <c>dhcp_eth0</c> variable. The default is not to set any of
172them:
172</p> 173</p>
173 174
174<ul> 175<ul>
175 <li>release - releases the IP address for re-use</li> 176 <li><c>release</c> - releases the IP address for re-use</li>
176 <li>nodns - don't overwrite /etc/resolv.conf</li> 177 <li><c>nodns</c> - don't overwrite <path>/etc/resolv.conf</path></li>
177 <li>nontp - don't overwrite /etc/ntp.conf</li> 178 <li><c>nontp</c> - don't overwrite <path>/etc/ntp.conf</path></li>
178 <li>nonis - don't overwrite /etc/yp.conf</li> 179 <li><c>nonis</c> - don't overwrite <path>/etc/yp.conf</path></li>
179</ul> 180</ul>
180 181
181<pre caption="Sample DHCP configuration in /etc/conf.d/net"> 182<pre caption="Sample DHCP configuration in /etc/conf.d/net">
182<comment># Only needed if you have more than one DHCP module installed</comment> 183<comment># Only needed if you have more than one DHCP module installed</comment>
183modules=( "dhcpcd" ) 184modules=( "dhcpcd" )
186dhcpcd_eth0="-t 10" <comment># Timeout after 10 seconds</comment> 187dhcpcd_eth0="-t 10" <comment># Timeout after 10 seconds</comment>
187dhcp_eth0="release nodns nontp nonis" <comment># Only get an address</comment> 188dhcp_eth0="release nodns nontp nonis" <comment># Only get an address</comment>
188</pre> 189</pre>
189 190
190<note> 191<note>
191dhcpcd, udhcpc and pump send the current hostname to the DHCP server by default 192<c>dhcpcd</c>, <c>udhcpc</c> and <c>pump</c> send the current hostname to the
192so you don't need to specify this anymore. 193DHCP server by default so you don't need to specify this anymore.
193</note> 194</note>
194 195
195</body> 196</body>
196</section> 197</section>
197<section> 198<section>
205<pre caption="Install the rp-pppoe package"> 206<pre caption="Install the rp-pppoe package">
206# <i>emerge net-dialup/rp-pppoe</i> 207# <i>emerge net-dialup/rp-pppoe</i>
207</pre> 208</pre>
208 209
209<warn> 210<warn>
210baselayout-1.11.x supports PPPOE only. Hopefully future versions will support 211<c>baselayout-1.11.x</c> supports PPPoE only. Hopefully future versions will
211PPPOA. 212support PPPoA.
212</warn> 213</warn>
213 214
214<p> 215<p>
215Now we need to instruct configure eth0 to be an ADSL interface and enter our 216Now we need to instruct configure <c>eth0</c> to be an ADSL interface and enter
216username. 217our username.
217</p> 218</p>
218 219
219<pre caption="Configure eth0 for ADSL"> 220<pre caption="Configure eth0 for ADSL">
220config_eth0=( "adsl" ) 221config_eth0=( "adsl" )
221adsl_user_eth0="username" 222adsl_user_eth0="username"
222</pre> 223</pre>
223 224
224<p> 225<p>
225Finally you need to define your username and password in 226Finally you need to define your username and password in
226<path>/etc/ppp/pap-secrets</path> 227<path>/etc/ppp/pap-secrets</path>.
227</p> 228</p>
228 229
229<pre caption="sample /etc/ppp/pap-secrets"> 230<pre caption="sample /etc/ppp/pap-secrets">
230<comment># The * is important</comment> 231<comment># The * is important</comment>
231"username" * "password" 232"username" * "password"
247This is only useful for LANs where there is no DHCP server and you don't connect 248This is only useful for LANs where there is no DHCP server and you don't connect
248directly to the internet and all other computers use APIPA. 249directly to the internet and all other computers use APIPA.
249</p> 250</p>
250 251
251<p> 252<p>
252For APIPA support, emerge net-misc/iputils or net-analyzer/arping 253For APIPA support, emerge <c>net-misc/iputils</c> or <c>net-analyzer/arping</c>.
253</p> 254</p>
254 255
255<pre caption="APIPA configuration in /etc/conf.d/net"> 256<pre caption="APIPA configuration in /etc/conf.d/net">
256<comment># Try DHCP first - if that fails then fallback to APIPA</comment> 257<comment># Try DHCP first - if that fails then fallback to APIPA</comment>
257config_eth0=( "dhcp" ) 258config_eth0=( "dhcp" )
266<section> 267<section>
267<title>Bonding</title> 268<title>Bonding</title>
268<body> 269<body>
269 270
270<p> 271<p>
271For link bonding/trunking emerge net-misc/ifenslave 272For link bonding/trunking emerge <c>net-misc/ifenslave</c>.
272</p> 273</p>
273 274
274<p> 275<p>
275Bonding is used to increase network bandwidth. If you have two network cards 276Bonding is used to increase network bandwidth. If you have two network cards
276going to the same network, you can bond them together so your applications see 277going to the same network, you can bond them together so your applications see
295<section> 296<section>
296<title>Bridging (802.1d support)</title> 297<title>Bridging (802.1d support)</title>
297<body> 298<body>
298 299
299<p> 300<p>
300For bridging support emerge net-misc/bridge-utils 301For bridging support emerge <c>net-misc/bridge-utils</c>.
301</p> 302</p>
302 303
303<p> 304<p>
304Bridging is used to join networks together. For example, you may have a server 305Bridging is used to join networks together. For example, you may have a server
305that connects to the internet via an ADSL modem and a wireless access card to 306that connects to the internet via an ADSL modem and a wireless access card to
326 need net.eth0 net.eth1 327 need net.eth0 net.eth1
327} 328}
328</pre> 329</pre>
329 330
330<impo> 331<impo>
331For using some bridge setups, you may need to consult the 332For using some bridge setups, you may need to consult the <uri
332<uri link="?part=4&amp;chap=2#variable_name">variable name</uri> 333link="?part=4&amp;chap=2#variable_name">variable name</uri> documentation.
333documentation.
334</impo> 334</impo>
335 335
336</body> 336</body>
337</section> 337</section>
338<section> 338<section>
341 341
342<p> 342<p>
343You don't need to emerge anything for changing the MAC address of your interface 343You don't need to emerge anything for changing the MAC address of your interface
344if you change to a specific address. However, if you need to change to a random 344if you change to a specific address. However, if you need to change to a random
345address or a random address of a given type then you need to emerge 345address or a random address of a given type then you need to emerge
346net-analyzer/macchanger. 346<c>net-analyzer/macchanger</c>.
347</p> 347</p>
348 348
349<pre caption="MAC Address change example"> 349<pre caption="MAC Address change example">
350<comment># To set the MAC address of the interface</comment> 350<comment># To set the MAC address of the interface</comment>
351mac_eth0="00:11:22:33:44:55" 351mac_eth0="00:11:22:33:44:55"
393<section> 393<section>
394<title>VLAN (802.1q support)</title> 394<title>VLAN (802.1q support)</title>
395<body> 395<body>
396 396
397<p> 397<p>
398For VLAN support, emerge net-misc/vconfig 398For VLAN support, emerge <c>net-misc/vconfig</c>.
399</p> 399</p>
400 400
401<p> 401<p>
402Virtual LAN is a group of network devices that behave as if they were connected 402Virtual LAN is a group of network devices that behave as if they were connected
403to a single network segment - even though they may not be. VLAN members can only 403to a single network segment - even though they may not be. VLAN members can only
419config_vlan1=( "172.16.3.1 netmask 255.255.254.0" ) 419config_vlan1=( "172.16.3.1 netmask 255.255.254.0" )
420config_vlan2=( "172.16.2.1 netmask 255.255.254.0" ) 420config_vlan2=( "172.16.2.1 netmask 255.255.254.0" )
421</pre> 421</pre>
422 422
423<impo> 423<impo>
424For using some VLAN setups, you may need to consult the 424For using some VLAN setups, you may need to consult the <uri
425<uri link="?part=4&amp;chap=2#variable_name">variable name</uri> 425link="?part=4&amp;chap=2#variable_name">variable name</uri> documentation.
426documentation.
427</impo> 426</impo>
428 427
429</body> 428</body>
430</section> 429</section>
431 430

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20