gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
NAME
gated-config - gated configuration file syntax
SYNOPSIS
/etc/gated.conf
DESCRIPTION
The gated-config file consists of a sequence of statements terminated
by a semicolon (;). Statements are composed of tokens separated by
any combination of spaces, tabs, and new-line characters.
Comments may be specified in either of two forms. One form starts
with a pound-sign (#) and runs to the end of the line. The other
form is "C" style, which starts with a "/*" and continues until it
reaches "*/".
There are eight classes of statements. The first two classes may be
specified in the configuration file in any order:
directives
These statements are immediately acted upon by the
parser. They are used to specify included files and
the directory in which they reside. Unlike other
statements which terminate a semicolon (;), directive
statements terminate with a newline.
trace These statements control tracing options.
The six remaining classes must be specified in order.
options
These statements allow specification of some global
options.
interface
These statements specify interface options.
definition
These statements specify martian networks.
protocol
These statements enable or disable protocols and set
protocol options.
route Static routes are defined by route statements.
control
Control statements define routes that are imported from
routing peers and routes that are exported to these
peers.
Detailed definitions of these classes of statements follow.
Primitives that are used in the following definitions are:
Licensed material--property of copyright holder(s) 1
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
host Any host. A host may be specified by its IP address or by a
domain name. If a domain name is specified that has multiple
IP addresses it is considered an error. The host bits in the
IP address must be non-zero.
network
Any network. A network may be specified by its IP address or
a network name. The host bits in a network specification
must be zero. "Default" may also be used to specify the
default network (0.0.0.0).
destination
Any host or network.
dest_mask
Any host or network with an optional mask:
all
network
network mask mask
network mask-length bits
host host
gateway
A gateway must be a host on an attached network.
interface
An interface may be specified by IP address, domain name, or
interface name. Be careful with the use of interface names
as future Unix operating systems may allow more than one
address per interface.
gateway_list
A gateway list is a list of one or more gateways.
interface_list
An interface list is a list of one or more interface names,
wildcard names (names without a number) or addresses, or the
token "all", which refers
to all interfaces.
preference
A preference is used to determine the order of routes to the
same destination in routing table. Gated allows one route to
a destination per protocol/per autonomous system. In the
case of multiple routes the route to use is chosen by
preference, which is a number between 0 and 255, with 0 being
the most preferred and 255 being the least preferred.
In case of a preference tie, if the two routes are from the
same protocol and from the same autonomous system, gated will
chose the route with the lowest metric. Otherwise gated will
choose the route with the lowest numeric next-hop gateway
address.
Licensed material--property of copyright holder(s) 2
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
metric Is a valid metric for the specified protocol.
Directive Statements
%directory "pathname"
Sets the current directory to pathname. This is the
directory where gated looks for included files that do not
begin with "/".
Note that this statement does not actually change the current
directory, it just specifies the prefix applied to included
file names.
%include "filename"
Causes the specified file to be parsed completely before
resuming with this file. Nesting up to 10 levels is
supported.
Trace Statements
tracefile ["filename" [replace]] [size size[k|m] files files] ;
Specifies the file to contain tracing output. If a filename
is specified, trace information is appended to this file
unless "replace" is specified.
If specified, size and files cause the trace file to be limited to
size, with files files kept (including the active file). The backup
filenames are created by appending a period and a number to the trace
filename, starting with ".0". The minimum size that can be specified
is 10k, the minimum number of files that can be specified is 2. The
default is not to rotate log files.
traceoptions traceoption [traceoption [ ... ]] [except traceoption
[traceoption> [ ...]]];
Changes the tracing options to those specified. If "none" is
the only option specified, tracing is turned off. If the
"except" keyword is specified, flags listed before it are
turned on and flags listed after it are turned off. This is a
simple method to turn on all but a few flags. Trace flags
are:
all Turn on all of the tracing options below except
nostamp.
general Turn on internal, external and route.
internal Internal errors and informational messages.
external External errors.
nostamp Do not timestamp all messages in the trace file.
mark Output a message to the trace log every 10 minutes
to insure gated is still running.
task Task scheduling, signal handling and packet
Licensed material--property of copyright holder(s) 3
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
reception.
timer Timer scheduling.
parse Tokens the parser recognizes in the config file.
route Changes to the gated routing table.
kernel Changes to the kernel's routing table.
rip RIP packets sent and received. May be modified by
"update".
hello HELLO packets sent and received. May be modified by
"update".
icmp ICMP redirect packets sent and received. May be
modified by "update".
Note that redirects processed are traced under the
"route" option.
protocol Provide messages about protocol state machine
transitions when used with OSPF.
update Trace the contents of protocol packets.
Options Statements
options optionlist ;
Sets gated options:
noinstall Do not change kernel's routing table. Useful for
verifying configuration files.
nosend Do not send any packets. This allows running
gated on a live network to test protocol
interactions without actually participating in
the routing protocols. The packet traces in the
gated log can be examined to verify that gated is
functioning properly. This is most useful for
RIP and HELLO.
noresolv Do not try to resolv symbolic names into IP
addresses by using the host/network tables or
Domain Name System. This is intended for systems
where a lack of routing information could cause a
DNS lookup to hang.
syslog Controls the amount of data gated logs via syslog
on systems where setlogmask() is supported. The
log_levels and other terminology are as defined
in the setlogmask(3) man page. The default is
equivalent to "syslog upto info".
Licensed material--property of copyright holder(s) 4
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
Interface Statements
interfaces {
options [strictifs] [scaninterval time] ;
interface interfacelist interfaceoptions ;
define address [broadcast broadaddr|pointopoint
lcladdr] [netmask netmask] [multicast] ;
} ;
options Sets some global options related to interfaces.
Options are:
strictifs Indicates that it is a fatal error to reference
an interface in the configuration file that is
not listed in a define statement or not present
when gated is started. Without this option a
warning message will be issued and gated will
continue.
scaninterval time
Specifies how often gated scans the kernel
interface list for changes. The default is every
15 seconds. Note that gated will also scan the
interface list on receipt of a SIGUSR2.
define Defines interfaces that may not be present when gated is
started. Gated considers it an error to reference a non-
existent interface in the config file. This clause allows
specification of that interface so it can be referenced in
the config file.
Definition keywords are:
broadcast broadaddr
Defines the interface as broadcast capable (i.e.
Ethernet and Token Ring) and specifies the
broadcast address.
pointopoint localaddr
Defines the interface as a point to point
interface (i.e. SLIP and PPP) and specifies the
address on the local side. For this type of
interface the interfaceaddr specifies the
address of the remote host.
An interface not defined as broadcast or pointopoint is
assumed to be non-broadcast multiaccess (NBMA), such as an
X.25 network.
netmask subnetmask
Specifies the non-standard subnet mask to be used
on this interface. Note that this currently
ignored on pointopoint interfaces.
Licensed material--property of copyright holder(s) 5
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
multicast Specifies the interface is multicast capable.
interface Sets interface options on the specified interfaces. An
interface list is "all" or a list of interface names (see
warning about interface names), domain names, or numeric
addresses.
Options are:
preference pref
Sets the preference for routes to this interface
when it is up, defaults to 0.
down preference pref
Sets the preference for routes to this interface
when gated believes it to be down due to lack of
received routing information, defaults to 120.
passive
Prevents gated from changing the preference of the
route to this interface if it is believed to be down
due to lack of received routing information.
simplex
Defines an interface as unable to hear it's own
broadcast packets. Currently defining an interface
as simplex is functionally equivalent to defining it
as passive.
Definition Statements
routerid interface ;
Sets the router identifier for use by the OSPF protocols.
The default is the address of the first interface
encountered by gated. The address of a non-POINTOPOINT
interface is preferred over the local address of a
POINTOPOINT interface and an address loopback interface
that is not the loopback address (127.0.0.1) is most
preferred.
martians {
<martian_list>
} ;
Defines a list of martian addresses about which all routing
information is ignored. The martianlist is a semicolon
separated list of symbolic or numeric hosts specified as
`host <host>'. Also, the `allow' parameter may be
specified to explicitly allow a subset of a range that was
disallowed.
Licensed material--property of copyright holder(s) 6
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
Protocol Statements
Enables or disables use of a protocol and controls protocol options.
These may be specified in any order.
For all protocols, "preference" controls the choice of routes learned
via this protocol or from this autonomous system in relation to
routes learned from other protocols/autonomous systems. The default
metric used when propagating routes learned from other protocols is
specified with "defaultmetric" which itself defaults to the highest
valid metric for this protocol, for many protocols this signifies a
lack of reachability.
For distance vector IGPs with no explicit connections or
authentication (RIP and HELLO) and redirects (ICMP), the
"trustedgateways" clause supplies a list of gateways providing valid
routing information; routing packets from other gateways are ignored.
This defaults to all gateways on the attached networks.
Routing packets may be sent not only to the remote end of point-to-
point links and the broadcast address of broadcast-capable
interfaces, but also to specific gateways if they are listed in a
"sourcegateways" clause and "yes" or "on" is specified. If
"nobroadcast" is specified, routing updates will be sent only to
gateways listed in the "sourcegateways" clause, and not at all to the
broadcast address. Disabling the transmission and reception of
routing packets for a particular protocol may be specified with the
"interface" clause. An "interface" clause which disables sending or
receiving protocol packets may be overridden for specific peers using
the "trustedgateways" and "sourcegateways" clauses.
Any protocol can have a "traceoptions" clause, which enables tracing
for a particular protocol, group or peer. The allowable protocol-
specific options are: all, general, internal, external, route,
update, task, timer, protocol, or kernel.
rip yes|no|on|off [ {
broadcast ;
nobroadcast ;
nocheckzero;
preference preference ;
defaultmetric metric ;
interface interfacelist [noripin] [noripout]
[metricin metric] [metricout metric]
[version 1]|[version 2 [multicast|broadcast]];
...
trustedgateways gatewaylist ;
sourcegateways gatewaylist ;
traceoptions traceoptions ;
} ] ;
If the rip clause is not specified the default is "rip on".
"Nobroadcast" specifies that RIP packets will only be sent to
gateways listed in the "sourcegateways" clause, if there are
Licensed material--property of copyright holder(s) 7
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
any. If "yes" or "on" is specified, RIP will assume
"nobroadcast" if there is only one interface and "broadcast"
if there is more than one. "Broadcast" specifies that RIP
packets will always be generated. "Nocheckzero" specifies
that RIP should not make sure that the reserved fields in RIP
packets are zero.
Note that using "broadcast" with only one interface is
useful only when propagating static routes or routes
learned from another protocol. This will cause data
packets to travel across the same network twice, which
may be tolerable in certain configurations.
The default metricout is zero, the default metricin is the
kernel interface metric plus 1 (the default RIP hop count).
If the version is specified as or defaults to 1, RIP version 2
packets will never be sent except in response to a v2 POLL
packet. If the version is specified as 2, RIP version 2
packets will be sent to the RIP multicast address if possible,
or to the broadcast addresss, unless the method is explicitly
specified.
The default metric is 16; the default preference is 100.
hello yes|no|on|off [ {
broadcast ;
nobroadcast ;
preference preference ;
defaultmetric metric ;
interface interfacelist [nohelloin] [nohelloout]
[metricin metric] [metricout metric];
...
trustedgateways gatewaylist ;
sourcegateways gatewaylist ;
traceoptions traceoptions ;
} ] ;
If "yes" or "on" is specified, HELLO will assume "nobroadcast"
if there is only one interface and "broadcast" if there is
more than one. If the HELLO clause is not specified the
default is "hello off". "Broadcast" specifies that HELLO
packets will be generated. "Nobroadcast" specifies that HELLO
packets will only be sent to gateways listed in the
"sourcegateways" clause, if there are any.
Note that using "broadcast" with only one interface is
useful only when propagating static routes or routes
learned from another protocol. This will cause data
packets to travel across the same network twice, which
may be tolerable in certain configurations.
The default metricout is zero, the default metricin is a
translation of the kernel interface metric into a hello metric
Licensed material--property of copyright holder(s) 8
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
plus 100 (the default HELLO hop count).
The default metric is 30000; the default preference is 90.
ospf yes|no|on|off [ {
[ defaults {
preference preference ;
cost cost ;
tag [tag | as [astag]] ;
type <1|2> ;
} ] ;
[exportlimit routes ;]
[exportinterval time ;]
[traceoptions traceoptions ;]
[monitorauthkey authkey ;]
[area area {
authtype <0|1|none|simple> ;
stub [cost cost];
networks {
network [mask mask] ;
} ;
stubhosts {
host cost cost ;
} ;
interface interface [cost cost] {
[enable|disable] ;
retransmitinterval time ;
transitdelay time ;
priority priority ;
hellointerval time ;
routerdeadinterval time ;
authkey authkey ;
} ;
interface interface nonbroadcast [cost cost] {
pollinterval time ;
routers {
gateway [eligible] ;
...
} ;
[enable|disable] ;
retransmitinterval time ;
transitdelay time ;
priority priority ;
hellointerval time ;
routerdeadinterval time ;
authkey authkey ;
} ;
} ; ]
[ backbone {
authtype <0|1|none|simple> ;
networks {
network [mask mask] ;
} ;
subhosts {
Licensed material--property of copyright holder(s) 9
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
host cost cost ;
} ;
interface interface [cost cost] {
[enable|disable] ;
retransmitinterval time ;
transitdelay time ;
priority priority ;
hellointerval time ;
routerdeadinterval time ;
authkey authkey ;
} ;
. . .
interface interface nonbroadcast [cost cost] {
pollinterval time ;
routers {
gateway [eligible] ;
...
} ;
[enable|disable] ;
retransmitinterval time ;
transitdelay time ;
priority priority ;
hellointerval time ;
routerdeadinterval time ;
authkey authkey ;
} ;
. . .
virtuallink neighborid address transitarea area {
[enable|disable] ;
retransmitinterval time ;
transitdelay time ;
priority priority ;
hellointerval time ;
routerdeadinterval time ;
authkey authkey ;
} ;
. . .
} ; ]
} ] ;
interface
An interface is specified with an address, a name, a
wildcard name (name without any number), or "all".
Multiple interface clauses may be specified with
different parameters, the parameters used are
accumulated from the interface clauses. If a parameter
is specified more than once the instance with the most
specific interface reference is used. The order of
precedence is address, name, wildcard name, "all".
cost A number between 0 and 65535 specifying an OSPF
internal cost.
tag The OSPF tag (an unsigned 31-bit number) to be placed
Licensed material--property of copyright holder(s) 10
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
on all routes exported by gated into OSPF.
as_tag The OSPF-BGP tag (an unsigned 12-bit number) to be
placed on all routes export by gated into OSPF. When
"tag as [astag]" is used, tag fields are automatically
generated and the as_tag field is assigned if
specified.
metric A number between 0 and 16777215 specifying an OSPF
external (ASE) cost.
area A dotted quad or a number between 1 and 4294967295.
Area 0 is always referred to as the "backbone".
auth_key
One to eight decimal digits separated by periods, a one
to eight byte hexadecimal string preceded by "0x", or a
one to eight character string in double quotes.
priority
A number between 0 and 255 specifying the priority of
becoming the designated router on this interface.
OSPF inter and intra area are always imported into the gated
routing table with a preference of 10. It would be a
violation of the protocol to do otherwise so it is not
possible to override this. OSPF Autonomous System External
(ASE) routes are imported with a preference of 150. This
default may be changed with the preference keyword in the
defaults section. ASE routes are imported at a rate of 100
ASEs every 1 second, these parameters can be tuned with the
"exportlimit" and "exportinterval" parameters.
Gated routes are exported to OSPF as ASEs with a default cost
of 0 and a type of 1. By default, the tag is calculated from
the AS path of the route being exported (tag as). These may
all be changed in the defaults section.
OSPF areas may be specified in any order, but the "backbone"
area must be specified last.
redirect yes|no|on|off [ {
preference preference ;
interface interfacelist [noredirects] ;
trustedgateways gatewaylist ;
traceoptions traceoptions ;
} ] ;
Controls whether gated makes routing table changes based on
ICMP redirects when not functioning as a router. When
functioning as a router (i.e. any interior routing protocols
(RIP, HELLO, OSPF) are participating in routing on any
Licensed material--property of copyright holder(s) 11
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
interface, ICMP redirects are disabled. When ICMP redirects
are disabled, gated must actively remove the effects of
redirects from the kernel as the kernel always processes ICMP
redirects.
The default preference is 30.
Static Statements
Static routes are specified with "static" clauses.
static {
destmask gateway gateway [gateway2 [gateway3 [...]]]
[interface interfacelist]
[preference preference]
[retain] [noinstall] ;
...
destmask interface interface [preference
preference] [retain] [noinstall] ;
...
} ;
Any number of "static" statements may be specified, each
containing any number of static route definitions. The first
form defines a static route through one or more gateways. If
multiple gateways are specified, they are limited by the
number of multipath destinations supported (on Unix this is
almost always one). Only gateways on interfaces that are
configured and up are used.
The second defines a static interface route which is used for
primitive support of multiple networks on one interface.
The interface list on the first form restricts static routes
to a specific set of interfaces.
"Retain" causes the route to be retained in the kernel after
gated is shut down. "Noinstall" is used to prevent this route
from being installed in the kernel
The preference for static routes defaults to 60.
Control Statements
Importation of routes from routing protocol peers and exportation of
routes to routing protocol peers are controlled by "import" and
"export" clauses.
import proto rip|hello|redirect restrict ;
import proto rip|hello|redirect
[preference preference] {
<import_list>
} ;
import proto rip|hello|redirect interface interfacelist restrict ;
Licensed material--property of copyright holder(s) 12
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
import proto rip|hello|redirect interface <interface_list>
[preference preference] {
<import_list>
} ;
import proto rip|hello|redirect gateway gatewaylist restrict ;
import proto rip|hello|redirect gateway <gateway_list>
[preference preference] {
<import_list>
} ;
import proto ospfase [tag ospftag] restrict ;
import proto ospfase [tag ospftag]
[preference preference] [{
<import_list>
}] ;
If an OSPF type is specified, only routes of that type
will be considered for import, otherwise either type
will be considered. If an ospf_tag specification is
given, only routes matching that tag specification will
be considered, otherwise any tag will be considered.
An OSPF tag specification may is a decimal, hexadecimal
or dotted quad number.
If more than one import statement relevant to a
protocol is specified, they are processed most specific
to least specific (i.e. for RIP and HELLO, gateway,
interface and protocol), then in the order specified in
the config file.
import_list
An import_list consists of zero or more destinations
(with optional mask). One of two parameters may be
specified, "restrict" to prevent a set of destinations
from being imported or a specific preference for this
set of destinations.
destmask [[restrict] | [preference preference]] ;
Note that the contents of an import_list are sorted
internally so that entries with the most specific masks
are examined first. The order in which dest_mask
entries are specified does not matter.
If no import list is specified, all routes will be
accepted. If an import list is specified, the import
list is scanned for a match. If no match is found, the
route is discarded. Rephrased, a "all restrict" entry
is assumed in an import list.
Licensed material--property of copyright holder(s) 13
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
export proto rip|hello restrict ;
export proto rip|hello [metric metric] {
<export_list>
} ;
export proto rip|hello interface interfacelist restrict ;
export proto rip|hello interface <interface_list>
[metric metric] {
<export_list>
} ;
export proto rip|hello gateway gatewaylist restrict ;
export proto rip|hello gateway <gateway_list>
[metric metric] {
<export_list>
} ;
export proto ospfase [type 1|2] [tag ospftag] restrict ;
export proto ospfase [type 1|2] [tag ospftag]
[cost ospfcost] {
<export_list>
} ;
export_list
The export list specifies exportation based on the
origin of a route to a destination:
proto rip|hello|direct|static|default
[restrict] | [metric metric] [ {
<announce_list>
} ] ;
proto rip|hello|direct|static|default interface <interface_list>
[restrict] | [metric metric] [ {
<announce_list>
} ] ;
proto rip|hello gateway <gateway_list>
[restrict] | [metric metric] [ {
<announce_list>
} ] ;
proto ospf [restrict] | [metric metric] [ {
announcelist ;
} ] ;
proto ospfase [restrict | metric metric]] [ {
announcelist ;
} ] ;
Licensed material--property of copyright holder(s) 14
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
proto proto aspath <aspath_spec>
[restrict] | [metric metric] [ {
<announce_list>
} ] ;
proto proto tag tag
[restrict] | [metric metric] [ {
<announce_list>
} ] ;
If a tag is specified, only routes with that tag will
be considered, otherwise any tag will be considered.
An OSPF tag on an export statement may be a decimal,
hexidecimal, or "AS" to generate a tag based on the AS
path of route being announced. An OSPF tag on an
export list is just an 31 bit number that is matched
against the tag present (if any) on that route.
If more than one export statement relevant to a
protocol is specified, they are processed most specific
to least specific (i.e. for RIP and HELLO, gateway,
interface and protocol), then in the order specified in
the config file.
By default interface routes are exported to all
protocols. RIP and HELLO also export their own routes.
An export specification with just a restrict will
prevent these defaults from being exported. Note that
it is not possible to change the metric RIP and HELLO
use for their own routes; any attempt to override it
will be silently ignored.
Any protocol may be specified for import lists
referring to aspaths and tags. AS paths are most
meaningful with OSPF ASE routes, but are generated for
all routes. Tags are currently only meaningful for
OSPF ASE routes.
announce_list
An announce_list consists of zero or more destinations
(with optional mask). One of two parameters may be
specified, "restrict" to prevent a set of destinations
from being exported or a specific metric for this set
of destinations.
destmask [[restrict] | [metric metric]] ;
Note that the contents of an announce_list are sorted
internally so that entries with the most specific masks are
examined first. The order in which dest_mask entries are
specified does not matter.
Licensed material--property of copyright holder(s) 15
gated-config(4M) TCP/IP 5.4R3.00 gated-config(4M)
If no announce_list is specified, all destinations are
announced. If an announce list is specified, an "all
restrict" is assumed. Therefore, an empty announce
list is the equivalent of "all restrict".
Note that to announce routes which specify a next hop
of the loopback interface (i.e. static and internally
generated default routes) via RIP or HELLO it is
necessary to specify the metric at some level in the
propagate clause. Just setting a default metric for
RIP or HELLO is not sufficient.
FILES
/etc/gated.conf
AUTHORS
See gated(1M).
SEE ALSO
arp(1M), gated(1M), gdc(1M), ifconfig(1M), netstat(1M) ripquery(1M)
routed(1M) syslog(3C)
RFC 891 DCN Local-Network Protocols (HELLO)
RFC 1058 Routing Information Protocol
RFC 1247 OSPF Specification, Version 2
COPYRIGHT INFORMATION
This software and associated documentation is Copyright 1990, 1991,
1992 Cornell University., all rights reserved.
This daemon contains code that is Copyright 1988 Regents of the
University of California., all rights reserved.; it also contains
code that is Copyright 1989, 1990, 1991 The University of Maryland,
College Park, Maryland., all rights reserved; and contains also code
that is Copyright 1991 D.L.S. Associates., all rights reserved.
Licensed material--property of copyright holder(s) 16