swift 05/06/06 19:15:51
Modified: xml/htdocs/doc/en/handbook/draft hb-net-advanced.xml
hb-net-functions.xml hb-net-management.xml
hb-net-modules.xml hb-net-start.xml
hb-net-wireless.xml
Log:
Update on #88188: networking stuff for baselayout
Revision Changes Path
1.2 +61 -2 xml/htdocs/doc/en/handbook/draft/hb-net-advanced.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-advanced.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-advanced.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-advanced.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo
Index: hb-net-advanced.xml
===================================================================
RCS file:
/var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-net-advanced.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- hb-net-advanced.xml 8 Apr 2005 11:02:28 -0000 1.1
+++ hb-net-advanced.xml 6 Jun 2005 19:15:51 -0000 1.2
@@ -6,8 +6,8 @@
<sections>
-<version>0.2</version>
-<date>2005-04-06</date>
+<version>1.0</version>
+<date>2005-06-06</date>
<section>
<title>Advanced Configuration</title>
@@ -187,4 +187,63 @@
</body>
</section>
+<section>
+<title>Variable names and values</title>
+<body>
+
+<p>
+Variable names are dynamic. They are normally follow the structure of
+<c>variable_${interface|mac|essid|apmac}</c>. For example, the variable
+<c>dhcpcd_eth0</c> holds the value for dhcpcd options for eth0 and
+<c>dhcpcd_essid</c> holds the value for dhcpcd options when any interface
+connects to the essid "essid".
+</p>
+
+<p>
+However, there is no hard and fast rule that states interface names must be
+ethx. Infact, many wireless interfaces have names wlanx, rax as well as ethx.
+Also, some user defined interfaces such as bridges can be given any name, such
+has foo. To life more interesting, wireless Access Points can have names with
+non alpha-numeric characters in - this is important because you can configure
+networking parameters per ESSID.
+</p>
+
+<p>
+The downside of all this is that Gentoo uses bash variables for networking -
+and bash cannot use anything outside of English alpha-numerics. To get around
+this limitation we change every character that is not an English alpha-numeric
+into a _ character.
+</p>
+
+<p>
+Another downside of bash is the content of variables - some character need to
+be escaped. This can be achived by placing the \ character in front of the
+character that needs to be escaped. Below is a list of characters that need
+to be escaped in this way.
+</p>
+
+<p>
+<c>" ' \</c>
+</p>
+
+<p>
+In this example we use wireless ESSID as they can contain the widest scope
+of characters. We shall use the ESSID as it appears below.
+</p>
+
+<p>
+<c>My "\ NET</c>
+</p>
+
+<pre caption="variable name example">
+<comment># This does work, but the domain is invalid</comment>
+dns_domain_My____NET="My \"\\ NET"
+
+<comment># The above sets the dns domain to My \" NET when a wireless card
+# connects to an AP whose ESSID is My \" NET</comment>
+</pre>
+
+</body>
+</section>
+
</sections>
1.2 +3 -3 xml/htdocs/doc/en/handbook/draft/hb-net-functions.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-functions.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-functions.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-functions.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo
Index: hb-net-functions.xml
===================================================================
RCS file:
/var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-net-functions.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- hb-net-functions.xml 8 Apr 2005 11:02:28 -0000 1.1
+++ hb-net-functions.xml 6 Jun 2005 19:15:51 -0000 1.2
@@ -6,8 +6,8 @@
<sections>
-<version>0.2</version>
-<date>2005-04-6</date>
+<version>1.0</version>
+<date>2005-06-06</date>
<section>
<title>Standard function hooks</title>
@@ -97,7 +97,7 @@
<note>
This will not work with WPA Supplicant - but the <c>${ESSID}</c> and
-<c>${ESSIDVAR}</c> variables are available in preup() and postup() functions
+<c>${ESSIDVAR}</c> variables are available in the postup() function
</note>
<p>
1.2 +2 -2 xml/htdocs/doc/en/handbook/draft/hb-net-management.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-management.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-management.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-management.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo
Index: hb-net-management.xml
===================================================================
RCS file:
/var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-net-management.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- hb-net-management.xml 8 Apr 2005 11:02:28 -0000 1.1
+++ hb-net-management.xml 6 Jun 2005 19:15:51 -0000 1.2
@@ -6,8 +6,8 @@
<sections>
-<version>0.1</version>
-<date>2005-03-17</date>
+<version>1.0</version>
+<date>2005-06-06</date>
<section>
<title>Network Management</title>
1.2 +49 -3 xml/htdocs/doc/en/handbook/draft/hb-net-modules.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-modules.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-modules.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-modules.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo
Index: hb-net-modules.xml
===================================================================
RCS file:
/var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-net-modules.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- hb-net-modules.xml 8 Apr 2005 11:02:28 -0000 1.1
+++ hb-net-modules.xml 6 Jun 2005 19:15:51 -0000 1.2
@@ -6,8 +6,8 @@
<sections>
-<version>0.1</version>
-<date>2005-03-17</date>
+<version>1.0</version>
+<date>2005-06-06</date>
<section>
<title>Network Modules</title>
@@ -333,11 +333,51 @@
config_br0=( "192.168.0.1/24" )
<comment># Depend on eth0 and eth1 as they may require extra
configuration</comment>
-depend_bond0() {
+depend_br0() {
need net.eth0 net.eth1
}
</pre>
+<impo>
+For using some bridge setups, you may need to consult the
+<uri link="hb_part1_chap2.html#doc_chap3">variable name</uri>
+documentation.
+</impo>
+
+</body>
+</section>
+
+<section>
+<title>MAC Address</title>
+<body>
+
+<p>
+You don't need to emerge anything for changing the MAC address of your
+interface if you change to a specific address. However, if you need to
+change to a random address or a random address of a given type then you
+need to emerge net-analyzer/macchanger.
+</p>
+
+<pre caption="MAC Address change example">
+<comment># To set the MAC address of the interface</comment>
+mac_eth0="00:11:22:33:44:55"
+
+<comment># To randomize the last 3 bytes only</comment>
+mac_eth0="random-ending"
+
+<comment># To randomize between the same physical type of connection (eg fibre,
+# copper, wireless) , all vendors</comment>
+mac_eth0="random-samekind"
+
+<comment># To randomize between any physical type of connection (eg fibre,
copper,
+# wireless) , all vendors</comment>
+mac_eth0="random-anykind"
+
+<comment># Full randomization - WARNING: some MAC addresses generated by this
may
+# NOT act as expected</comment>
+mac_eth0="random-full"
+</pre>
+
</body>
</section>
@@ -393,6 +433,12 @@
config_vlan2=( "172.16.2.1 netmask 255.255.254.0" )
</pre>
+<impo>
+For using some VLAN setups, you may need to consult the
+<uri link="hb_part1_chap2.html#doc_chap3">variable name</uri>
+documentation.
+</impo>
+
</body>
</section>
1.2 +3 -3 xml/htdocs/doc/en/handbook/draft/hb-net-start.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-start.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-start.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-start.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo
Index: hb-net-start.xml
===================================================================
RCS file:
/var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-net-start.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- hb-net-start.xml 8 Apr 2005 11:02:28 -0000 1.1
+++ hb-net-start.xml 6 Jun 2005 19:15:51 -0000 1.2
@@ -6,8 +6,8 @@
<sections>
-<version>0.2</version>
-<date>2005-04-06</date>
+<version>1.0</version>
+<date>2005-06-06</date>
<section>
<title>Getting started</title>
@@ -21,7 +21,7 @@
</note>
<note>
-This document requires you are running baselayout-1.11.10-r6 or better.
+This document requires you are running baselayout-1.11.11 or better.
</note>
<p>
1.2 +35 -19 xml/htdocs/doc/en/handbook/draft/hb-net-wireless.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-wireless.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-wireless.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-net-wireless.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo
Index: hb-net-wireless.xml
===================================================================
RCS file:
/var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-net-wireless.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- hb-net-wireless.xml 8 Apr 2005 11:02:28 -0000 1.1
+++ hb-net-wireless.xml 6 Jun 2005 19:15:51 -0000 1.2
@@ -6,8 +6,8 @@
<sections>
-<version>0.2</version>
-<date>2005-04-06</date>
+<version>1.0</version>
+<date>2005-06-06</date>
<section>
<title>Introduction</title>
@@ -20,10 +20,11 @@
</p>
<p>
-wpa_suppliant is the best choice, but it does not support all cards/drivers
-and currently cannot connect to un-encypted Access Points. For a list of
-supported drivers, <uri link="http://hostap.epitest.fi/wpa_supplicant/">read
-the wpa_supplicant site</uri>.
+wpa_suppliant is the best choice, but it does not support all drivers.
+For a list of supported drivers,
+<uri link="http://hostap.epitest.fi/wpa_supplicant">read the wpa_supplicant
+site</uri>. Also, wpa_supplicant can currently only connect to SSID's that
+you have configured for.
</p>
<p>
@@ -56,6 +57,10 @@
# <i>emerge net-wireless/wpa_supplicant</i>
</pre>
+<impo>
+You have to have CONFIG_PACKET enabled in your kernel for wpa_supplicant to
work
+</impo>
+
<p>
Now we have to configure <path>/etc/conf.d/net</path> to so that we prefer
wpa_supplicant over wireless-tools (if both are installed, wireless-tools
@@ -65,11 +70,19 @@
<pre caption="configure /etc/conf.d/net for wpa_supplicant">
<comment># Prefer wpa_supplicant over wireless-tools</comment>
modules=( "wpa_supplicant" )
+
<comment># It's important that we tell wpa_supplicant which driver we should
# be using as it's not very good at guessing yet</comment>
wpa_supplicant_eth0="-Dmadwifi"
</pre>
+<note>
+If you're using the host-ap driver you will need to put the card in Managed
+mode before it can be used with wpa_supplicant correctly. You can use
+<e>iwconfig_eth0="mode managed"</e> to achieve this in
+<c>/etc/conf.d/net</c>.
+</note>
+
<p>
That was simple wasn't it? However, we still have to configure wpa_supplicant
itself which is a bit more tricky depending on how secure the Access Points
@@ -79,7 +92,7 @@
</p>
<pre caption="an example /etc/wpa_supplicant.conf">
-<comment># The below line not be changed over-wise we refuse to work</comment>
+<comment># The below line not be changed otherwise we refuse to work</comment>
ctrl_interface=/var/run/wpa_supplicant
<comment># Ensure that only root can read the WPA configuration</comment>
@@ -194,12 +207,9 @@
</note>
<impo>
-When configuring variables against a specific ESSID, the variable may
-need to be "escaped" so that it works correctly. This means that any
-character which is not in the English alphabet or a number between 0 and 9
-needs to be replaced with a _ character.<br/><br/>
-So the ESSID "Foo Bar" becomes "Foo_Bar", and as such we can
-reference it as key_Foo_Bar.
+You <b>will</b> need to consult the
+<uri link="hb_part1_chap2.html#doc_chap3">variable name</uri>
+documentation.
</impo>
<pre caption="sample iwconfig setup in /etc/conf.d/net">
@@ -445,6 +455,12 @@
These work if you're using WPA Supplicant or Wireless Tools.
</note>
+<impo>
+You <b>will</b> need to consult the
+<uri link="hb_part1_chap2.html#doc_chap3">variable name</uri>
+documentation.
+</impo>
+
<pre caption="override network settings per ESSID">
config_ESSID1=( "192.168.0.3/24 brd 192.168.0.255" )
routes_ESSID1=( "default via 192.168.0.1" )
@@ -455,15 +471,15 @@
<comment># We can define nameservers and other things too</comment>
<comment># NOTE: DHCP will override these unless it's told not too</comment>
-nameservers_ESSID1=( "192.168.0.1" "192.168.0.2" )
-domain_ESSID1="some.domain"
-searchdomains_ESSID1="search.this.domain search.that.domain"
+dns_servers_ESSID1=( "192.168.0.1" "192.168.0.2" )
+dns_domain_ESSID1="some.domain"
+dns_search_domains_ESSID1="search.this.domain search.that.domain"
<comment># You override by the MAC address of the Access Point
# This handy if you goto different locations that have the same ESSID</comment>
-mac_config_001122334455=( "dhcp" )
-mac_dhcpcd_001122334455="-t 10"
-mac_nameservers_001122334455=( "192.168.0.1" "192.168.0.2" )
+config_001122334455=( "dhcp" )
+dhcpcd_001122334455="-t 10"
+dns_servers_001122334455=( "192.168.0.1" "192.168.0.2" )
</pre>
</body>
--
[email protected] mailing list