/[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.27
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.27 2011/10/23 09:46:14 swift Exp $ -->
8 8
9<sections> 9<sections>
10 10
11<abstract>
12Gentoo provides you flexible networking - here you are told about choosing
13different DHCP clients, setting up bonding, bridging, VLANs and more.
14</abstract>
15
11<version>1.4</version> 16<version>10</version>
12<date>2005-09-07</date> 17<date>2011-10-23</date>
13 18
14<section> 19<section>
15<title>Network Modules</title> 20<title>Network Modules</title>
16<body> 21<body>
17 22
18<p> 23<p>
19We now support modular networking scripts, which means we can easily 24We now support modular networking scripts, which means we can easily add support
20add support for new interface types and configuration modules while keeping 25for new interface types and configuration modules while keeping compatibility
21compatibility with existing ones. 26with existing ones.
22</p>
23
24<p> 27</p>
28
29<p>
25Modules load by default if the package they need is installed. If 30Modules 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 31module 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. 32stating 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 33setting when you have two or more packages installed that supply the same
29packages installed that supply the same service and you need to prefer 34service and you need to prefer one over the other.
30one over the other.
31</p> 35</p>
36
37<note>
38All settings discussed here are stored in <path>/etc/conf.d/net</path> unless
39otherwise specified.
40</note>
32 41
33<pre caption="Module preference"> 42<pre caption="Module preference">
34<comment># Prefer iproute2 over ifconfig</comment> 43<comment># Prefer ifconfig over iproute2</comment>
35modules=( "iproute2" ) 44modules="ifconfig"
36 45
37<comment># You can also specify other modules for an interface 46<comment># You can also specify other modules for an interface
38# In this case we prefer udhcpc over dhcpcd</comment> 47# In this case we prefer pump over dhcpcd</comment>
39modules_eth0=( "udhcpc" ) 48modules_eth0="pump"
40 49
41<comment># You can also specify which modules not to use - for example you may be 50<comment># You can also specify which modules not to use - for example you may be
42# using a supplicant or linux-wlan-ng to control wireless configuration but 51# using a supplicant or linux-wlan-ng to control wireless configuration but
43# you still want to configure network settings per ESSID associated with.</comment> 52# you still want to configure network settings per ESSID associated with.</comment>
44modules=( "!iwconfig" ) 53modules="!iwconfig"
45</pre> 54</pre>
46 55
47</body> 56</body>
48</section> 57</section>
49<section> 58<section>
50<title>Interface Handlers</title> 59<title>Interface Handlers</title>
51<body> 60<body>
52 61
53<p> 62<p>
54We provide two interface handlers presently: ifconfig and iproute2. 63We provide two interface handlers presently: <c>ifconfig</c> and
55You need one of these to do any kind of network configuration. 64<c>iproute2</c>. You need one of these to do any kind of network configuration.
56</p>
57
58<p> 65</p>
59ifconfig is the current Gentoo default and it's included in the system profile. 66
60iproute2 is a more powerful and flexible package, but it's not included by 67<p>
61default. 68<c>ifconfig</c> is installed by default (the <c>net-tools</c> package is part of
69the system profile). <c>iproute2</c> is a more powerful and flexible package,
70but it's not included by default.
62</p> 71</p>
63 72
64<pre caption="To install iproute2"> 73<pre caption="To install iproute2">
65# <i>emerge sys-apps/iproute2</i> 74# <i>emerge sys-apps/iproute2</i>
66 75
67<comment># To prefer iproute2 over ifconfig if both are installed</comment> 76<comment># To prefer ifconfig over iproute2 if both are installed as openrc prefers
68modules=( "iproute2" ) 77# to use iproute2 then</comment>
78modules="ifconfig"
69</pre> 79</pre>
70 80
71<p> 81<p>
72As both ifconfig and iproute2 do very similar things we allow their basic 82As both <c>ifconfig</c> and <c>iproute2</c> do very similar things we allow
73configuration to work with each other. For example both the below code 83their basic configuration to work with each other. For example both the below
74snippets work regardless of which module you are using. 84code snippet work regardless of which module you are using.
75</p> 85</p>
76 86
77<pre caption="ifconfig and iproute2 examples"> 87<pre caption="ifconfig and iproute2 examples">
78config_eth0=( "192.168.0.2/24" ) 88config_eth0="192.168.0.2/24"
79config_eth0=( "192.168.0.2 netmask 255.255.255.0" ) 89config_eth0="192.168.0.2 netmask 255.255.255.0"
80 90
81<comment># We can also specify broadcast</comment> 91<comment># We can also specify broadcast</comment>
82config_eth0=( "192.168.0.2/24 brd 192.168.0.255" ) 92config_eth0="192.168.0.2/24 brd 192.168.0.255"
83config_eth0=( "192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" ) 93config_eth0="192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
84</pre> 94</pre>
85 95
86</body> 96</body>
87</section> 97</section>
88<section id="dhcp"> 98<section id="dhcp">
92<p> 102<p>
93DHCP is a means of obtaining network information (IP address, DNS servers, 103DHCP is a means of obtaining network information (IP address, DNS servers,
94Gateway, etc) from a DHCP server. This means that if there is a DHCP server 104Gateway, etc) from a DHCP server. This means that if there is a DHCP server
95running on the network, you just have to tell each client to use DHCP and it 105running on the network, you just have to tell each client to use DHCP and it
96sets up the network all by itself. Of course, you will have to configure for 106sets up the network all by itself. Of course, you will have to configure for
97other things like wireless, ppp or other things if required before you can use 107other things like wireless, PPP or other things if required before you can use
98DHCP. 108DHCP.
99</p> 109</p>
100 110
101<p> 111<p>
102DHCP can be provided by dhclient, dhcpcd, pump or udhcpc. Each DHCP module has 112DHCP can be provided by <c>dhclient</c>, <c>dhcpcd</c>, or <c>pump</c>. Each
103its pros and cons - here's a quick run down. 113DHCP module has its pros and cons - here's a quick run down.
104</p> 114</p>
105 115
106<table> 116<table>
107<tr> 117<tr>
108 <th>DHCP Module</th> 118 <th>DHCP Module</th>
109 <th>Package</th> 119 <th>Package</th>
110 <th>Pros</th> 120 <th>Pros</th>
111 <th>Cons</th> 121 <th>Cons</th>
112</tr> 122</tr>
113<tr> 123<tr>
114 <ti>dhclient</ti> 124 <ti><c>dhclient</c></ti>
115 <ti>net-misc/dhcp</ti> 125 <ti><c>net-misc/dhcp</c></ti>
116 <ti> 126 <ti>
117 Made by ISC, the same people who make the BIND DNS software. Very 127 Made by ISC, the same people who make the BIND DNS software. Very
118 configurable 128 configurable
119 </ti> 129 </ti>
120 <ti> 130 <ti>
121 Configuration is overly complex, software is quite bloated, cannot get 131 Configuration is overly complex, software is quite bloated, cannot get
122 NTP servers from DHCP, does not send hostname by default 132 NTP servers from DHCP, does not send hostname by default
123 </ti> 133 </ti>
124</tr> 134</tr>
125<tr> 135<tr>
126 <ti>dhcpcd</ti> 136 <ti><c>dhcpcd</c></ti>
127 <ti>net-misc/dhcpcd</ti> 137 <ti><c>net-misc/dhcpcd</c></ti>
128 <ti> 138 <ti>
129 Long time Gentoo default, no reliance on outside tools 139 Long time Gentoo default, no reliance on outside tools, actively developed
140 by Gentoo
130 </ti> 141 </ti>
131 <ti> 142 <ti>Can be slow at times, does not yet daemonize when lease is infinite</ti>
132 No longer maintained upstream, can be slow at times, does not daemonize
133 when lease is infinite
134 </ti>
135</tr> 143</tr>
136<tr> 144<tr>
137 <ti>pump</ti> 145 <ti><c>pump</c></ti>
138 <ti>net-misc/pump</ti> 146 <ti><c>net-misc/pump</c></ti>
139 <ti> 147 <ti>
140 Lightweight, no reliance on outside tools 148 Lightweight, no reliance on outside tools
141 </ti> 149 </ti>
142 <ti> 150 <ti>
143 No longer maintained upstream, unreliable, especially over modems, cannot 151 No longer maintained upstream, unreliable, especially over modems, cannot
144 get NIS servers from DHCP 152 get NIS servers from DHCP
145 </ti> 153 </ti>
146</tr> 154</tr>
147<tr>
148 <ti>udhcpc</ti>
149 <ti>net-misc/udhcp</ti>
150 <ti>
151 Lightweight - smallest dhcp client around, made for embedded systems
152 </ti>
153 <ti>
154 Unproven - no distro uses it by default, cannot define a timeout beyond 3
155 seconds
156 </ti>
157</tr>
158</table> 155</table>
159 156
160<p> 157<p>
161If you have more than one DHCP client installed, you need to specify which 158If you have more than one DHCP client installed, you need to specify which one
162one to use - otherwise we default to dhcpcd if available. 159to use - otherwise we default to <c>dhcpcd</c> if available.
163</p>
164
165<p> 160</p>
161
162<p>
166To send specific options to the dhcp module, use module_eth0="..." 163To send specific options to the DHCP module, use <c>module_eth0="..."</c>
167<e>(change module to the DHCP module you're using - ie dhcpcd_eth0)</e> 164<e>(change module to the DHCP module you're using - i.e. <c>dhcpcd_eth0</c>)</e>.
168</p> 165</p>
169 166
170<p> 167<p>
171We try and make DHCP relatively agnostic - as such we support the following 168We try and make DHCP relatively agnostic - as such we support the following
172commands using the dhcp_eth0 variable. The default is not to set any of them 169commands using the <c>dhcp_eth0</c> variable. The default is not to set any of
170them:
173</p> 171</p>
174 172
175<ul> 173<ul>
176 <li>release - releases the IP address for re-use</li> 174 <li><c>release</c> - releases the IP address for re-use</li>
177 <li>nodns - don't overwrite /etc/resolv.conf</li> 175 <li><c>nodns</c> - don't overwrite <path>/etc/resolv.conf</path></li>
178 <li>nontp - don't overwrite /etc/ntp.conf</li> 176 <li><c>nontp</c> - don't overwrite <path>/etc/ntp.conf</path></li>
179 <li>nonis - don't overwrite /etc/yp.conf</li> 177 <li><c>nonis</c> - don't overwrite <path>/etc/yp.conf</path></li>
180</ul> 178</ul>
181 179
182<pre caption="Sample DHCP configuration in /etc/conf.d/net"> 180<pre caption="Sample DHCP configuration in /etc/conf.d/net">
183<comment># Only needed if you have more than one DHCP module installed</comment> 181<comment># Only needed if you have more than one DHCP module installed</comment>
184modules=( "dhcpcd" ) 182modules="dhcpcd"
185 183
186config_eth0=( "dhcp" ) 184config_eth0="dhcp"
187dhcpcd_eth0="-t 10" <comment># Timeout after 10 seconds</comment> 185dhcpcd_eth0="-t 10" <comment># Timeout after 10 seconds</comment>
188dhcp_eth0="release nodns nontp nonis" <comment># Only get an address</comment> 186dhcp_eth0="release nodns nontp nonis" <comment># Only get an address</comment>
189</pre> 187</pre>
190 188
191<note> 189<note>
192dhcpcd, udhcpc and pump send the current hostname to the DHCP server by 190<c>dhcpcd</c> and <c>pump</c> send the current hostname to the
193default so you don't need to specify this anymore. 191DHCP server by default so you don't need to specify this anymore.
194</note> 192</note>
195 193
196</body> 194</body>
197</section> 195</section>
198<section> 196<section>
199<title>ADSL Modem</title> 197<title>ADSL with PPPoE/PPPoA</title>
200<body> 198<body>
201 199
202<p> 200<p>
203First we need to install the ADSL software. 201First we need to install the ADSL software.
204</p> 202</p>
205 203
206<pre caption="Install the rp-pppoe package"> 204<pre caption="Install the ppp package">
207# <i>emerge net-dialup/rp-pppoe</i> 205# <i>emerge net-dialup/ppp</i>
208</pre> 206</pre>
209 207
210<warn>
211baselayout-1.11.x supports PPPOE only. Hopefully future versions will support
212PPPOA.
213</warn>
214
215<p>
216Now we need to instruct configure eth0 to be an ADSL interface and enter our
217username.
218</p> 208<p>
219 209Second, create the PPP net script and the net script for the ethernet interface
220<pre caption="Configure eth0 for ADSL"> 210to be used by PPP:
221config_eth0=( "adsl" )
222adsl_user_eth0="username"
223</pre>
224
225<p> 211</p>
226Finally you need to define your username and password in 212
227<path>/etc/ppp/pap-secrets</path> 213<pre caption="Creating the PPP and ethernet scripts">
214# <i>ln -s /etc/init.d/net.lo /etc/init.d/net.ppp0</i>
215# <i>ln -s /etc/init.d/net.lo /etc/init.d/net.eth0</i>
216</pre>
217
228</p> 218<p>
219Be sure to set <c>rc_depend_strict</c> to "YES" in <path>/etc/rc.conf</path>.
220</p>
229 221
222<p>
223Now we need to configure <path>/etc/conf.d/net</path>.
224</p>
225
226<pre caption="A basic PPPoE setup">
227config_eth0=null <comment>(Specify your ethernet interface)</comment>
228config_ppp0="ppp"
229link_ppp0="eth0" <comment>(Specify your ethernet interface)</comment>
230plugins_ppp0="pppoe"
231username_ppp0='user'
232password_ppp0='password'
233pppd_ppp0="
234noauth
235defaultroute
236usepeerdns
237holdoff 3
238child-timeout 60
239lcp-echo-interval 15
240lcp-echo-failure 3
241noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp"
242
243rc_need_ppp0="net.eth0"
244</pre>
245
246<p>
247You can also set your password in <path>/etc/ppp/pap-secrets</path>.
248</p>
249
230<pre caption="sample /etc/ppp/pap-secrets"> 250<pre caption="Sample /etc/ppp/pap-secrets">
231<comment># The * is important</comment> 251<comment># The * is important</comment>
232"username" * "password" 252"username" * "password"
233</pre> 253</pre>
234 254
255<p>
256If you use PPPoE with a USB modem you'll need to emerge <c>br2684ctl</c>. Please
257read <path>/usr/portage/net-dialup/speedtouch-usb/files/README</path> for
258information on how to properly configure it.
259</p>
260
261<impo>
262Please carefully read the section on ADSL and PPP in
263<path>/usr/share/doc/openrc-0.8.3-r1/net.example.bz2</path>. It contains many
264more detailed explanations of all the settings your particular PPP setup will
265likely need. Of course, change <c>0.8.3-r1</c> with the version of OpenRC
266installed on your system.
267</impo>
268
235</body> 269</body>
236</section> 270</section>
237<section id="apipa"> 271<section id="apipa">
238<title>APIPA (Automatic Private IP Addressing)</title> 272<title>APIPA (Automatic Private IP Addressing)</title>
239<body> 273<body>
240 274
241<p> 275<p>
242APIPA tries to find a free address in the range 169.254.0.0-169.254.255.255 276APIPA 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 277arping a random address in that range on the interface. If no reply is found
244found then we assign that address to the interface. 278then we assign that address to the interface.
245</p>
246
247<p> 279</p>
280
281<p>
248This is only useful for LANs where there is no DHCP server and you don't 282This 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. 283directly to the internet and all other computers use APIPA.
250</p>
251
252<p> 284</p>
285
286<p>
253For APIPA support, emerge net-misc/iputils or net-analyzer/arping 287For APIPA support, emerge <c>net-misc/iputils</c> or <c>net-analyzer/arping</c>.
254</p> 288</p>
255 289
256<pre caption="APIPA configuration in /etc/conf.d/net"> 290<pre caption="APIPA configuration in /etc/conf.d/net">
257<comment># Try DHCP first - if that fails then fallback to APIPA</comment> 291<comment># Try DHCP first - if that fails then fallback to APIPA</comment>
258config_eth0=( "dhcp" ) 292config_eth0="dhcp"
259fallback_eth0=( "apipa" ) 293fallback_eth0="apipa"
260 294
261<comment># Just use APIPA</comment> 295<comment># Just use APIPA</comment>
262config_eth0=( "apipa" ) 296config_eth0="apipa"
263</pre> 297</pre>
264 298
265</body> 299</body>
266</section> 300</section>
267<section> 301<section>
268<title>Bonding</title> 302<title>Bonding</title>
269<body> 303<body>
270 304
271<p> 305<p>
272For link bonding/trunking emerge net-misc/ifenslave 306For link bonding/trunking emerge <c>net-misc/ifenslave</c>.
273</p>
274
275<p> 307</p>
308
309<p>
276Bonding is used to increase network bandwidth. If you have two network 310Bonding 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 311going 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. 312just one interface but they really use both network cards.
279</p> 313</p>
280 314
281<pre caption="bonding configuration in /etc/conf.d/net"> 315<pre caption="bonding configuration in /etc/conf.d/net">
282<comment>To bond interfaces together</comment> 316<comment># To bond interfaces together</comment>
283slaves_bond0="eth0 eth1 eth2" 317slaves_bond0="eth0 eth1 eth2"
284 318
285<comment># You may not want to assign an IP to the bonded interface</comment> 319<comment># You may not want to assign an IP to the bonded interface</comment>
286config_bond0=( "null" ) 320config_bond0="null"
287 321
288<comment># Depend on eth0, eth1 and eth2 as they may require extra configuration</comment> 322<comment># Depend on eth0, eth1 and eth2 as they may require extra configuration</comment>
289depend_bond0() {
290 need net.eth0 net.eth1 net.eth2 323rc_need_bond0="net.eth0 net.eth1 net.eth2"
291}
292</pre> 324</pre>
293 325
294</body> 326</body>
295</section> 327</section>
296<section> 328<section>
297<title>Bridging (802.1d support)</title> 329<title>Bridging (802.1d support)</title>
298<body> 330<body>
299 331
300<p> 332<p>
301For bridging support emerge net-misc/bridge-utils 333For bridging support emerge <c>net-misc/bridge-utils</c>.
302</p>
303
304<p> 334</p>
335
336<p>
305Bridging is used to join networks together. For example, you may have a 337Bridging 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 338that 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 339enable 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. 340create a bridge to join the two interfaces together.
309</p> 341</p>
310 342
311<pre caption="Bridge configuration in /etc/conf.d/net"> 343<pre caption="Bridge configuration in /etc/conf.d/net">
312<comment># Configure the bridge - "man btctl" for more details</comment> 344<comment># Configure the bridge - "man brctl" for more details</comment>
313brctl_br0=( "setfd 0" "sethello 0" "stp off" ) 345brctl_br0="setfd 0" "sethello 0" "stp off"
314 346
315<comment># To add ports to bridge br0</comment> 347<comment># To add ports to bridge br0</comment>
316bridge_br0="eth0 eth1" 348bridge_br0="eth0 eth1"
317 349
318<comment># You need to configure the ports to null values so dhcp does not get started</comment> 350<comment># You need to configure the ports to null values so dhcp does not get started</comment>
319config_eth0=( "null" ) 351config_eth0="null"
320config_eth1=( "null" ) 352config_eth1="null"
321 353
322<comment># Finally give the bridge an address - you could use DHCP as well</comment> 354<comment># Finally give the bridge an address - you could use DHCP as well</comment>
323config_br0=( "192.168.0.1/24" ) 355config_br0="192.168.0.1/24"
324 356
325<comment># Depend on eth0 and eth1 as they may require extra configuration</comment> 357<comment># Depend on eth0 and eth1 as they may require extra configuration</comment>
326depend_br0() {
327 need net.eth0 net.eth1 358rc_need_br0="net.eth0 net.eth1"
328}
329</pre> 359</pre>
330 360
331<impo> 361<impo>
332For using some bridge setups, you may need to consult the 362For using some bridge setups, you may need to consult the <uri
333<uri link="?part=4&amp;chap=2#variable_name">variable name</uri> 363link="?part=4&amp;chap=2#variable_name">variable name</uri> documentation.
334documentation.
335</impo> 364</impo>
336 365
337</body> 366</body>
338</section> 367</section>
339<section> 368<section>
340<title>MAC Address</title> 369<title>MAC Address</title>
341<body> 370<body>
342 371
343<p> 372<p>
344You don't need to emerge anything for changing the MAC address of your 373If you need to, you can change the MAC address of your interfaces through
345interface if you change to a specific address. However, if you need to 374the network configuration file too.
346change to a random address or a random address of a given type then you
347need to emerge net-analyzer/macchanger.
348</p> 375</p>
349 376
350<pre caption="MAC Address change example"> 377<pre caption="MAC Address change example">
351<comment># To set the MAC address of the interface</comment> 378<comment># To set the MAC address of the interface</comment>
352mac_eth0="00:11:22:33:44:55" 379mac_eth0="00:11:22:33:44:55"
353 380
354<comment># To randomize the last 3 bytes only</comment> 381<comment># To randomize the last 3 bytes only</comment>
355mac_eth0="random-ending" 382mac_eth0="random-ending"
356 383
357<comment># To randomize between the same physical type of connection (eg fibre, 384<comment># To randomize between the same physical type of connection (e.g. fibre,
358# copper, wireless) , all vendors</comment> 385# copper, wireless) , all vendors</comment>
359mac_eth0="random-samekind" 386mac_eth0="random-samekind"
360 387
361<comment># To randomize between any physical type of connection (eg fibre, copper, 388<comment># To randomize between any physical type of connection (e.g. fibre, copper,
362# wireless) , all vendors</comment> 389# wireless) , all vendors</comment>
363mac_eth0="random-anykind" 390mac_eth0="random-anykind"
364 391
365<comment># Full randomization - WARNING: some MAC addresses generated by this may 392<comment># Full randomization - WARNING: some MAC addresses generated by this may
366# NOT act as expected</comment> 393# NOT act as expected</comment>
372<section> 399<section>
373<title>Tunnelling</title> 400<title>Tunnelling</title>
374<body> 401<body>
375 402
376<p> 403<p>
377You don't need to emerge anything for tunnelling as the interface handler 404You don't need to emerge anything for tunnelling as the interface handler can do
378can do it for you. 405it for you.
379</p> 406</p>
380 407
381<pre caption="Tunnelling configuration in /etc/conf.d/net"> 408<pre caption="Tunnelling configuration in /etc/conf.d/net">
382<comment># For GRE tunnels</comment> 409<comment># For GRE tunnels</comment>
383iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255" 410iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255"
384 411
385<comment># For IPIP tunnels</comment> 412<comment># For IPIP tunnels</comment>
386iptunnel_vpn0="mode ipip remote 207.170.82.2 ttl 255" 413iptunnel_vpn0="mode ipip remote 207.170.82.2 ttl 255"
387 414
388<comment># To configure the interface</comment> 415<comment># To configure the interface</comment>
389config_vpn0=( "192.168.0.2 peer 192.168.1.1" ) 416config_vpn0="192.168.0.2 peer 192.168.1.1"
390</pre> 417</pre>
391 418
392</body> 419</body>
393</section> 420</section>
394<section> 421<section>
395<title>VLAN (802.1q support)</title> 422<title>VLAN (802.1q support)</title>
396<body> 423<body>
397 424
398<p> 425<p>
399For VLAN support, emerge net-misc/vconfig 426For VLAN support, emerge <c>net-misc/vconfig</c>.
400</p>
401
402<p> 427</p>
428
429<p>
403Virtual LAN is a group of network devices that behave as if they were 430Virtual 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. 431to 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 432see members of the same VLAN even though they may share the same physical
406share the same physical network. 433network.
407</p> 434</p>
408 435
409<pre caption="VLAN configuration in /etc/conf.d/net"> 436<pre caption="VLAN configuration in /etc/conf.d/net">
410<comment># Specify the VLAN numbers for the interface like so</comment> 437<comment># Specify the VLAN numbers for the interface like so</comment>
411<comment># Please ensure your VLAN IDs are NOT zero-padded</comment> 438<comment># Please ensure your VLAN IDs are NOT zero-padded</comment>
412vlans_eth0="1 2" 439vlans_eth0="1 2"
413 440
414<comment># You can also configure the VLAN</comment> 441<comment># You can also configure the VLAN</comment>
415<comment># see for vconfig man page for more details</comment> 442<comment># see for vconfig man page for more details</comment>
416vconfig_eth0=( "set_name_type VLAN_PLUS_VID_NO_PAD" ) 443vconfig_eth0="set_name_type VLAN_PLUS_VID_NO_PAD"
417vconfig_vlan1=( "set_flag 1" "set_egress_map 2 6" ) 444vconfig_vlan1="set_flag 1" "set_egress_map 2 6"
418 445
419<comment># Configure the interface as usual</comment> 446<comment># Configure the interface as usual</comment>
420config_vlan1=( "172.16.3.1 netmask 255.255.254.0" ) 447config_vlan1="172.16.3.1 netmask 255.255.254.0"
421config_vlan2=( "172.16.2.1 netmask 255.255.254.0" ) 448config_vlan2="172.16.2.1 netmask 255.255.254.0"
422</pre> 449</pre>
423 450
424<impo> 451<impo>
425For using some VLAN setups, you may need to consult the 452For using some VLAN setups, you may need to consult the <uri
426<uri link="?part=4&amp;chap=2#variable_name">variable name</uri> 453link="?part=4&amp;chap=2#variable_name">variable name</uri> documentation.
427documentation.
428</impo> 454</impo>
429 455
430</body> 456</body>
431</section> 457</section>
432 458

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

  ViewVC Help
Powered by ViewVC 1.1.20