/[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.8 Revision 1.9
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.8 2005/09/07 19:00:28 jkt Exp $ --> 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 $ -->
8 8
9<sections> 9<sections>
10 10
11<version>1.4</version> 11<version>1.4</version>
12<date>2005-09-07</date> 12<date>2005-09-07</date>
14<section> 14<section>
15<title>Network Modules</title> 15<title>Network Modules</title>
16<body> 16<body>
17 17
18<p> 18<p>
19We now support modular networking scripts, which means we can easily 19We now support modular networking scripts, which means we can easily add support
20add support for new interface types and configuration modules while keeping 20for new interface types and configuration modules while keeping compatibility
21compatibility with existing ones. 21with existing ones.
22</p>
23
24<p> 22</p>
23
24<p>
25Modules load by default if the package they need is installed. If 25Modules load by default if the package they need is installed. If you specify a
26you specify a module here that doesn't have its package installed 26module here that doesn't have its package installed then you get an error
27then you get an error stating which package you need to install. 27stating which package you need to install. Ideally, you only use the modules
28Ideally, you only use the modules setting when you have two or more 28setting when you have two or more packages installed that supply the same
29packages installed that supply the same service and you need to prefer 29service and you need to prefer one over the other.
30one over the other.
31</p> 30</p>
32 31
33<pre caption="Module preference"> 32<pre caption="Module preference">
34<comment># Prefer iproute2 over ifconfig</comment> 33<comment># Prefer iproute2 over ifconfig</comment>
35modules=( "iproute2" ) 34modules=( "iproute2" )
49<section> 48<section>
50<title>Interface Handlers</title> 49<title>Interface Handlers</title>
51<body> 50<body>
52 51
53<p> 52<p>
54We provide two interface handlers presently: ifconfig and iproute2. 53We provide two interface handlers presently: ifconfig and iproute2. You need one
55You need one of these to do any kind of network configuration. 54of these to do any kind of network configuration.
56</p> 55</p>
57 56
58<p> 57<p>
59ifconfig is the current Gentoo default and it's included in the system profile. 58ifconfig is the current Gentoo default and it's included in the system profile.
60iproute2 is a more powerful and flexible package, but it's not included by 59iproute2 is a more powerful and flexible package, but it's not included by
68modules=( "iproute2" ) 67modules=( "iproute2" )
69</pre> 68</pre>
70 69
71<p> 70<p>
72As both ifconfig and iproute2 do very similar things we allow their basic 71As both ifconfig and iproute2 do very similar things we allow their basic
73configuration to work with each other. For example both the below code 72configuration to work with each other. For example both the below code snippets
74snippets work regardless of which module you are using. 73work regardless of which module you are using.
75</p> 74</p>
76 75
77<pre caption="ifconfig and iproute2 examples"> 76<pre caption="ifconfig and iproute2 examples">
78config_eth0=( "192.168.0.2/24" ) 77config_eth0=( "192.168.0.2/24" )
79config_eth0=( "192.168.0.2 netmask 255.255.255.0" ) 78config_eth0=( "192.168.0.2 netmask 255.255.255.0" )
156 </ti> 155 </ti>
157</tr> 156</tr>
158</table> 157</table>
159 158
160<p> 159<p>
161If you have more than one DHCP client installed, you need to specify which 160If you have more than one DHCP client installed, you need to specify which one
162one to use - otherwise we default to dhcpcd if available. 161to use - otherwise we default to dhcpcd if available.
163</p> 162</p>
164 163
165<p> 164<p>
166To send specific options to the dhcp module, use module_eth0="..." 165To send specific options to the dhcp module, use module_eth0="..."
167<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 dhcpcd_eth0)</e>
187dhcpcd_eth0="-t 10" <comment># Timeout after 10 seconds</comment> 186dhcpcd_eth0="-t 10" <comment># Timeout after 10 seconds</comment>
188dhcp_eth0="release nodns nontp nonis" <comment># Only get an address</comment> 187dhcp_eth0="release nodns nontp nonis" <comment># Only get an address</comment>
189</pre> 188</pre>
190 189
191<note> 190<note>
192dhcpcd, udhcpc and pump send the current hostname to the DHCP server by 191dhcpcd, udhcpc and pump send the current hostname to the DHCP server by default
193default so you don't need to specify this anymore. 192so you don't need to specify this anymore.
194</note> 193</note>
195 194
196</body> 195</body>
197</section> 196</section>
198<section> 197<section>
237<section id="apipa"> 236<section id="apipa">
238<title>APIPA (Automatic Private IP Addressing)</title> 237<title>APIPA (Automatic Private IP Addressing)</title>
239<body> 238<body>
240 239
241<p> 240<p>
242APIPA tries to find a free address in the range 169.254.0.0-169.254.255.255 241APIPA tries to find a free address in the range 169.254.0.0-169.254.255.255 by
243by arping a random address in that range on the interface. If no reply is 242arping a random address in that range on the interface. If no reply is found
244found then we assign that address to the interface. 243then we assign that address to the interface.
245</p>
246
247<p> 244</p>
245
246<p>
248This is only useful for LANs where there is no DHCP server and you don't 247This is only useful for LANs where there is no DHCP server and you don't connect
249connect directly to the internet and all other computers use APIPA. 248directly to the internet and all other computers use APIPA.
250</p> 249</p>
251 250
252<p> 251<p>
253For APIPA support, emerge net-misc/iputils or net-analyzer/arping 252For APIPA support, emerge net-misc/iputils or net-analyzer/arping
254</p> 253</p>
271<p> 270<p>
272For link bonding/trunking emerge net-misc/ifenslave 271For link bonding/trunking emerge net-misc/ifenslave
273</p> 272</p>
274 273
275<p> 274<p>
276Bonding is used to increase network bandwidth. If you have two network 275Bonding is used to increase network bandwidth. If you have two network cards
277cards going to the same network, you can bond them together so your 276going to the same network, you can bond them together so your applications see
278applications see just one interface but they really use both network cards. 277just one interface but they really use both network cards.
279</p> 278</p>
280 279
281<pre caption="bonding configuration in /etc/conf.d/net"> 280<pre caption="bonding configuration in /etc/conf.d/net">
282<comment>To bond interfaces together</comment> 281<comment>To bond interfaces together</comment>
283slaves_bond0="eth0 eth1 eth2" 282slaves_bond0="eth0 eth1 eth2"
300<p> 299<p>
301For bridging support emerge net-misc/bridge-utils 300For bridging support emerge net-misc/bridge-utils
302</p> 301</p>
303 302
304<p> 303<p>
305Bridging is used to join networks together. For example, you may have a 304Bridging is used to join networks together. For example, you may have a server
306server that connects to the internet via an ADSL modem and a wireless 305that connects to the internet via an ADSL modem and a wireless access card to
307access card to enable other computers to connect to the internet via the 306enable other computers to connect to the internet via the ADSL modem. You could
308ADSL modem. You could create a bridge to join the two interfaces together. 307create a bridge to join the two interfaces together.
309</p> 308</p>
310 309
311<pre caption="Bridge configuration in /etc/conf.d/net"> 310<pre caption="Bridge configuration in /etc/conf.d/net">
312<comment># Configure the bridge - "man btctl" for more details</comment> 311<comment># Configure the bridge - "man btctl" for more details</comment>
313brctl_br0=( "setfd 0" "sethello 0" "stp off" ) 312brctl_br0=( "setfd 0" "sethello 0" "stp off" )
339<section> 338<section>
340<title>MAC Address</title> 339<title>MAC Address</title>
341<body> 340<body>
342 341
343<p> 342<p>
344You don't need to emerge anything for changing the MAC address of your 343You don't need to emerge anything for changing the MAC address of your interface
345interface if you change to a specific address. However, if you need to 344if you change to a specific address. However, if you need to change to a random
346change to a random address or a random address of a given type then you 345address or a random address of a given type then you need to emerge
347need to emerge net-analyzer/macchanger. 346net-analyzer/macchanger.
348</p> 347</p>
349 348
350<pre caption="MAC Address change example"> 349<pre caption="MAC Address change example">
351<comment># To set the MAC address of the interface</comment> 350<comment># To set the MAC address of the interface</comment>
352mac_eth0="00:11:22:33:44:55" 351mac_eth0="00:11:22:33:44:55"
372<section> 371<section>
373<title>Tunnelling</title> 372<title>Tunnelling</title>
374<body> 373<body>
375 374
376<p> 375<p>
377You don't need to emerge anything for tunnelling as the interface handler 376You don't need to emerge anything for tunnelling as the interface handler can do
378can do it for you. 377it for you.
379</p> 378</p>
380 379
381<pre caption="Tunnelling configuration in /etc/conf.d/net"> 380<pre caption="Tunnelling configuration in /etc/conf.d/net">
382<comment># For GRE tunnels</comment> 381<comment># For GRE tunnels</comment>
383iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255" 382iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255"
398<p> 397<p>
399For VLAN support, emerge net-misc/vconfig 398For VLAN support, emerge net-misc/vconfig
400</p> 399</p>
401 400
402<p> 401<p>
403Virtual LAN is a group of network devices that behave as if they were 402Virtual LAN is a group of network devices that behave as if they were connected
404connected to a single network segment - even though they may not be. 403to a single network segment - even though they may not be. VLAN members can only
405VLAN members can only see members of the same VLAN even though they may 404see members of the same VLAN even though they may share the same physical
406share the same physical network. 405network.
407</p> 406</p>
408 407
409<pre caption="VLAN configuration in /etc/conf.d/net"> 408<pre caption="VLAN configuration in /etc/conf.d/net">
410<comment># Specify the VLAN numbers for the interface like so</comment> 409<comment># Specify the VLAN numbers for the interface like so</comment>
411<comment># Please ensure your VLAN IDs are NOT zero-padded</comment> 410<comment># Please ensure your VLAN IDs are NOT zero-padded</comment>

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

  ViewVC Help
Powered by ViewVC 1.1.20