]> git.pld-linux.org Git - projects/rc-scripts.git/blob - doc/net-scripts.txt
- move network scripts to /lib, as none of them are config files
[projects/rc-scripts.git] / doc / net-scripts.txt
1 $Id$
2
3 rc-scripts files:
4 ========================================
5
6 /sbin/ifup:
7 /sbin/ifdown:
8
9   These are the only two scripts "in" this directory that should
10   be called directly; these two scripts call all the other
11   scripts as needed.
12
13   These scripts take one argument normally: the name of the device
14   (e.g. eth0).  They are called with a second argument of "boot"
15   during the boot sequence so that devices that are not meant to
16   be brought up on boot (ONBOOT=no, see below) can be ignored at
17   that time.
18
19 /sbin/network-scripts/network-functions:
20
21   Not really a public file.  Contains functions which the scripts use
22   for bringing interfaces up and down.  In particular, it contains
23   most of the code for handling alternative interface configurations
24   and interface change notification through netreport.
25
26 /lib/rc-scripts/ifup-post
27
28   Called when any network device EXCEPT a SLIP (with dip) device comes
29   up.  Calls /lib/rc-scripts/ifup-routes to
30   bring up static routes that depend on that device.  Calls
31   /sbin/network-scripts/ifup-aliases to bring up
32   aliases for that device.  Sets the hostname if it is not
33   already set and a hostname can be found for the IP for that
34   device.  Sends SIGIO to any programs that have requested
35   notification of network events.
36
37   Could be extended to fix up nameservice configuration, call
38   arbitrary scripts, etc, as needed.
39
40 /lib/rc-scripts/ifup-routes
41
42   Set up static routes for a device.
43
44 /lib/rc-scripts/ifup-aliases
45
46   Bring up aliases for a device.
47
48 /lib/rc-scripts/ifdhcpc-done
49
50   Called by dhcpcd once dhcp configuration is complete; sets
51   up /etc/resolv.conf from the version dhcpcd dropped in
52   /etc/dhcpc/resolv.conf
53   
54 Files in /etc/sysconfig/interfaces/
55 ========================================
56
57 /etc/sysconfig/interfaces/ifcfg-<interface-name> and
58 /etc/sysconfig/interfaces/ifcfg-<interface-name>-<clone-name>:
59
60   The first defines an interface, and the second contains
61   only the parts of the definition that are different in a
62   "clone" (or alternative) interface.  For example, the
63   network numbers might be different, but everything else
64   might be the same, so only the network numbers would be
65   in the clone file, but all the device information would
66   be in the base ifcfg file.
67
68   The items that can be defined in an ifcfg file depend on the
69   interface type.  The really obvious ones I'm not going to
70   bother to define; you can figure out what "IPADDR" is, I
71   think...  :-)
72
73   Base items:
74     DEVICE=<name of physical device (except dynamically-allocated PPP
75       devices where it is the "logical name")
76     IPADDR=             IP_AOPTS=       IP_ROPTS=       IP_LABEL=
77     IPADDR1=            IP_AOPTS1=      IP_ROPTS1=      IP_LABEL1=
78     IP_ADDRx=           IP_AOPTSx=      IP_ROPTSx=      IP_LABELx=
79     IP4_PRIM_IF=        IP4_SRC_IF=
80     IP6_PRIM_IF=
81     GATEWAY=
82     ONBOOT=yes|no
83     USERCTL=yes|no
84     BOOTPROTO=none|bootp|dhcp|pump|zeroconf|auto
85     ETHTOOL_OPTS=
86
87   If BOOTPROTO is not "none", then the only other item that
88   must be set is the DEVICE item; all the rest will be determined
89   by the boot protocol.  No "dummy" entries need to be created.
90
91   Ethernet-only items:
92     {IPXNETNUM,IPXPRIMARY,IPXACTIVE}_{802_2,802_3,ETHERII,SNAP}
93     configuration matrix for IPX.  Only used if IPX is active.
94     Managed from /lib/rc-scripts/ifup-ipx
95
96   Deprecated, but supported:
97     ETHTOOL_OPTS=...
98       Any device-specific options supported by ethtool. For example,
99       if you wanted to force 100Mb full duplex:
100         ETHTOOL_OPTS="speed 100 duplex full autoneg off"
101       Note that changing speed or duplex settings almost always
102       requires disabling autonegotiation with 'autoneg off'.
103
104       Long term, this should be done by sysadmin-written udev rules.
105
106   PPP/SLIP items:
107     PERSIST=yes|no
108     MODEMPORT=<device, say /dev/modem>
109     LINESPEED=<speed, say 115200>
110     DEFABORT=yes|no (tells netcfg whether or not to put default
111       abort strings in when creating/editing the chat script and/or
112       dip script for this interface)
113  
114   PPP-specific items
115     DEFROUTE=yes|no (set this interface as default route?)
116     ESCAPECHARS=yes|no (simplified interface here doesn't let people
117       specify which characters to escape; almost everyone can use
118       asyncmap 00000000 anyway, and they can set PPPOPTIONS to
119       asyncmap foobar if they want to set options perfectly)
120     HARDFLOWCTL=yes|no (yes imples "modem crtscts" options)
121     PPPOPTIONS=<arbitrary option string; is placed last on the
122       command line, so it can override other options like asyncmap
123       that were specified differently>
124     PAPNAME=<"name $PAPNAME" on pppd command line> (note that
125       the "remotename" option is always specified as the logical
126       ppp device name, like "ppp0" (which might perhaps be the
127       physical device ppp1 if some other ppp device was brought
128       up earlier...), which makes it easy to manage pap/chap
129       files -- name/password pairs are associated with the
130       logical ppp device name so that they can be managed
131       together.
132
133       In principal, I'm not aware of anything that would keep
134       the logical PPP device names from being "worldnet" or
135       "myISP" instead of ppp0-pppN)
136     REMIP=<remote ip4 address, normally unspecified>
137     REMIP6=<remote ip6 address, normally unspecified>
138     MTU=
139     MRU=
140     DISCONNECTTIMEOUT=<number of seconds, default currently 5>
141       (time to wait before re-establishing the connection after
142       a successfully-connected session terminates before attempting
143       to establish a new connection.)
144     RETRYTIMEOUT=<number of seconds, default currently 60>
145       (time to wait before re-attempting to establish a connection
146       after a previous attempt fails.)
147     INITSCRIPT=<modem command>
148       string which initialises your modem. Usualy something like 
149       AT&F0&C1&D2
150       (PLD Linux rc-scripts specific option)
151     DATAFORCHAT=<list of variables>
152       List of variables which should be exported to chat script.
153       Used mostly for passing USERNAME and PASSWORD into it. (see below)
154       (PLD Linux rc-scripts specific option)
155     PEERDNS=yes|no
156     IPV6_PPP=yes|no
157       use IPv6 for ppp
158        IPV6_CP_USEV4=yes|no
159          use local IPv4 mapped addresses as IPv6 addresses
160        IPV6_CP_PERSISTENT=yes|no
161          use EUI-48 addresses as IPv6 addresses
162        or by default use address specified by IP6_PRIM_IF and REMIP6
163     ENABLE_6TO4=yes|no
164       configure a 6to4 tunnel, if the interface has a public
165       (non-RFC1918) IPv4 address
166     <anything>=<anything>
167       Variable name and it's value for use by chat script.
168       Note: You don't have to define variables here, if they are defined 
169       in parent process enviroment they will be used.
170       in.ex. USERNAME usualy is. 
171   
172   IPIP/GRE/SIT tunnel-specific items
173     REMOTEIP=<ip_addres>
174       address of the remote end of tunnel
175     LOCALIP=<ip_addres>
176       address of the local end of tunnel
177       
178
179
180 /etc/sysconfig/interfaces/ifcfg-<interface-name>-<anything>!:
181
182   Template or backup file. This will not be interpreted
183   by net-scripts.
184
185 /etc/sysconfig/interfaces/data/chat-<interface-name>:
186
187   chat script for PPP or SLIP connection intended to establish
188   the connection.  For SLIP devices, a DIP script is written
189   from the chat script; for PPP devices, the chat script is used
190   directly.
191   In PLD Linux version of rc-scripts, this file is parsed by shell
192   (actually by grep in firstplace to get rid of comments) before it
193   is passed to chat.
194   This allows you to substitute shell variables with their values 
195   defined in <interface name> or more generally in current env.
196   If You wonder about purbose, imagine one chat-script for all links 
197   at ISP's border router or computer in home where all users have own IPS's
198   accounts and want to pay only for themselfes.
199   Unfortunetly this parsing have impact on chat script syntax.
200   All characters that have special meaning for shell have to be escaped.
201   
202   
203 /etc/sysconfig/interfaces/data/dip-<interface-name>
204
205   A write-only script created from the chat script by netcfg.
206   Do not modify this.  In the future, this file may disappear
207   by default and created on-the-fly from the chat script if
208   it does not exist.
This page took 0.06122 seconds and 3 git commands to generate.