more DoS prevention: add packet_limit option to apply a hard limit to downstream...
[l2tpns.git] / Docs / startup-config.5
1 .\" -*- nroff -*-
2 .de Id
3 .ds Dt \\$4 \\$5
4 ..
5 .Id $Id: startup-config.5,v 1.4 2005-01-10 07:17:37 bodea Exp $
6 .TH STARTUP-CONFIG 5 "\*(Dt" L2TPNS "File Formats and Conventions"
7 .SH NAME
8 startup\-config \- configuration file for l2tpns
9 .SH SYNOPSIS
10 /etc/l2tpns/startup-config
11 .SH DESCRIPTION
12 .B startup-config
13 is the configuration file for
14 .BR l2tpns .
15 .PP
16 The format is plain text, in the same format as accepted by the
17 configuration mode of
18 .BR l2tpns 's
19 telnet administrative interface.  Comments are indicated by either the
20 character
21 .B #
22 or
23 .BR ! .
24 .SS SETTINGS
25 Settings are specified with
26 .IP
27 .BI "set " "variable value"
28 .PP
29 The following
30 .IR variable s
31 may be set:
32 .RS
33 .TP
34 .B debug
35 Set the level of debugging messages written to the log file.  The
36 value should be between 0 and 5, with 0 being no debugging, and 5
37 being the highest.
38 .TP
39 .B log_file
40 This will be where all logging and debugging information is written
41 to.  This may be either a filename, such as
42 .BR /var/log/l2tpns ,
43 or the string
44 .BR syslog : \fIfacility\fR ,
45 where
46 .I facility
47 is any one of the syslog logging facilities, such as
48 .BR local5 .
49 .TP
50 .B pid_file
51 If set, the process id will be written to the specified file.  The
52 value must be an absolute path.
53 .TP
54 .B l2tp_secret
55 The secret used by
56 .B l2tpns
57 for authenticating tunnel request.  Must be the same as the LAC, or
58 authentication will fail.  Only actually be used if the LAC requests
59 authentication.
60 .TP
61 .BR primary_dns , " secondary_dns"
62 Whenever a PPP connection is established, DNS servers will be sent to the
63 user, both a primary and a secondary.  If either is set to 0.0.0.0, then that
64 one will not be sent.
65 .TP
66 .B save_state
67 When
68 .B l2tpns
69 receives a STGTERM it will write out its current ip_address_pool,
70 session and tunnel tables to disk prior to exiting to be re-loaded at
71 startup.  The validity of this data is obviously quite short and the
72 intent is to allow an sessions to be retained over a software upgrade.
73 .TP
74 .BR primary_radius , " secondary_radius"
75 Sets the RADIUS servers used for both authentication and accounting. 
76 If the primary server does not respond, then the secondary RADIUS
77 server will be tried.
78 .TP
79 .BR primary_radius_port , " secondary_radius_port"
80 Sets the authentication ports for the primary and secondary RADIUS
81 servers.  The accounting port is one more than the authentication
82 port.  If no ports are given, authentication defaults to 1645, and
83 accounting to 1646.
84 .TP
85 .B radius_accounting
86 If set to true, then RADIUS accounting packets will be sent.  A
87 .B Start
88 record will be sent when the session is successfully authenticated,
89 and a
90 .B Stop
91 record when the session is closed.
92 .TP
93 .B radius_secret
94 Secret to be used in RADIUS packets.
95 .TP
96 .B bind_address
97 When the tun interface is created, it is assigned the address
98 specified here.  If no address is given, 1.1.1.1 is used.  Packets
99 containing user traffic should be routed via this address if given,
100 otherwise the primary address of the machine.
101 .TP
102 .B peer_address
103 Address to send to clients as the default gateway.
104 .TP
105 .B send_garp
106 Determines whether or not to send a gratuitous ARP for the
107 .B bind_address
108 when the server is ready to handle traffic (default:  true).  This
109 setting is ignored if BGP is configured.
110 .TP
111 .B throttle_speed
112 Sets the default speed (in kbits/s) which sessions will be limited to.
113 .TP
114 .B throttle_buckets
115 Number of token buckets to allocate for throttling.  Each throttled
116 session requires two buckets (in and out).
117 .TP
118 .B accounting_dir
119 If set to a directory, then every 5 minutes the current usage for
120 every connected use will be dumped to a file in this directory.
121 .TP
122 .B setuid
123 After starting up and binding the interface, change UID to this.  This
124 doesn't work properly.
125 .TP
126 .B dump_speed
127 If set to true, then the current bandwidth utilization will be logged
128 every second.  Even if this is disabled, you can see this information
129 by running the
130 .B
131 uptime
132 command on the CLI.
133 .TP
134 .B cleanup_interval
135 Interval between regular cleanups (in seconds).
136 .TP
137 .B multi_read_count
138 Number of packets to read off each of the UDP and TUN fds when
139 returned as readable by select (default: 10).  Avoids incurring the
140 unnecessary system call overhead of select on busy servers.
141 .TP
142 .B scheduler_fifo
143 Sets the scheduling policy for the
144 .B l2tpns
145 process to
146 .BR SCHED_FIFO .
147 This causes the kernel to immediately preempt any currently running
148 .B SCHED_OTHER
149 (normal) process in favour of
150 .B l2tpns
151 when it becomes runnable. 
152 .br
153 Ignored on uniprocessor systems.
154 .TP
155 .B lock_pages
156 Keep all pages mapped by the
157 .B l2tpns
158 process in memory.
159 .TP
160 .B icmp_rate
161 Maximum number of host unreachable ICMP packets to send per second.
162 .TP
163 .B packet_limit
164 Maximum number of packets of downstream traffic to be handled each
165 tenth of a second per session.  If zero, no limit is applied (default: 
166 0).  Intended as a DoS prevention mechanism and not a general
167 throttling control (packets are dropped, not queued).
168 .TP
169 .B cluster_address
170 Multicast cluster address (default: 239.192.13.13).
171 .TP
172 .B cluster_interface
173 Interface for cluster packets (default: eth0).
174 .TP
175 .B cluster_hb_interval
176 Interval in tenths of a second between cluster heartbeat/pings.
177 .TP
178 .B cluster_hb_timeout
179 Cluster heartbeat timeout in tenths of a second.  A new master will be
180 elected when this interval has been passed without seeing a heartbeat
181 from the master.
182 .RE
183 .SS BGP ROUTING
184 The routing configuration section is entered by the command
185 .IP
186 .BI "router bgp " as
187 .PP
188 where
189 .I as
190 specifies the local AS number.
191 .PP
192 Subsequent lines prefixed with
193 .BI "neighbour " peer
194 define the attributes of BGP neighhbours.  Valid commands are:
195 .IP
196 .BI "neighbour " peer " remote-as " as
197 .br
198 .BI "neighbour " peer " timers " "keepalive hold"
199 .PP
200 Where
201 .I peer
202 specifies the BGP neighbour as either a hostname or IP address,
203 .I as
204 is the remote AS number and
205 .IR keepalive ,
206 .I hold
207 are the timer values in seconds.
208 .SS NAMED ACCESS LISTS
209 Named access lists may be defined with either of
210 .IP
211 .BI "ip access\-list standard " name
212 .br
213 .BI "ip access\-list extended " name
214 .PP
215 Subsequent lines starting with
216 .B permit
217 or
218 .B deny
219 define the body of the access\-list.
220 .PP
221 .B Standard Access Lists
222 .RS 4n
223 Standard access lists are defined with:
224 .IP
225 .RB { permit | deny }
226 .IR source " [" dest ]
227 .PP
228 Where
229 .I source
230 and
231 .I dest
232 specify IP matches using one of:
233 .IP
234 .I address
235 .I wildard
236 .br
237 .B host
238 .I address
239 .br
240 .B any
241 .PP
242 .I address
243 and
244 .I wildard
245 are in dotted-quad notation, bits in the
246 .I wildard
247 indicate which address bits in
248 .I address
249 are relevant to the match (0 = exact match; 1 = don't care).
250 .PP
251 The shorthand
252 .RB ' host
253 .IR address '
254 is equivalent to
255 .RI ' address
256 .BR 0.0.0.0 ';
257 .RB ' any '
258 to
259 .RB ' 0.0.0.0
260 .BR 255.255.255.255 '.
261 .RE
262 .PP
263 .B Extended Access Lists
264 .RS 4n
265 Extended access lists are defined with:
266 .IP
267 .RB { permit | deny }
268 .I proto
269 .IR source " [" ports "] " dest " [" ports "] [" flags ]
270 .PP
271 Where
272 .I proto
273 is one of
274 .BR ip ,
275 .B tcp
276 or
277 .BR udp ,
278 and
279 .I source
280 and
281 .I dest
282 are as described above for standard lists.
283 .PP
284 For TCP and UDP matches, source and destination may be optionally
285 followed by a
286 .I ports
287 specification:
288 .IP
289 .RB { eq | neq | gt | lt }
290 .I port
291 .br
292 .B
293 range
294 .I from to
295 .PP
296 .I flags
297 may be one of:
298 .RS
299 .HP
300 .RB { match\-any | match\-all }
301 .RB { + | - }{ fin | syn | rst | psh | ack | urg }
302 \&...
303 .br
304 Match packets with any or all of the tcp flags set
305 .RB ( + )
306 or clear
307 .RB ( - ).
308 .HP
309 .B established
310 .br
311 Match "established" TCP connections:  packets with
312 .B RST
313 or
314 .B ACK
315 set, and
316 .B SYN
317 clear.
318 .HP
319 .B fragments
320 .br
321 Match IP fragments.  May not be specified on rules with layer 4
322 matches.
323 .RE
324 .SH SEE ALSO
325 .BR l2tpns (8)