gated.conf(SFF) 19 June 1992 gated.conf(SFF) Name gated.conf - gated configuration file syntax Syntax /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 white space, which can be any combination of blanks, tabs and newlines. Comments start with a number-sign ``#'' and run to the end of the line. There are six classes of statements. The first two classes may be speci- fied 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 current directory. traceoptions These statements control tracing options. The four remaining classes must be specified in order. definition These statements specify options, the autonomous system, martian networks and interface options. protocol These statements enable or disable protocols and set pro- tocol options. route Static routes are defined by route statements. control Control statements define routes that are accepted from routing peers and routes that are propagated to these peers. Detailed definitions of these classes of statements follow. Primitives that are used in the following definitions are: host 2c 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 address 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 specifica- tion must be zero. ``Default'' may also be used to specify the default network (0.0.0.0). destination Any host or network. destmask Any host or network with an optional mask: all destination destination mask mask A mask is a dotted quad specifying which bits of the des- tination are significant. ``all'' may be used to specify any IP address may be matched. 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. gatewaylist A gateway list is a list of one or more gateways. interfacelist An interface list is a list of one or more interface names or addresses, or the token ``all,'' which refers to all interfaces. preference A preference determines 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 pre- ferred. In case of a preference tie, gated will choose the route with the shortest autonomous system path. If the auto- nomous system path lengths are identical, gated will chose the route with the lowest numeric next-hop gateway address. metric 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 gated remembers its current directory before parsing the configuration file and returns there after the parsing is complete. This insures that when the configu- ration file is reparsed, the %directory statements will work correctly. It also insures that core dumps, except those which occur during parsing, will be written to the directory from which gated is started. %include ``filename''; Causes the specified file to be parsed completely before resuming with this file. Nesting up to 10 levels is sup- ported. The maximum nesting level may be increased by changing the definition of FI_MAX in parse.h. Trace statements tracefile Specify the file to contain tracing output. Trace infor- mation is appended to this file unless replace is speci- fied. Bug: There is a potential interaction between %directory and tracefile. It is best to specify a rooted pathname for filename. traceoptions [traceoption [traceoption [ ... ]]] ; Change the tracing options to those specified. If no options are specified, tracing is turned off. Trace flags are: all 1i Turn on all of the following options. 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 reception. timer Timer scheduling. lex Objects the lexical analyzer locates in the con- fig file. parse Tokens the parser recognizes in the config file. config Redisplays statements read from the config file after they are parsed. This allows verification that the statements were parsed correctly. route Changes to the gated routing table. kernel Changes to the kernel's routing table. bgp BGP packets sent and received. May be modified by update and protocol. egp EGP packets sent and received. May be modified by update and protocol. rip RIP packets sent and received. May be modified by update. hello HELLO packets sent and received. May be modi- fied 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 egp or bgp. update Trace the contents of protocol packets. Definition statements options optionlist ; Sets gated options: noinstall Do not change kernel's routing table. Use- ful for verifying configuration files. gendefault BGP and EGP neighbors should cause the internal generation of a default route when up. This route will not be installed in the kernel's routing table, but may be announced by other protocols. Announcement is controlled by referencing the special protocol default. autonomoussystem autonomous system ; Sets the autonomous system of this router to be autonomous system. This option is required if BGP or EGP are in use. interface interfacelist interfaceoptions ; 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. Interface options are: metric metric Set the interface metric for this inter- face. This metric is used by RIP and HELLO. Specifying the metric here over- rides, but does not change, the metric set with ifconfig. preference pref Sets the preference for routes to this interface. passive Prevents gated from deleting the route to this interface if it is believed to be down due to lack of received routing informa- tion. martians { martianlist } ; Defines a list of martian addresses about which all routing in- formation is ignored. The martianlist is a semicolon separated list of symbolic or numeric hosts with optional masks. See destination/mask lists. 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 protocols (RIP and HELLO) and redirects (ICMP), the trustedgateways clause supplies a list of gateways providing valid rout- ing information, routing packets from others are ignored. This defaults to all gateways on the attached networks. In addition to routing packets to the remote end of pointopoint links and the broadcast address of broadcast capable interfaces, routing updates may be sent to specific gateways if they are listed in a sourcegateways clause and pointopoint or supplier is specified. Disabling the transmission and reception of rout- ing packets for the protocols may be specified with the interface clause. For exterior protocols (BGP, EGP), the autonomous system advertised to the peer is specified by the global autonomoussystem clause unless over- ridden by the asout parameter. The incoming autonomous system number is not verified unless asin is specified. Specifying metricout fixes the outgoing metric for all routes propagated to this peer. If the peer does not share a network, interface can specify which interface address to use when communicating with this peer and gateway can specify the next hop to use for all routes learned from this peer. An internal default is gen- erated when routing information is learned from a peer unless the nogen- default parameter is specified. rip yes|no|on|off|quiet|pointopoint|supplier [ { preference preference ; defaultmetric metric ; interface interfacelist [noripin] [noripout] ; ... trustedgateways gatewaylist ; sourcegateways gatewaylist ; } ] ; If yes or on is specified, RIP will assume quiet if there is only one interface and supplier if there are more than one. quiet specifies that no RIP packets will be generated. supplier specifies that RIP packets will be generated. pointopoint specifies that RIP packets will only be sent to gateways listed in the sourcegateways clause. If the RIP clause is not specified, the default is on. The default metric is 16, the default preference is 100. hello yes|no|on|off|quiet|pointopoint|supplier [ { preference preference ; defaultmetric metric ; interface interfacelist [noripin] [noripout] ; ... trustedgateways gatewaylist ; sourcegateways gatewaylist ; } ] ; If yes or on is specified, HELLO will assume quiet if there is only one interface and supplier if there are more than one. quiet specifies that no HELLO packets will be generated. supplier specifies that HELLO pack- ets will be generated. pointopoint specifies that HELLO packets will only be sent to gateways listed in the sourcegateways clause. If the HELLO clause is not specified, the default is off. The default metric is 30000, the default preference is 90. egp yes|no|on|off [ { preference preference ; defaultmetric metric ; group [asin autonomous system] [asout autonomous system] [maxup number] [preference preference] { neighbor host [metricout metric] [nogendefault] [gateway gateway] [interface interface] [sourcenet network] [minhello minhello] [minpoll minpoll] ; ... } ; ... } ] ; A group lists a group of EGP peers in one autonomous system. maxup specifies the maximum number of peers that will be maintained in the Up state. sourcenet specifies the network to query in EGP Poll packets, this is normally the shared network. The minimum EGP hello and poll intervals acceptable may be specified with the minhello and minpoll argu- ments, respectively. These are both specified as a time in seconds, minutes:seconds or hours:minutes:seconds. Any number of group clauses may be specified containing any number of neighbor clauses. Any parame- ters from the neighbor clause may be specified on the group clause to provide defaults for the group. The default metric is 255, the default preference is 200. bgp yes|no|on|off [ { preference preference ; defaultmetric metric ; peer host [linktype [up|down|horizontal|internal]] [metricout metric] [asin autonomous system] [asout autonomous system] [nogendefault] [gateway gateway] [interface interface] ; ... } ] ; Peer specifies the address of each BGP peer. A linktype internal is assumed if the neighbor's autonomous system is the same as my autonomous system. Otherwise, linktype horizontal is assumed. The default metric is 65535 and the default preference is 150 for exter- nal BGP and 250 for internal BGP. redirect yes|no|on|off [ { preference preference ; interface interfacelist [noicmpin] ; trustedgateways gatewaylist ; } ] ; Controls whether ICMP redirects are listened to. If not specified, the default is to listen to ICMP redirects unless RIP or HELLO are enabled and there is more than one interface. 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 20. Static statements Static routes are specified with static clauses. static { destination gateway gateway [preference preference] ; ... destination interface interface [preference preference] ; ... } ; Any number of static statements may be specified, each containing any number of static route definitions. The first form defines a static route through a gateway. The second defines a static interface route which is used for primitive support of multiple networks on one inter- face. The preference for static routes defaults to 50. Control statements Acceptance of routes from routing protocol peers and propagation of routes to routing protocol peers are controlled by accept and propagate clauses. accept proto bgp|egp as autonomous system [preferenceb preference] { acceptancelist } ; accept proto rip|hello|icmp { acceptancelist } ; accept proto rip|hello|icmp interface interfacelist [preference preference] { acceptancelist } ; accept proto rip|hello|icmp gateway gatewaylist [preference preference] { acceptancelist } ; acceptance_list: listen destmask [preference preference] ; nolisten destmask ; If no acceptance list is specified, all routes will be accepted. If an acceptance list is specified, the acceptance list is scanned for a match. If no match is found, the route is discarded. Rephrased, a nolisten all entry is assumed at the end of an acceptance list. propagate proto bgp|egp as autonomous system [metric metric] { propagationlist } ; propagate proto rip|hello [metric metric] { propagationlist } ; propagate proto rip|hello interface interfacelist [metric metric] { propagationlist } ; propagate proto rip|hello gateway gatewaylist [metric metric] { propagationlist } ; propagation_list: The propagation list specifies propagation based on the origi- nation of a destination: proto bgp|egp as autonomous system [metric metric] [ { announcelist } ] ; proto rip|hello|direct|static|default [metric metric] [ { announcelist } ] ; proto rip|hello|direct|static|default interface interfacelist [metric metric] [ { announcelist } ] ; proto rip|hello gateway gatewaylist [metric metric] [ { announcelist } ] ; announce_list: announce destmask [metric metric] ; noannounce destmask ; If no announce_list is specified, all destinations are announced. If an announce list is specified, a noannounce all is assumed at the end. Therefore, an empty announce list is the equivalent of noannounce all. Files /etc/gated.conf See also arp(ADMN), ifconfig(ADMN), netstat(TC), routed(ADMN), RFC 891, RFC 904, RFC 911, RFC 1058, RFC 1163, RFC 1164