Git init
[external/ifupdown.git] / inet.defn
1 address_family inet
2 architecture linux
3
4 method loopback
5   description
6     This method may be used to define the IPv4 loopback interface.
7
8   up
9     ifconfig %iface% 127.0.0.1 up
10     route add -net 127.0.0.0       if ( mylinuxver() < mylinux(2,1,100) )
11
12   down
13     ifconfig %iface% down
14 method static
15   description
16     This method may be used to define ethernet interfaces with statically
17     allocated IPv4 addresses.
18       
19   options
20     address address             -- Address (dotted quad) *required*
21     netmask netmask             -- Netmask (dotted quad) *required*
22     broadcast broadcast_address -- Broadcast address (dotted quad)
23     network network_address     -- Network address (dotted quad) *required \
24                                      for 2.0.x kernels*
25     metric metric               -- Routing metric for default gateway (integer)
26     gateway address             -- Default gateway (dotted quad)
27     pointopoint address         -- Address of other end point (dotted quad). \
28                                    Note the spelling of "point-to".
29     media type                  -- Medium type, driver dependent
30     hwaddress class address     -- Hardware Address. /class/ is one of \
31                                      *ether*, *ax25*, *ARCnet* or *netrom*. \
32                                      /address/ is dependent on the above \
33                                      choice.
34     mtu size                    -- MTU size
35
36   up
37     [[ ifconfig %iface% hw %hwaddress%]]
38     ifconfig %iface% %address% netmask %netmask% [[broadcast %broadcast%]] \
39         [[pointopoint %pointopoint%]] [[media %media%]] [[mtu %mtu%]] \
40         up
41     route add -net %network%  \
42         if ( mylinuxver() < mylinux(2,1,100) )
43     [[ route add default gw %gateway% [[metric %metric%]] %iface% ]]
44
45   down
46     [[ route del default gw %gateway% [[metric %metric%]] %iface% ]]
47     ifconfig %iface% down
48 method manual
49   description
50     This method may be used to define interfaces for which no configuration
51     is done by default.  Such interfaces can be configured manually by
52     means of *up* and *down* commands or /etc/network/if-*.d scripts.
53
54   up
55
56   down
57 method dhcp
58   description
59     This method may be used to obtain an address via DHCP with any of
60     the tools: dhclient, pump, udhcpc, dhcpcd.
61     (They have been listed in their order of precedence.)
62     If you have a complicated DHCP setup you should
63     note that some of these clients use their own configuration files
64     and do not obtain their configuration information via *ifup*.
65
66   options
67     hostname hostname       -- Hostname to be requested (pump, dhcpcd, udhcpc)
68     leasehours leastime     -- Preferred lease time in hours (pump)
69     leasetime leasetime     -- Preferred lease time in seconds (dhcpcd)
70     vendor vendor           -- Vendor class identifier (dhcpcd)
71     client client_id        -- Client identifier (dhcpcd, udhcpc)
72     hwaddress class address -- Hardware Address. /class/ is one of \
73                                 *ether*, *ax25*, *ARCnet* or *netrom*. \
74                                 /address/ is dependent on this choice.
75
76   up
77     [[ifconfig %iface% hw %hwaddress%]]
78     dhclient3 -pf /var/run/dhclient.%iface%.pid -lf /var/run/dhclient.%iface%.leases %iface% \
79         if (execable("/sbin/dhclient3"))
80     dhclient -e -pf /var/run/dhclient.%iface%.pid -lf /var/run/dhclient.%iface%.leases %iface% \
81         elsif (execable("/sbin/dhclient"))
82     pump -i %iface% [[-h %hostname%]] [[-l %leasehours%]] \
83         elsif (execable("/sbin/pump") && mylinuxver() >= mylinux(2,1,100))
84     udhcpc -n -p /var/run/udhcpc.%iface%.pid -i %iface% [[-H %hostname%]] \
85            [[-c %clientid%]] \
86         elsif (execable("/sbin/udhcpc") && mylinuxver() >= mylinux(2,2,0))
87     dhcpcd [[-h %hostname%]] [[-i %vendor%]] [[-I %clientid%]] \
88            [[-l %leasetime%]] %iface% \
89         elsif (execable("/sbin/dhcpcd"))
90
91   down
92     dhclient3 -r -pf /var/run/dhclient.%iface%.pid -lf /var/run/dhclient.%iface%.leases %iface% \
93         if (execable("/sbin/dhclient3"))
94     cat /var/run/dhclient.%iface%.pid | xargs -i kill -TERM {} \
95         elsif (execable("/sbin/dhclient"))
96     pump -i %iface% -r \
97         elsif (execable("/sbin/pump") && mylinuxver() >= mylinux(2,1,100))
98     cat /var/run/udhcpc.%iface%.pid | xargs -i kill -TERM {} \
99         elsif (execable("/sbin/udhcpc"))
100     dhcpcd -k %iface% \
101         elsif (execable("/sbin/dhcpcd"))
102
103     ifconfig %iface% down
104 method bootp
105   description
106     This method may be used to obtain an address via bootp.
107
108   options
109     bootfile file  -- Tell the server to use /file/ as the bootfile.
110     server address -- Use the IP address /address/ to communicate with \
111                       the server.
112     hwaddr addr    -- Use /addr/ as the hardware address instead of \
113                       whatever it really is.
114
115   up
116     bootpc [[--bootfile %bootfile%]] --dev %iface% [[--server %server%]] \
117            [[--hwaddr %hwaddr%]] --returniffail --serverbcast
118
119   down
120     ifconfig down %iface%
121 method ppp
122   description
123     This method uses pon/poff to configure a PPP interface. See those
124     commands for details.
125   options
126     provider name  -- Use /name/ as the provider (from /etc/ppp/peers).
127   up
128     pon [[%provider%]]
129   down
130     poff [[%provider%]]
131 method wvdial
132   description
133     This method uses wvdial to configure a PPP interface. See that command
134     for more details.
135   options
136     provider name  -- Use /name/ as the provider (from /etc/ppp/peers).
137   up
138     /sbin/start-stop-daemon --start -x /usr/bin/wvdial \
139                       -p /var/run/wvdial.%iface% -b -m -- [[ %provider% ]]
140   down
141     /sbin/start-stop-daemon --stop -x /usr/bin/wvdial \
142                       -p /var/run/wvdial.%iface% -s 2