UNIX System Administration Handbook - Evi Nemeth [214]
all
turns on all tracing options.
normal
traces normal events. Abnormal events are always traced.
policy
traces the way that administratively configured policy statements affect the distribution of routes.
route
traces routing table changes.
general
turns on both normal and route.
An even more detailed level of tracing dumps individual network packets to the log file. However, packet tracing can only be enabled in the config file, not on the command line.
The gated configuration file
Unlike many UNIX administrative systems, gated has reasonable default behavior. Hundreds of options are supported, but simple networks should need only a few lines of configuration. As you read this rest of this chapter and the gated documentation, keep in mind that most features will not apply to you.
The following sections provide a quick look at the most mainstream gated configuration options. Because of the way gated’s configuration file works, it’s necessary to show syntax outlines for many of the options. We’ve pruned these outlines so that they contain only the parts we want to talk about. If you find yourself thinking that there really ought to be an XYZ option available somewhere, there probably is; we just haven’t shown it. Refer to the gated documentation for complete coverage.
gated comes with an explanation of the format of its configuration file, but the documentation won’t do much to educate you about advanced routing issues. You may need to refer to one of the sources listed on page 371 to really understand the function and purpose of each option.
gated’s configuration file consists of a series of statements separated by semicolons. Tokens are separated by whitespace, which may include newlines. Curly braces are sometimes used for grouping, but only in specific contexts.
There are several classes of statement. Statements of each type must appear together in the configuration file, and the sections must appear in the following order:
• Options and definitions (including declarations of network interfaces)
• Configuration of individual protocols
• Static routes
• Import, export, and aggregation controls
It’s fine for a section to be empty.
Tracing options can appear anywhere. If they appear within curly braces, they apply only within the context of the option or protocol being configured. The options are specified with a traceoptions statement:
traceoptions ["log" [replace] [size size[k|m] files num]] trace_options
[except trace_options] ;
The log is the filename into which tracing output is stored. If replace is specified, the log will be truncated and restarted whenever gated restarts; the default is to append. The size parameter specifies the maximum size of the log file in kilo or megabytes. When the log gets too big, it will be restarted and the old log renamed log.1, log.2, etc., up to the number of files specified by the files clause. If you specify size, you must also specify files.
The possible trace_options are those specified above (some additional minor options not listed here are also supported).
Here’s an example that creates the file /usr/local/etc/gated.log and rotates 1MB files up to 3 deep, with all possible tracing options turned on:
traceoptions "/usr/local/etc/gated.log" replace size 1m files 3 all;
Option configuration statements
The most common options are:
options [nosend] [noresolv] [syslog [upto] log_level] ;
The arguments have the following meanings:
nosend
prevents gated from sending any packets. This argument is useful for debugging, since gated can be asked to process information from other routers without interfering with the actual routing of the network.
noresolv
prevents gated from attempting to use DNS to translate hostnames to IP addresses. DNS queries can fail if not enough