--- xml/htdocs/doc/en/handbook/hb-net-modules.xml 2009/02/13 04:40:27 1.25 +++ xml/htdocs/doc/en/handbook/hb-net-modules.xml 2011/08/14 16:12:13 1.26 @@ -4,7 +4,7 @@ - + @@ -13,8 +13,8 @@ different DHCP clients, setting up bonding, bridging, VLANs and more. -8.4 -2009-02-12 +9 +2011-08-13
Network Modules @@ -41,16 +41,16 @@
 # Prefer iproute2 over ifconfig
-modules=( "iproute2" )
+modules="iproute2"
 
 # You can also specify other modules for an interface
 # In this case we prefer pump over dhcpcd
-modules_eth0=( "pump" )
+modules_eth0="pump"
 
 # You can also specify which modules not to use - for example you may be
 # using a supplicant or linux-wlan-ng to control wireless configuration but
 # you still want to configure network settings per ESSID associated with.
-modules=( "!iwconfig" )
+modules="!iwconfig"
 
@@ -74,7 +74,7 @@ # emerge sys-apps/iproute2 # To prefer iproute2 over ifconfig if both are installed -modules=( "iproute2" ) +modules="iproute2"

@@ -84,12 +84,12 @@

-config_eth0=( "192.168.0.2/24" )
-config_eth0=( "192.168.0.2 netmask 255.255.255.0" )
+config_eth0="192.168.0.2/24"
+config_eth0="192.168.0.2 netmask 255.255.255.0"
 
 # We can also specify broadcast
-config_eth0=( "192.168.0.2/24 brd 192.168.0.255" )
-config_eth0=( "192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255" )
+config_eth0="192.168.0.2/24 brd 192.168.0.255"
+config_eth0="192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
 
@@ -178,9 +178,9 @@
 # Only needed if you have more than one DHCP module installed
-modules=( "dhcpcd" ) 
+modules="dhcpcd"
 
-config_eth0=( "dhcp" )
+config_eth0="dhcp"
 dhcpcd_eth0="-t 10" # Timeout after 10 seconds
 dhcp_eth0="release nodns nontp nonis" # Only get an address
 
@@ -204,10 +204,6 @@ # emerge net-dialup/ppp - -If you need PPPoA, then make sure to use >=baselayout-1.12.x. - -

Second, create the PPP net script and the net script for the ethernet interface to be used by PPP: @@ -219,7 +215,7 @@

-Be sure to set RC_NET_STRICT_CHECKING="yes" in /etc/conf.d/rc. +Be sure to set rc_depend_strict to "YES" in /etc/rc.conf.

@@ -227,26 +223,23 @@

-config_eth0=( null ) (Specify your ethernet interface)
-config_ppp0=( "ppp" )
+config_eth0=null (Specify your ethernet interface)
+config_ppp0="ppp"
 link_ppp0="eth0" (Specify your ethernet interface)
-plugins_ppp0=( "pppoe" )
+plugins_ppp0="pppoe"
 username_ppp0='user'
 password_ppp0='password'
-pppd_ppp0=(
-       "noauth"
-       "defaultroute"
-       "usepeerdns"
-       "holdoff 3"
-       "child-timeout 60"
-       "lcp-echo-interval 15"
-       "lcp-echo-failure 3"
-       noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp
-)
-
-depend_ppp0() {
-    need net.eth0
-}
+pppd_ppp0="
+noauth
+defaultroute
+usepeerdns
+holdoff 3
+child-timeout 60
+lcp-echo-interval 15
+lcp-echo-failure 3
+noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp"
+
+rc_need_ppp0="net.eth0"
 

@@ -266,8 +259,10 @@ Please carefully read the section on ADSL and PPP in -/etc/conf.d/net.example. It contains many more detailed -explanations of all the settings your particular PPP setup will likely need. +/usr/share/doc/openrc-0.8.3-r1/net.example.bz2. It contains many +more detailed explanations of all the settings your particular PPP setup will +likely need. Of course, change 0.8.3-r1 with the version of OpenRC +installed on your system. @@ -293,11 +288,11 @@

 # Try DHCP first - if that fails then fallback to APIPA
-config_eth0=( "dhcp" )
-fallback_eth0=( "apipa" )
+config_eth0="dhcp"
+fallback_eth0="apipa"
 
 # Just use APIPA
-config_eth0=( "apipa" )
+config_eth0="apipa"
 
@@ -321,12 +316,10 @@ slaves_bond0="eth0 eth1 eth2" # You may not want to assign an IP to the bonded interface -config_bond0=( "null" ) +config_bond0="null" # Depend on eth0, eth1 and eth2 as they may require extra configuration -depend_bond0() { - need net.eth0 net.eth1 net.eth2 -} +rc_need_bond0="net.eth0 net.eth1 net.eth2" @@ -348,22 +341,20 @@
 # Configure the bridge - "man brctl" for more details
-brctl_br0=( "setfd 0" "sethello 0" "stp off" )
+brctl_br0="setfd 0" "sethello 0" "stp off"
 
 # To add ports to bridge br0
 bridge_br0="eth0 eth1"
 
 # You need to configure the ports to null values so dhcp does not get started
-config_eth0=( "null" )
-config_eth1=( "null" )
+config_eth0="null"
+config_eth1="null"
 
 # Finally give the bridge an address - you could use DHCP as well
-config_br0=( "192.168.0.1/24" )
+config_br0="192.168.0.1/24"
 
 # Depend on eth0 and eth1 as they may require extra configuration
-depend_br0() {
-  need net.eth0 net.eth1
-}
+rc_need_br0="net.eth0 net.eth1"
 
@@ -378,11 +369,8 @@

-You don't need to emerge anything for changing the MAC address of your -interface if you have sys-apps/baselayout-1.11.14 or newer and want to -change to a specific MAC address. However, if you need to change to a random MAC -address or have a baselayout older than the version mentioned above, you have -to emerge net-analyzer/macchanger to be able to make use of this feature. +If you need to, you can change the MAC address of your interfaces through +the network configuration file too.

@@ -424,7 +412,7 @@
 iptunnel_vpn0="mode ipip remote 207.170.82.2 ttl 255"
 
 # To configure the interface
-config_vpn0=( "192.168.0.2 peer 192.168.1.1" ) 
+config_vpn0="192.168.0.2 peer 192.168.1.1"
 
@@ -451,12 +439,12 @@ # You can also configure the VLAN # see for vconfig man page for more details -vconfig_eth0=( "set_name_type VLAN_PLUS_VID_NO_PAD" ) -vconfig_vlan1=( "set_flag 1" "set_egress_map 2 6" ) +vconfig_eth0="set_name_type VLAN_PLUS_VID_NO_PAD" +vconfig_vlan1="set_flag 1" "set_egress_map 2 6" # Configure the interface as usual -config_vlan1=( "172.16.3.1 netmask 255.255.254.0" ) -config_vlan2=( "172.16.2.1 netmask 255.255.254.0" ) +config_vlan1="172.16.3.1 netmask 255.255.254.0" +config_vlan2="172.16.2.1 netmask 255.255.254.0"